93[jasspa] Re: numbers <-> bullets -- regexp bug/question
- Oct 11, 1999Detlef's got some good ideas here. I was messing around, trying to extend the concept, when I discovered the following weird behavior.
- When you use the regexp [0-9]+ in &xequal, it doesn't work at all.
- When you use [0-9]*, it works like [0-9]+, not matching the empty string but matching a string of digits.
- When you use these in query-replace-string, they work "correctly," i.e., '+' matches one or more of a char, '*' matches empty strings and any number of a char.
Here's my example. (The commented-out regexp is supposed to match lines like
" 13. Reinstall Windows again". The one left in matches lines like "123" only.)
; !if &xsequal @wl " *[0-9]+\..*" ; <--- what I want to do
!if &xsequal @wl "[0-9]*" ; <-- works like [0-9]+
set-variable #l0 &add 0 @wl
ml-write &spr "* found number %d" #l0
!force global-bind-key renumber "C-x n"
p.s. While we're discussing regexps, why are the \h, \l etc. functions not supported? These would be useful. My (admittedly limited) Unix in a Nutshell book documents these as being part of GNU regexp (they make letters/words uppercase/lowercase).
- << Previous post in topic Next post in topic >>