|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Removing data from a string with Regexby jwest (Friar) |
| on Nov 15, 2001 at 02:14 UTC ( #125441=note: print w/ replies, xml ) | Need Help?? |
|
Instead of using substitution, you might try something like this:
The first line will take all the characters starting from the beginning of $from that aren't '@' and capture them to the special variable $1. Then, reassign $from to the value of $1. To do this with substitution, you could try: which would substitute the '@' and anything that followed with nothing. Hope this helps! --jwest
-><- -><- -><- -><- -><-
All things are Perfect
To every last Flaw
And bound in accord
With Eris's Law
- HBT; The Book of Advice, 1:7
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||