I'll start with...
$all = ~s/[.|]+/|/g;
Have a look at perlop for details, but ~ is bitwise negation (so ~1 is 4_294_967_294). The s/// operator returns the number of replacements done, so that's what the ~ would be operating on. This is what happens:
The $all =~ s/[.|]+/|/g; syntax is one I'm guessing you're familiar with. In that case, the substitution is done on the variable $all.
Update: Oops, I answered the wrong question.
In reply to Re: question on regexp:
by kyle
in thread question on regexp:
by roc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |