[issue11204] re module: strange behaviour of space inside {m, n}

Serhiy Storchaka report at bugs.python.org
Sun Dec 2 23:40:27 CET 2012


Serhiy Storchaka added the comment:

$ echo 'bbbbbaaa' | grep -o 'b\{1,3\}a'
bbba
$ echo 'bbbbbaaa' | grep -o 'b\{1, 3\}a'
grep: Invalid content of \{\}
$ echo 'bbbbbaaa' | egrep -o 'b{1,3}a'
bbba
$ echo 'bbbbbaaa' | egrep -o 'b{1, 3}a'
$ echo 'bbb{1, 3}aa' | LC_ALL=C egrep -o 'b{1, 3}a'
b{1, 3}a

I.e. grep raises error and egrep chooses silent verbatim meaning. I don't know what any standards say about this.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11204>
_______________________________________


More information about the Python-bugs-list mailing list