Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Removing data from a string with Regex

by c (Hermit)
on Nov 15, 2001 at 02:16 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found