Here's one that i use to do some matching on HP-UX iostat output :
The non numeric values were added afterwards, after they showed in some iostat output were i did not expected them. The regep thus allowed me to fix an annoying behaviour with minimal impact.m/^ ( NANQ|INF|NANS| # Possible non numerics \d+ # a number ... (?:[,\.]\d+)? # ... with an optional decimal part ) # memorise the value of : tin . \s+ ( NANQ|INF|NANS| # The same one \d+ (?:[,\.]\d+)? ) # memorise the value of : tout . \s+ (?:[\d\s\.,]|NANQ|INF|NANS)+ # Rest of the line . $/x
Another one :
This is some sar linux result line .s/^\d\d:\d\d:\d\d\s*(?:CPU|INTR)\s*//
Now some vmstat with sunOS:
s/de\s+sr\s+(\w\d|\w\w|\w\w\d|--|\s)+in\s+sy/de sr in sy/g
Cheers,
zlr.
In reply to Re: Need regexes with alternations in them for testing perl...
by ZlR
in thread Need regexes with alternations in them for testing perl...
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |