Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Removing data from a string with Regex

by c (Hermit)
on Nov 15, 2001 at 02:16 UTC ( #125442=note: print w/replies, xml ) Need Help??

in reply to Removing data from a string with Regex

you may want to look at this to look over the basics of regular expressions. basically, i think you're wanting to match everything after the @. so you may want to look through perlre and look for what matches any single character and how to match it one or more times.

the other option, you might want to take on this one is splitting the string based on the @ and grabbing the first instance within the split. something like

$from = (split(/\@/, $from))[0];

humbly -c

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125442]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2023-06-01 10:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found