is this a known re 'bug/feature'? 
Author Message
 is this a known re 'bug/feature'?

I find the following bug/feature/difference between the new and older re modules, is
this a known feature?  Seems like the new re doesn't like {m,n} modifiers.

Quote:
>>> import re, pre
>>> P = re.compile('\\{(M{1,5}|YYYY|YY|D{1,4})\\}',re.MULTILINE|re.IGNORECASE)
>>> oP = pre.compile('\\{(M{1,5}|YYYY|YY|D{1,4})\\}',re.MULTILINE|re.IGNORECASE)
>>> P.match('{MMMMM}')
>>> oP.match('{MMMMM}')

<pre.MatchObject instance at 0113B754
--
Robin Becker


Fri, 04 Jul 2003 21:47:47 GMT  
 is this a known re 'bug/feature'?

Quote:

> I find the following bug/feature/difference between the new and
> older re modules, is this a known feature?  Seems like the new re
> doesn't like {m,n} modifiers.

> >>> import re, pre
> >>> P = re.compile('\\{(M{1,5}|YYYY|YY|D{1,4})\\}',re.MULTILINE|re.IGNORECASE)
> >>> oP = pre.compile('\\{(M{1,5}|YYYY|YY|D{1,4})\\}',re.MULTILINE|re.IGNORECASE)

note that the flag values differ between SRE and PCRE, so
you should make sure to use flags from the right module...

(not that it seems to matter in this case)

Quote:
> >>> P.match('{MMMMM}')
> >>> oP.match('{MMMMM}')
> <pre.MatchObject instance at 0113B754

there is definitely a bug hiding in here, but I'm not sure it's
related to the {m,n} syntax -- the "re" version works if you
remove the IGNORECASE flag (!?).

I'll investigate.

(In the meantime, feel free to post this bug report to the
SF bug tracker).

Thanks /F



Sat, 05 Jul 2003 01:20:00 GMT  
 is this a known re 'bug/feature'?

Quote:
> (In the meantime, feel free to post this bug report to the
> SF bug tracker).

I posted it myself:

http://sourceforge.net/bugs/?func=detailbug&bug_id=128899&group_id=5470

Cheers /F



Sat, 05 Jul 2003 02:06:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Feature or Bug (F90 advance='no')

2. Features/ports/bug fixes for MCC's patches to Scheme->C

3. bug or feature? unset widget's textvar

4. problem solved, but I don't know why (was: GNAT implementation bug)

5. Bug or feature? 'abc'.split('') rejects empty separator

6. 'who am i' from unix

7. FEATURE REQUEST: 'my' local variables

8. FEATURE REQUEST: 'my' local variables

9. 'select all' feature in TK

10. Feature request: 'apply' command

11. Does anybody know 'Enfin'?

12. linking Tasm obj's or lib's to (ugh, I know) Pascal

 

 
Powered by phpBB® Forum Software