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

  • SEARCH
  • Home
  • 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 7976809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:00:34+00:00 2026-06-04T09:00:34+00:00

Using the following from Python – Check If Word Is In A String >>>

  • 0

Using the following from Python – Check If Word Is In A String

>>> def findWholeWord(w):
...     return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
... 
>>> findWholeWord('seek')('those who seek shall find')  
<_sre.SRE_Match object at 0x22c1828>
>>> findWholeWord('seek') 
<built-in method search of _sre.SRE_Pattern object at 0x22b8190>
>>> findWholeWord('seek')('those who seek shall find')  
<_sre.SRE_Match object at 0x22c1828>
>>> findWholeWord('seek')('those who shall find') 

Is this an error or this should be the result?

<_sre.SRE_Match object at 0x22c1828>
  • 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-04T09:00:36+00:00Added an answer on June 4, 2026 at 9:00 am

    That match object is the result, and from that you have access to some more functions like

    ['__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__format__'
    , '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__'
    , '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__','end', 'endpos'
    , 'expand', 'group', 'groupdict', 'groups', 'lastgroup', 'lastindex', 'pos', 're'
    , 'regs', 'span', 'start', 'string']
    

    so on the returned object you can for example do .span() to get the start and end index of the word you are looking for.

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

Sidebar

Related Questions

To launch programs from my Python-scripts, I'm using the following method: def execute(command): process
I'm using the following to execute a process and hide its output from Python.
In Python, I'm constantly using the following sequence to get an integer value from
I have the following script for sending mails using python import smtplib from email.mime.multipart
I'm using following code but cannot return data from MySQL. This is the output:
I'm using the new print from Python 3.x and I observed that the following
I'm using the following method to send mail from Python using SMTP. Is it
I've been using the following memoizing decorator (from the great book Python Algorithms: Mastering
Using IPython .10-2, I can do the following from a python command line program:
I am using following code to load an image from internal memory to tab

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.