Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Removing data from a string with Regex

by CharlesClarkson (Curate)
on Nov 15, 2001 at 23:01 UTC ( [id://125642]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Removing data from a string with Regex
in thread Removing data from a string with Regex

That regex would allow --from @something.com to pass and assign ' ' to $name. It would likely be better to use:/^--from\s*([^@\s]+)/ which fails for --from @something.com and could simplify the code further.

while ( <FILE> ) { print $1 if /^--from\s*([^@\s]+)/; } or: print $1 if /^--from\s*([^@\s]+)/ while <FILE>;



HTH,
Charles K. Clarkson

Log In?
Username:
Password:

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

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

    No recent polls found