regEx works in notepad++ but not in python -
Let's say we have it:
........ ....... === Operation 'ABCD :: DDCA: DSD' ends in 1.234 AS / 1.234 AS (100.00%) ............... . ^ \ = * Operation '([\ d \ D] *)' ended ( \ D *. S * s / (\ d *. \ D *) s \ ([\ d \ D] * \) Execution Time I want to Operation something I did not try \\ (), but it was not working. I think I do not have to do this because I use r "[exp]" Any idea about getting similar results in the form of Notepad ++?
LE: Tried only with it: exp = re.compile (r "^ \ = * operation \ '([\ d \ D] *) \'", flags = re.multi) is still not getting anything.
LE2: I am using the code later groups = exp.match (INPUT) and < Code> groups.group (n) Answers get added: The problem was match . Using search code> Fixed a problem
< P> The regular expression described in the question is working without any change for me. & gt; & Gt; S = "" ... ... ................. ... === Operation 'ABCD :: DDCA: DSD' 1.234 AS / 1 .3434 (100.00) %) Execution timed out ............... .. "" ">> gt;> import re> gt; & gt; exp = Re.compile (r "^ \ = * operation \ '([\ d \ D] *) \' has expired (\ d *. * D *) s \ s * / (\ d *. \ D *) S \ ([\ D \ D] * \) Execution Time ", Flags = Rev. M)> gt;> Re-Exchange (XP, S) & lt; _sre.SRE_Match Object 0x1038766b8 & gt; & Gt ;> <2> To consider two things: Ol>
In flags logic again using using Method for matching search or search . Make sure that you are not using re.match because it only triggers the beginning of the string Will match.
Comments
Post a Comment