hello,
could someone please tell why the red regex does not work - I need to be sure line contains on first filed
if and then [numbers][whitespace]=[whitespace] and the rest not important here
Code:
$ echo "if1 sfdsf\nif12 = jfsflk\n if4 = sfsf"|awk '$1~/^if[0-9]+/'
if1 sfdsf
if12 = jfsflk
if4 = sfsf
$ echo "if1 sfdsf\nif12 = jfsflk\n if4 = sfsf"|awk '$1~/^if[0-9]+[COLOR=#EF2929][[:space:]]*=[[:space:]]*[/color]/'
$ echo "if1 sfdsf\nif12 = jfsflk\n if4 = sfsf"|awk '$1~/^if[0-9]+[COLOR=#EF2929][ \t]+=[ \t]+[/color]/'
$