From: SourceForge.net <no...@so...> - 2004-03-01 20:03:36
|
Bugs item #906616, was opened at 2004-02-28 16:34 Message generated for change (Comment added) made by dgp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=906616&group_id=10894 Category: 42. Regexp Group: current: 8.4.5 Status: Open Resolution: None Priority: 5 Submitted By: Rick Macdonald (rickmacd) Assigned to: Pavel Goran (pvgoran) Summary: lsearch -regexp error introduced in 8.4.2 Initial Comment: When a list containing an embedded list element starting with a number is used as a regexp in lsearch, a parsing error occurs: couldn't compile regular expression pattern: invalid repetition count(s) If the first element is a text string (eg {zxcv 1234}) the error does not occur. I hit this problem when moving from 8.3.3 to 8.4.5. I tried every 8.4 release (downloaded directly from SF and built fresh) and determined it first broke in 8.4.2. I hope this helps. /usr/local/src/tcltk/tcl8.4.1/unix$ gcc --version gcc (GCC) 3.3.3 20040125 (prerelease) (Debian) The details below apply to tests run on Solaris 5.8 and Linux (Debian sid). Platform/OS does not seem to be an issue. It is the {1234 zxcv} element in the following list that triggers the problem: % list "" 2134 qwer "1234 zxcv" 2345 asdf {} 2134 qwer {1234 zxcv} 2345 asdf In the examples below I'm searching an empty list but this is just to simplify the examples and isn't an issue. /usr/local/src/tcltk/tcl8.4.2/unix$ LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./tclsh % info patchlevel 8.4.2 % lsearch -regexp {} ^[list "" 2134 qwer "1234 zxcv" 2345 asdf] couldn't compile regular expression pattern: invalid repetition count(s) % lsearch -regexp {} ^[list "" 2134 qwer "zxcv 1234" 2345 asdf] -1 % lsearch -regexp {} ^[list "" 2134 qwer "asdf zxcv" 2345 asdf] -1 % exit /usr/local/src/tcltk/tcl8.4.1/unix$ LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./tclsh % info patchlevel 8.4.1 % lsearch -regexp {} ^[list "" 2134 qwer "1234 zxcv" 2345 asdf] -1 % lsearch -regexp {} ^[list "" 2134 qwer "zxcv 1234" 2345 asdf] -1 % lsearch -regexp {} ^[list "" 2134 qwer "asdf zxcv" 2345 asdf] -1 % exit ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2004-03-01 14:59 Message: Logged In: YES user_id=80530 so [lsearch] has nothing to do with this right. It's just a question of what strings form a legal regexp ? % regexp "^{} 2134 qwer {1234 zxcv} 2345 asdf" {} couldn't compile regular expression pattern: invalid repetition count(s) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=906616&group_id=10894 |