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

learn something new everyday.... thanks!

Replies are listed 'Best First'.
Re^5: Regular expression question
by johngg (Canon) on Mar 31, 2006 at 08:59 UTC
    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