From: Gavin Sinclair Date: 2003-01-08T00:35:45+09:00 Subject: Re: Regular expressions alternative On Wednesday, January 8, 2003, 2:26:53 AM, Maur�cio wrote: > I think I'm only standardizing. a matches a, so, $ matches $. > If you want something special, preceed it with a backslash. I > think that should have been done in the first place. Most things are done for a reason, and this is no exception. Regex in Vim is done mostly the way you're talking about, and it is frustrating getting lost in a sea of backslashes all the time. > I want to be able to create a regular expression without > knowing by heart all existing special characters. I would > like, for instance, to write a regexp that matches > 100% (or any number like \d\d%) without knowing if % is > a special character or not. Even the existing function > Regexp.escape doesn't help with that. irb can help, though :) irb(main):001:0> "89%" =~ /(\d+)%/ => 0 irb(main):002:0> $1 => "89" Gavin