in reply to quite weird regexp
You can use any non-alphanumeric character as the separator in a s/// or m// operator. This allows you to choose a separator which doesn't clash with the data in the string.
In this case, if you used the 'traditional' slash as the delimiter then you'd need to escape the slash that appears in the regex. By changing the separator, you don't need to do that.
You can also use 'bracketing' characters, like (, [, < or {. In that case you need to use the opposite character at the other end, like this:
s[something][else];
This is all explained in perldoc perlop.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: quite weird regexp
by chipmunk (Parson) on Nov 30, 2000 at 19:33 UTC | |
|
Re: Re: quite weird regexp
by clemburg (Curate) on Nov 30, 2000 at 19:45 UTC | |
|
RTF(antastic)M (Re: Re: quite weird regexp)
by larsen (Parson) on Nov 30, 2000 at 15:14 UTC |