I am trying to loop over a dictionary of phone numbers and using a python
regex to determine if they are long distance or local and then adding them
to their appropriate dictionary, My regex doesn't appear to be working
though.
My regex's are these
international__iregex=r'^1?(011|001)'
I am trying to loop over a dictionary of phone numbers and using a python
regex to determine if they are long distance or local and then adding them
to their appropriate dictionary, My regex doesn't appear to be working
though.
My regex's are these
international__iregex=r'^1?(011|001)'
Support Desk wrote:
I am trying to loop over a dictionary of phone numbers and using a
python regex to determine if they are long distance or local and then
adding them to their appropriate dictionary, My regex doesn't appear to
be working though.
My regex's are these
On Thu, Sep 24, 2009 at 10:43 AM, Support Desk m...@ipglobal.net wrote:
I am trying to loop over a dictionary of phone numbers and using a python
regex to determine if they are long distance or local and then adding them
to their appropriate dictionary, My regex doesn't appear to be working
On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman sajmik...@gmail.com
wrote:
FWIW this problem is too simple (IMHO) for regular expressions.
Simply carve off the first three digits and check against sets of the
prefixes you're interested in:
#any number starting with these prefixes is not
On Thu, Sep 24, 2009 at 6:31 PM, Rhodri James
rho...@wildebst.demon.co.uk wrote:
On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman sajmik...@gmail.com
wrote:
FWIW this problem is too simple (IMHO) for regular expressions.
Simply carve off the first three digits and check against sets of the
Thanks Andrew. I was also of the same view that perl handled this via some
special cases.
On Wed, Apr 1, 2009 at 8:32 PM, andrew cooke and...@acooke.org wrote:
more exactly, my guess is perl has a special case for this that avoids
doing a search over all possible matchers via the pushdown
Hi,
I am trying to use the following snippet of code to print a regex match.
s = '01234567890123456789x012'
pat = r'(.*?x|[^a]+)*y'
mo = re.search(pat, s)
if mo is not None:
print mo.group(0)
By adding one character before the 'x' in the input string, the time taken
to print the match
.*? is a not greedy match, which is significantly more difficult to
handle than a normal .*. so the performance will depend on quite
complex details of how the regular expression engine is implemented. it
wouldn't surprise me if perl was better here, because it comes from a
background with a
more exactly, my guess is perl has a special case for this that avoids
doing a search over all possible matchers via the pushdown stack.
andrew cooke wrote:
.*? is a not greedy match, which is significantly more difficult to
handle than a normal .*. so the performance will depend on quite
10 matches
Mail list logo