From: "Maurício" Date: 2003-01-08T00:26:53+09:00 Subject: Re: Regular expressions alternative >> Hi, >> >> Wouldn't it be a good idea to create a option (say, b) for regular >>expressions such that all characters (except / and \) would match >>themselves unless preceeded by a backslash? For instance: >> >> /http:\/\/www.ruby-lang.org/b >> >>would match only the site name (...) > you're essentially reversing the semantics of meta characters. 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. > this can lead to wired errors, when you don't realize the option > is set. This can happen with any of the existing options, i, x and o... > why not just write a function that escapes all > meta characters? 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. [...], Maur�cio