Thank you all. I got it. :)
I need to read more between lines .
On Wed, Feb 19, 2014 at 4:25 AM, spir wrote:
> On 02/18/2014 08:39 PM, Zachary Ware wrote:
>
>> Hi Santosh,
>>
>> On Tue, Feb 18, 2014 at 9:52 AM, Santosh Kumar
>> wrote:
>>
>>>
>>> Hi All,
>>>
>>> If you notice the below example,
On 02/18/2014 08:39 PM, Zachary Ware wrote:
Hi Santosh,
On Tue, Feb 18, 2014 at 9:52 AM, Santosh Kumar wrote:
Hi All,
If you notice the below example, case I is working as expected.
Case I:
In [41]: string = "test"
In [42]: re.match('',string).group()
Out[42]: ''
But why is the raw string
On 2/18/2014 11:42 AM, Mark Lawrence wrote:
On 18/02/2014 18:03, Steve Willoughby wrote:
Because the regular expression means “match an angle-bracket
Please do not top post on this list.
Appropriate trimming is also appreciated.
Emile
___
_
> From: Steve Willoughby
>To: Santosh Kumar
>Cc: python mail list
>Sent: Tuesday, February 18, 2014 7:03 PM
>Subject: Re: [Tutor] Regular expression - I
>
>
>Because the regular expression means “match an angle-bracket character,
&g
does any one know how to use 2to3 program to convert 2.7 coding 3.X please i
need help sorry
On Tuesday, 18 February 2014, 19:50, Zachary Ware
wrote:
On Tue, Feb 18, 2014 at 11:39 AM, Zachary Ware
wrote:
> >>> ''
> ''
>
> The equivalent raw string is exactly the same in this case:
On Tue, Feb 18, 2014 at 11:39 AM, Zachary Ware
wrote:
>>>> ''
>''
>
> The equivalent raw string is exactly the same in this case:
>
>>>> r''
>''
Oops, I mistyped both of these. The repr should be '' in both cases.
Sorry for the confusion!
--
Zach
_
On 18/02/2014 18:03, Steve Willoughby wrote:
Because the regular expression means “match an angle-bracket character,
zero or more H characters, followed by a close angle-bracket character” and your
string does not match that pattern.
This is why it’s best to check that the match succeeded bef
Hi Santosh,
On Tue, Feb 18, 2014 at 9:52 AM, Santosh Kumar wrote:
>
> Hi All,
>
> If you notice the below example, case I is working as expected.
>
> Case I:
> In [41]: string = "test"
>
> In [42]: re.match('',string).group()
> Out[42]: ''
>
> But why is the raw string 'r' not working as expected
Because the regular expression means “match an angle-bracket character,
zero or more H characters, followed by a close angle-bracket character” and
your string does not match that pattern.
This is why it’s best to check that the match succeeded before going ahead to
call group() on the result
The problem is not the use of the raw string, but rather the regular expression
inside it.
In regular expressions, the * means that whatever appears before it may be
repeated zero or more times. So if you say H* that means zero or more H’s in a
row. I think you mean an H followed by any numbe
Steve,
i am trying to under r - raw string notation. Am i understanding it wrong.
Rather than using "\", it says we can use the "r" option.
http://docs.python.org/2/library/re.html
Check the first paragraph for the above link.
Thanks,
santosh
On Tue, Feb 18, 2014 at 11:33 PM, Steve Willoughb
Hi All,
If you notice the below example, case I is working as expected.
Case I:
In [41]: string = "test"
In [42]: re.match('',string).group()
Out[42]: ''
But why is the raw string 'r' not working as expected ?
Case II:
In [43]: re.match(r'',string).group()
12 matches
Mail list logo