python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Why isn't my re.sub finding all instances using my regex?
I'm using Python 3.10 on Windows 10 and trying the search below:
re.sub(r'(.*[A-Z]+[a-z]+)([A-Z])', r'\1 \2', 'JohnnyB Cool & JoeCool')
'JohnnyB Cool & Joe Cool'
If I use just "JohnnyB C...
limeri
Votes: 0
Answers: 1
Python re find diferent words with same pattern
I'm having a problem with this activity, I want search the words s/ABS, c/ABS, s/servo, c/servo, s/ESP, c/ESP, s/válvula, c/válvula and it would be great if it also matches s/c+ all of the previous wo...
Carlos Vertiz
Votes: 0
Answers: 1
How to remove a specific pattern from re.findall() results
I have a re.findall() searching for a pattern in python, but it returns some undesired results and I want to know how to exclude them. The text is below, I want to get the names, and my statement (re....
Bryan Saldanha
Votes: 0
Answers: 2
How to match nested LaTeX macros with re in Python?
I wanted to match LaTeX macros correctly even the nested ones. See the following:
s = r'''
firstline
\lr{secondline\rl{ right-to-left
\lr{nested left-to-right} end RTL }
other text
}
\...
javadr
Votes: 0
Answers: 1