Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by CharlesClarkson (Curate)
on Nov 15, 2001 at 23:01 UTC ( #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 to pass and assign ' ' to $name. It would likely be better to use:/^--from\s*([^@\s]+)/ which fails for --from and could simplify the code further.

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

Charles K. Clarkson

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://125642]
[marto]: which part don't you know how to do?
[marto]: oh
[Corion]: arunks: Maybe How do I make password prompts not echo back the user?? Or simply read it from STDIN.
[Corion]: arunks: Please do not ask us to write your program. You have to write your program yourself.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-01-20 14:27 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.