From: Robert Klemme Date: 2004-09-27T17:39:24+09:00 Subject: Re: whitespace string only "ts" schrieb im Newsbeitrag news:200409231619.i8NGJsO12622@moulon.inra.fr... > >>>>> "A" == Ara T Howard writes: > > A> what do you mean be complex? seems very simple? > > For you, not for this "poor" regexp engine :-) > > svg% ruby -rjj -e '" ".match(/^\s*$/)' > Regexp /^\s*$/ > 0 begline > 1 on_failure_jump ==> 4 > 2 charset \011-\012\014-\015 (0) > 3 maybe_finalize_jump ==> 1 > 4 endline > 5 end > Fastmap supplied : \011-\012\014-\015 > > String << >> pos=0 > > 0 begline | | > 1 on_failure_jump | | >4[0] > 2 charset | | > 3 maybe_finalize_jump | | > 1 on_failure_jump | | >4[1] > 2 charset | | > 3 jump | | > 1 on_failure_jump | | >4[2] > 2 charset | | > 3 jump | | > 1 on_failure_jump | | >4[3] > 2 charset | | F4[3] > 4 endline | | SUCCESS > svg% > > it really prefer to do this > > svg% ruby -rjj -e '" ".match(/[^\S]/)' Isn't this the same as /\s/? I mean /[^\S]/ means not not whitespace, doesn't it? > Regexp /[^\S]/ > 0 charset_not \000-\010\016-\037!-\377 (0) > 1 end > Fastmap supplied : \011-\015 > > String << >> pos=0 > > 0 charset_not | | SUCCESS > svg% Err... Those two regexps you present do not yield an equivalent result. Or did I miss something? Or did you mean to use /\S/ for the second one? Regards robert