gawk and gensub

Hi,

$ echo "Hellooo" | gawk '{print gensub(/o{3}/, "z", 1)}'

doesn't return "Hellz" as expected while:

$ echo "Hellooo" | awk '{print gensub(/o+/, "z", 1)}'

produces "Hellz" correctly. Are the {m,n} quantifiers not supported in gensub?

I know that sub or gsub could do the job. It's just an example. I need gensub for the possibility it offers to use back references.

gawk 3.1.5

Use reinterval to enable this feature in gawk:

echo "Hellooo" | gawk --re-interval '{print gensub(/o{3}/, "z", 1)}'

Regards

Thank you Franklin52. Works like a charm. (should have read the man thoroughtly ).