dru145 has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I would be most gratefull if a monk can help me out so that I can stop banging my head ask my desk (it's starting to hurt).
I have the username out of these two patterns:
1. Sep 20 19:05:06 nts-sa-nam NA(shiva-NA): phen.2048: This Certificat +e has been renewed.<br><br> 2. Sep 21 04:40:46 nts-sa-nam NA(shiva-NA): [jlee] Certificate name 'h +jingi.512' has been revoked.
Here is the regex that I have so far:  m/(\w+\.(2048|512)).*renewed|revoked/ which matches the username in the first entry but not the second.

Any suggestions?

-Dru

Replies are listed 'Best First'.
Re: Help with Regex
by merlyn (Sage) on Sep 21, 2001 at 20:58 UTC
Re: Help with Regex
by suaveant (Parson) on Sep 21, 2001 at 20:59 UTC
    you need parens around the last bit...
    m/(\w+\.(2048|512)).*(renewed|revoked)/
    otherwise I belive you are matching just the word revoked in a revoked line...

                    - Ant
                    - Some of my best work - Fish Dinner

      Thanks guys, That was it! I didn't even think to look at that part of the pattern.

      -Dru (Another satisfied monk)