Brian D wrote:
> On Jun 11, 9:22 am, Brian D wrote:
>> On Jun 11, 2:01 am, Lie Ryan wrote:
>>
>>
>>
>>> 504cr...@gmail.com wrote:
I've encountered a problem with my RegEx learning curve -- how to
escape hash characters # in strings being matched, e.g.:
>>> string = re.escape('123#ab
I'm surprised it's been so difficult to find an example of the hash
character in a RegEx string -- for exactly this type of situation,
since it's so common in the real world that people want to put a pound
symbol in front of a number.
It's a character with no special meaning to the regex engine,
On Thu, 11 Jun 2009 15:22:44 +0100, Brian D wrote:
I'm surprised it's been so difficult to find an example of the hash
character in a RegEx string -- for exactly this type of situation,
since it's so common in the real world that people want to put a pound
symbol in front of a number.
It's a
On Jun 11, 2:01 am, Lie Ryan wrote:
> 504cr...@gmail.com wrote:
> > I've encountered a problem with my RegEx learning curve -- how to
> > escape hash characters # in strings being matched, e.g.:
>
> string = re.escape('123#abc456')
> match = re.match('\d+', string)
> print match
>
>
On Jun 11, 9:22 am, Brian D wrote:
> On Jun 11, 2:01 am, Lie Ryan wrote:
>
>
>
> > 504cr...@gmail.com wrote:
> > > I've encountered a problem with my RegEx learning curve -- how to
> > > escape hash characters # in strings being matched, e.g.:
>
> > string = re.escape('123#abc456')
> >
On Jun 11, 2:01 am, Lie Ryan wrote:
> 504cr...@gmail.com wrote:
> > I've encountered a problem with my RegEx learning curve -- how to
> > escape hash characters # in strings being matched, e.g.:
>
> string = re.escape('123#abc456')
> match = re.match('\d+', string)
> print match
>
>
504cr...@gmail.com wrote:
> I've encountered a problem with my RegEx learning curve -- how to
> escape hash characters # in strings being matched, e.g.:
>
string = re.escape('123#abc456')
match = re.match('\d+', string)
print match
>
> <_sre.SRE_Match object at 0x00A6A800>
pri
Subject: Re: How to escape # hash character in regex match strings
504cr...@gmail.com wrote:
> I've encountered a problem with my RegEx learning curve -- how to
> escape hash characters # in strings being matched, e.g.:
>
>>>> string = re.escape('123#abc456')
504cr...@gmail.com wrote:
> I've encountered a problem with my RegEx learning curve -- how to
> escape hash characters # in strings being matched, e.g.:
>
string = re.escape('123#abc456')
match = re.match('\d+', string)
print match
>
> <_sre.SRE_Match object at 0x00A6A800>
pr