Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:53:21+00:00 2026-06-13T06:53:21+00:00

>>> import re >>> s = ‘this is a test’ >>> reg1 = re.compile(‘test$’)

  • 0
>>> import re
>>> s = 'this is a test'
>>> reg1 = re.compile('test$')
>>> match1 = reg1.match(s)
>>> print match1
None

in Kiki that matches the test at the end of the s. What do I miss? (I tried re.compile(r'test$') as well)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:53:22+00:00Added an answer on June 13, 2026 at 6:53 am

    Use

    match1 = reg1.search(s)
    

    instead. The match function only matches at the start of the string … see the documentation here:

    Python offers two different primitive operations based on regular expressions: re.match() checks for a match only at the beginning of the string, while re.search() checks for a match anywhere in the string (this is what Perl does by default).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import numpy as np a = np.arange(1000000).reshape(1000,1000) print(a**2) With this code I get this
import org.joda.time.LocalDate; public class Test { public static void main(String[] args) { long time=System.currentTimeMillis();
import xlrd book = xlrd.open_workbook(File_1.xls) sheet = book.sheet_by_index(0) print sheet.row_values(0)[0] I am trying to
import xlwt import xlrd import os.path import os print os.path.abspath(os.curdir) #Create workbook and worksheet
import threading, time class test(threading.Thread): def __init__(self,name,delay): threading.Thread.__init__(self) self.name = name self.delay = delay
import java.util.Scanner; public class Test { private static int decimalNum = 0; private static
import numpy import math x = numpy.roots([2,-2,(21 - 21**2)]) print x[0], math.floor(x[0]) The output
import std.stdio; struct S { string m_str = "defaultString"; this(this) { writeln("In this(this)"); }
import sys import matplotlib import matplotlib.pyplot as plt print matplotlib.__version__, matplotlib.get_backend() def hit(event): sys.stderr.write('hit\n')
import subprocess proc = subprocess.Popen('git status') print 'result: ', proc.communicate() I have git in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.