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 8295049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:26:54+00:00 2026-06-08T14:26:54+00:00

I have a pattern compiled as pattern_strings = [‘\xc2d’, ‘\xa0’, ‘\xe7’, ‘\xc3\ufffdd’, ‘\xc2\xa0’, ‘\xc3\xa7’,

  • 0

I have a pattern compiled as

pattern_strings = ['\xc2d', '\xa0', '\xe7', '\xc3\ufffdd', '\xc2\xa0', '\xc3\xa7', '\xa0\xa0', '\xc2', '\xe9']
join_pattern = '|'.join(pattern_strings)
pattern = re.compile(join_pattern)

and then I find pattern in file as

def find_pattern(path):
    with open(path, 'r') as f:
        for line in f:
            print line
            found = pattern.search(line)
            if found:
                print dir(found)
                logging.info('found - ' + found)

and my input as path file is

\xc2d 
d\xa0 
\xe7 
\xc3\ufffdd 
\xc3\ufffdd 
\xc2\xa0 
\xc3\xa7 
\xa0\xa0 
'619d813\xa03697' 

When I run this program, nothing happens.

I it not able to catch these patterns, what is am I doing wrong here?

Desired output
– each line because each line has one or the other matching pattern

Update

After changing the regex to

pattern_strings = ['\\xc2d', '\\xa0', '\\xe7', '\\xc3\\ufffdd', '\\xc2\\xa0', '\\xc3\\xa7', '\\xa0\\xa0', '\\xc2', '\\xe9']

It is still the same, no output

UPDATE

after making regex to

pattern_strings = ['\\xc2d', '\\xa0', '\\xe7', '\\xc3\\ufffdd', '\\xc2\\xa0', '\\xc3\\xa7', '\\xa0\\xa0', '\\xc2', '\\xe9']
join_pattern = '[' + '|'.join(pattern_strings) + ']'
pattern = re.compile(join_pattern)

Things started to work, but partially, the patterns still not caught are for line

\xc2\xa0 
\xc3\xa7 
\xa0\xa0 

for which my pattern string is ['\\xc2\\xa0', '\\xc3\\xa7', '\\xa0\\xa0']

  • 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-08T14:26:57+00:00Added an answer on June 8, 2026 at 2:26 pm

    escape the \ in the search patterns
    either with r"\xa0" or as "\\xa0"

    do this ….

     ['\\xc2d', '\\xa0', '\\xe7', '\\xc3\\ufffdd', '\\xc2\\xa0', '\\xc3\\xa7', '\\xa0\\xa0', '\\xc2', '\\xe9']
    

    like everyones been saying to do except the one guy you listened too…

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

Sidebar

Related Questions

I have a function that uses Pattern#compile and a Matcher to search a list
I have pattern like below hi hello hallo greetings salutations no more hello for
I have a pattern (.png image 4x4px) and have to fill the layout with
I have this pattern: ~^([a-z0-9]+[a-z0-9-]+[a-z0-9]+\.([a-z]+)(\.[a-z]+)?)$~i It will match the following: xxx.xxx or xxx.xxx.xxx (number
I have this pattern written ^.*\.(?!jpg$|png$).+$ However there is a problem - this pattern
Ok so if I have this pattern: ab&bc&cd&de&ef And I need to replace all
I have a text: <font class=myclass>class abc</font> and i have a pattern: class now,
For one NSString, I have N pattern strings. I'd like to extract substrings around
I have the following pattern matching case in a scala function: def someFunction(sequences: Iterable[Seq[Int]]):Seq[Int]
I have this module pattern that stores a bunch of vars. I want to

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.