Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python regex

Name: Anonymous 2009-03-23 0:52

Hey /prog/,
In python can regex flags be used outside of a compiled regex?

I want to do a bunch of matches on HTML tags without having to compile a regex for each one but I need the DOTALL flag to catch newlines.

re.findall(regex, string, flag) doesn't seem to work.

Name: Anonymous 2009-03-23 0:54

gb2/pr/

Name: Anonymous 2009-03-23 0:55

pass the flags with the compile

Name: Anonymous 2009-03-23 1:17

>>3
If I did that I would have to make an object for each regex I wanted. I'm not sure if I would be able iterate through regex objects easily in a for loop.

I just want to be able to have a list of tags I can add new tags to at any time without having to create an associated regex object.

Name: Anonymous 2009-03-23 1:38

Back to /pr/

Name: Anonymous 2009-03-23 1:49

>>5
They can't. 7chan is still down. Piece of shit website.

Name: Anonymous 2009-03-23 1:58

There some kind of meme associated with 7chan's /pr/? I don't lurk the textboards too often.

Name: Anonymous 2009-03-23 2:03

>>7
Who cares? I'd wish they'd hurry up and bring the stupid site back up again so all the idiots can go back to /pr/

Name: Anonymous 2009-03-23 2:19

Remember when they used to filer "SICP" to ``Berenstein Bears''?
Good times, /prog/, good times.

Name: Anonymous 2009-03-23 2:45

I remember the day they hadn't blocked tor yet, and they were fuqin angered at the results.

Name: Anonymous 2009-03-23 4:58

>>4
You're an idiot. Just FYI.

Name: Anonymous 2009-03-23 9:11

>>4
What the hell do you think Python does when you use the static methods? That's right, it compiles a new regex object every time you call the method. In conclusion, >>5,11.

Name: ​​​​​​​​​​ 2010-09-08 14:08

Don't change these.
Name: Email:
Entire Thread Thread List