Re: [regex] How to check for non-space character?

2009-03-22 Thread Gilles Ganault
On Sat, 21 Mar 2009 08:53:10 -0500, Tim Chase python.l...@tim.thechases.com wrote: It looks like it's these periods that are throwing you off. Just remove them. For a 3rd syntax: (\S)(\d{5}) the \S (capital, instead of \s) is any NON-white-space character Thanks guys for the tips. --

[regex] How to check for non-space character?

2009-03-21 Thread Gilles Ganault
Hello Some of the adresses are missing a space between the streetname and the ZIP code, eg. 123 Main Street01159 Someville The following regex doesn't seem to work: #Check for any non-space before a five-digit number re_bad_address = re.compile('([^\s].)(\d{5}) ',re.I | re.S | re.M) I also

Re: [regex] How to check for non-space character?

2009-03-21 Thread Tim Chase
Gilles Ganault wrote: Hello Some of the adresses are missing a space between the streetname and the ZIP code, eg. 123 Main Street01159 Someville The following regex doesn't seem to work: #Check for any non-space before a five-digit number re_bad_address = re.compile('([^\s].)(\d{5}) ',re.I |

Re: [regex] How to check for non-space character?

2009-03-21 Thread John Machin
Gilles Ganault nospam at nospam.com writes: Hello Some of the adresses are missing a space between the streetname and the ZIP code, eg. 123 Main Street01159 Someville This problem appears very similar to the one you had in a previous episode, where you were deleting br / in address