Re: Looking for help with Regular Expression

2006-05-24 Thread Roger Miller
Seem to be a lot of regular expression questions lately. There is a neat little RE demonstrator buried down in Python24/Tools/Scripts/redemo.py, which makes it easy to experiment with regular expressions and immediately see the effect of changes. It would be helpful if it were mentioned in the RE d

Re: Looking for help with Regular Expression

2006-05-23 Thread lao_mage
'''\[(.*?)\]''' ?-> when this char after(*, +, ?, {n}, {n,}, {n,m}), the match pattern is not greedy e.g.1 String: 512.16[3][b]] Pattern:'''\[(.*)\]''' This will match "[3][b]]" e.g.2 String: 512.16[3][b]] Pattern:'''\[(.*)?\]''' This will match "[3]" and "[b]" -- http://mail.python.org/mailman

Re: Looking for help with Regular Expression

2006-05-23 Thread James Stroud
ProvoWallis wrote: > Hi, > > I'm looking for a little advice about regular expressions. I want to > capture a string of text that falls between an opening squre bracket > and a closing square bracket (e.g., "[" and "]") but I've run into a > small problem. > > I've been using this: '''\[(.*?)\]''

Looking for help with Regular Expression

2006-05-23 Thread ProvoWallis
Hi, I'm looking for a little advice about regular expressions. I want to capture a string of text that falls between an opening squre bracket and a closing square bracket (e.g., "[" and "]") but I've run into a small problem. I've been using this: '''\[(.*?)\]''' as my pattern. I was expecting th