I need to write a regular expression to match the following pattern :
fltr_desc_name
that is.. "fltr" followed by an underscore followed by any number of words separated by underscore.
for example: I need a regular expression to match the following :
fltr_desc_name
fltr_nameone_nametwo
fltr_level_name_desc
and I am using it inside an "if" statement in "awk": for ex:
awk '/Transformation/ { if ($4=="Filter" && $5=="fltr_*") print $4,$5 }' filename
please help me in writing the regular expression and tell me how to use regular expression inside an "if" condition inside "awk" command. Thank you.
Need to use tilde character ~/ /
in matching regular expressions in awk, i.e.
if ($5 ~ /fltr_*/)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With