Awk regex question
Code:
[uncle-c@localhost temp]$ cat awktxt Code:
[uncle-c@localhost temp]$ awk ' $1 ~ /[(A|M)*]/ { print $0 }' awktxt Code:
[uncle-c@localhost temp]$ awk ' $1 ~ /[(A|M)]*/ { print $0 }' awktxt Thanks, UC |
The first expression, [(A|M)*], matches any string containing any of the symbols "(", "A", "|", "M", ")" or "*"; the second [(A|M)]*] matches any expression containing zero or more of the symbols "(", "A", "|", "M" or ")"; the third is the same as the second except one or more match is required.
To do what I think you want to do, the correct expression is [AM]+. |
Ahhhhh ! I see !! Thanks for explaining !
cheers, UC |
All times are GMT -5. The time now is 01:59 AM. |