2 ms·
As far as I know, 'match' function is part of POSIX spec for awk. Only the third array argument is specific to gawk. So, this should work for any awk. awk
by asicsp 6y ago
As far as I know, 'match' function is part of POSIX spec for awk. Only the third array argument is specific to gawk. So, this should work for any awk.
awk 'match($0, /^#+ /){l=RLENGTH-1; print "<h" l ">" substr($0,RLENGTH+1) "</h" l ">"}'
I checked it on https://awk.js.org/ https://awk.js.org/ and it did work