I have this regex: Sie haben sich mit folgender E-Mail-Adresse[a-zA-Z0-9öäüÖÄÜ<>\n\-=#;&?_ "/:.@]+Abmeldung<\/a>
. It works on regexr but not when I am using the re
library in Python:
data = "<my text (comes from a file)>"
search = "Sie haben sich mit folgender E-Mail-Adresse[a-zA-Z0-9öäüÖÄÜ<>\n\\-=#;&?_ \"/:.@]+Abmeldung<\/a>"
print(re.search(search, data))
Is there something I don't see?
Thank you!
the pattern you are using on regexr contains \-
but in your exemple shows \\-
wich may give an incorrect regex. (and add the r in front of of the string as jupiterby said).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.