in reply to Concatenating regexs?
also, you realize that $print =~ s/([a,e,O])I/\1j/g; matches , as well as a e and O? if you don't want to match comma use [aeO] [] is a character class, so it looks at characters, so a separator is not necessary.
also I believe that using $1 in the second half of the substitution is preferred to \1... perl -w would tell you that...
you can do $print =~ s/([b-zA-Z]):/\1/g; which should be much faster than $print =~ s/([b-z]|[A-Z]):/\1/g; character classes can have as many ranges as you want in them.... but the (|) will slow you down compared to a straight character class...
Update Oops... 9|3: does match 9 or 3:... my bad, ignore the next line
not sure, do you want 9|3: to match '9|3:' or do you want it to match '9' or '3:'... it will match the former...
- Ant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Concatenating regexs?
by Micz (Beadle) on May 04, 2001 at 18:56 UTC | |
by suaveant (Parson) on May 04, 2001 at 19:06 UTC |