benhoyt / goawk

A POSIX-compliant AWK interpreter written in Go, with CSV support

Home Page:https://benhoyt.com/writings/goawk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regular expression does not match multi-line string

ko1nksm opened this issue · comments

Regular expression does not match multi-line string.

$ goawk 'BEGIN{VAR="a\nb"; print match(VAR, /^a.*b$/)}'
0
$ goawk 'BEGIN{VAR="a\nb"; print match(VAR, /(?s)^a.*b$/)}'
1

$ gawk 'BEGIN{VAR="a\nb"; print match(VAR, /^a.*b$/)}'
1
$ mawk 'BEGIN{VAR="a\nb"; print match(VAR, /^a.*b$/)}'
1

Fixed in #133 (also in the other cases where this applies).