Hi,
I am parsing the following file :
Users of Enterprise_VO: (Total of 1 license issued; Total of 0 licenses in use)
Users of Fusion: (Total of 4 licenses issued; Total of 0 licenses in use)
Users of Galaxy-AdvCTS: (Total of 5 licenses issued; Total of 0 licenses in use)
Users of Galaxy-AdvTech: (Total of 5 licenses issued; Total of 0 licenses in use)
Users of Galaxy-Common: (Total of 30 licenses issued; Total of 1 license in use)
But the below code is not able to match when there is a '_' or '-' in the string just after "Users of". For example 'Fusion' is matching but not 'Galaxy-AdvTech' and 'Enterprise_VO' etc.
while(<FILE>) { if(/^Users of ([\w+\_\-]):\s+\(Total of ([0-9]+) licenses issu +ed;\s+Total of ([0-9]+) (licenses|license) in use/) { print "$1 |$2|$3 \n"; } }
In reply to regular expression not matching by ghosh123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |