Re: 2 Regex Questions

2010-08-17 Thread AlphaBravo
On Aug 17, 10:23 am, Peter Otten <__pete...@web.de> wrote: > AlphaBravo wrote: > >  2) How can I split a string into sections that MATCH a regex (rather > > then splitting by seperator). Tokenizer-style but ignoring every place > > from where I can't start a match? > >>> import re > >>> re.compile(

Re: 2 Regex Questions

2010-08-17 Thread Peter Otten
AlphaBravo wrote: > 2) How can I split a string into sections that MATCH a regex (rather > then splitting by seperator). Tokenizer-style but ignoring every place > from where I can't start a match? >>> import re >>> re.compile("[abc]+").findall("abcxaaa! abba") ['abc', 'aaa', 'abba'] -- http:/

2 Regex Questions

2010-08-16 Thread AlphaBravo
Hello Comp.Lang,Python, 1) How do I parse Basic Posix RE's in Python (i need it because of some old scripts and a specific OS developed in Seattle) 2) How can I split a string into sections that MATCH a regex (rather then splitting by seperator). Tokenizer-style but ignoring every place from wh