On Thu, Sep 24, 2009 at 6:31 PM, Rhodri James
wrote:
> On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman
> 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:
>>
>>
>>
On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman
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 long distance
local_pr
On Thu, Sep 24, 2009 at 10:43 AM, 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.
"doesn
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
international__iregex=
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)' #A
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)'
local__ire
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 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 stack.
>
> andrew
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
".*?" 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
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 doub
10 matches
Mail list logo