Re: re.match and non-alphanumeric characters

2008-11-16 Thread John Machin
On Nov 17, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > John Machin schrieb: > > > On Nov 17, 4:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >>  Match matches the whole string. > > > *ONLY* if the pattern ends with "$" or r"\Z" > > You think so? > > import re > > rex = re.c

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Steve Holden
Diez B. Roggisch wrote: > John Machin schrieb: >> On Nov 17, 4:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> >>> Match matches the whole string. >> >> *ONLY* if the pattern ends with "$" or r"\Z" > > > You think so? > > import re > > rex = re.compile("abc.*def") > > if rex.match("ab

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Diez B. Roggisch
John Machin schrieb: On Nov 17, 4:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Match matches the whole string. *ONLY* if the pattern ends with "$" or r"\Z" You think so? import re rex = re.compile("abc.*def") if rex.match("abc0123455678def"): print "matched" Diez -- http

Re: re.match and non-alphanumeric characters

2008-11-16 Thread John Machin
On Nov 17, 4:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Match matches the whole string. *ONLY* if the pattern ends with "$" or r"\Z" -- http://mail.python.org/mailman/listinfo/python-list

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Diez B. Roggisch
The Web President wrote: > Dear all, > > this is really driving me nuts and any help would be extremely > appreciated. > > I have a string that contains some numeric data. I want to isolate > these data using re.match, as follows. > > bogus = "IFC(35m)" > data = re.match(r'(\d+)',bogus) > print

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Gabriel Genellina
En Sun, 16 Nov 2008 14:33:42 -0200, The Web President <[EMAIL PROTECTED]> escribió: I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = "IFC(35m)" data = re.match(r'(\d+)',bogus) print data.group(1) I would expect to have "35" pri

Re: re.match and non-alphanumeric characters

2008-11-16 Thread MRAB
On Nov 16, 4:33 pm, The Web President <[EMAIL PROTECTED]> wrote: > Dear all, > > this is really driving me nuts and any help would be extremely > appreciated. > > I have a string that contains some numeric data. I want to isolate > these data using re.match, as follows. > > bogus = "IFC(35m)" > dat

Re: re.match and non-alphanumeric characters

2008-11-16 Thread r
On Nov 16, 10:33 am, The Web President <[EMAIL PROTECTED]> wrote: > Dear all, > > this is really driving me nuts and any help would be extremely > appreciated. > > I have a string that contains some numeric data. I want to isolate > these data using re.match, as follows. > > bogus = "IFC(35m)" > da