CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Output mismatch: Edit Log



perlisgreat
Novice

Aug 13, 2009, 2:18 AM


Views: 5520
Output mismatch

Hi,

I have a string in log file from that i need to pick the username.

the string is like this--


Code
pid 2172 tid 3124: 160: 10110847: userName :[app@abc.com] 
pid 2172 tid 3124: 160: 10110847: userName :[napp@abc.com]
pid 2172 tid 3124: 160: 10110847: userName :[12345]
pid 2172 tid 3124: 160: 10110847: userName :[app@abc_sde.com]
pid 2172 tid 3124: 160: 10110847: userName :[567890]
pid 2172 tid 3124: 160: 10110847: userName :[dfgehj]


I want to take all the usernames here in the snippet. The code i have gives only the numeric part.

The output i am expecting is --


Code
app@abc.com 
napp@abc.com
12345
app@abc_sde.com
567890
dfgehj


Suggest to handle special characters in the username.

Thanks
NT


(This post was edited by perlisgreat on Aug 13, 2009, 4:37 AM)


Edit Log:
Post edited by perlisgreat (Novice) on Aug 13, 2009, 4:37 AM: the output required was not correct so put the correct ones.Sorry about that.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives