--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote: > > > > > Personally I think replaceg/matchg should be the default one. > > Yes, on second thought, you are right. I believe matching could > return a multi-line string if I use \0\r for matchg third argument > (which you could of course vec.createfromlines).
Sure. > > have g switches. Anyway, I'm wondering may utilize the comment > > (?#...), though I don't know if it'll make any difference from > > Do RE's allow embedded comments? I did know that. > > > > regex.replace(var, "(?#-g)regexp", "string","var") > > If the above does not break any RE rules, it would be easy to > implement. I'd prefer not to add stuff to standard REs that I would > pre-interpret but which may break a standard RE. The man page of pcre says so: http://www.pcre.org/pcre.txt The sequence (?# marks the start of a comment that continues up to the next closing parenthesis. Nested parentheses are not permitted. The characters that make up a comment play no part in the pattern matching at all. If the PCRE_EXTENDED option is set, an unescaped # character outside a character class introduces a comment that continues up to the next new-line character in the pattern. > > As regards Python, I know nothing about it as I've never used it. > > I have not used it either, but in looking around for models for > implementing re's, I saw it did something different. Basically you > create a compiled re object, and then match is method against that > object with string to be matched as argument and which returns a > match object. Too complicated for PowerPro user needs, I guess, now > that I think more about it. Sean ------------------------ Yahoo! Groups Sponsor --------------------~--> Everything you need is one click away. Make Yahoo! your home page now. http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/JV_rlB/TM --------------------------------------------------------------------~-> Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
