in reply to Getting my username from log

Try this regex:
m/\s+user=\W([\w\@\.]+)/
However, Regexp::Common::Email::Address has much better built-in scanning for email addresses, and I'd recommend you use that.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Replies are listed 'Best First'.
Re^2: Getting my username from log
by stevbutt (Novice) on Aug 15, 2012 at 16:33 UTC

    Thanks NetWallah

    This works for two of the cases but not the one where the username is not an email address i.e. doesnt contain an @

      ....Also if the email is user=jtkirk@starship-enterprise.com then I end up with jtkirk@starship

      Steve