in reply to Re^2: Regular expression question
in thread Regular expression question

Hi rangersfan,

(/) This is the usual delimiter for the text part of a regular expression. you can also use (#) as delimiter. By using usual delimiter with regexp i have given the code below you can also refer that for your understand :-p

Replies are listed 'Best First'.
Re^4: Regular expression question
by rangersfan (Novice) on Mar 31, 2006 at 07:52 UTC
    learn something new everyday.... thanks!
      You can choose other symbols, eg the pipe symbol '|' or you can choose bracket pairs eg m{^abc}. Note that the slash '/' is the default character and using this allows you to omit the 'm' operator, eg /^abc/. The usual reason to choosing something other than the '/' is when matching on *nix paths so that you don't have to keep escaping the '/'s, eg /\/path\/to\/file/ versus m#/path/to/file#.

      You can also choose different delimiters for doing substitution, eg s|/path/to/|| or s{abc}{xyz}. Note when using paired brackets you need a set around both the "to be replaced" and the "replace with" strings.

      Cheers,

      JohnGG