awk's curly braces (regex)

rank1seeker at gmail.com rank1seeker at gmail.com
Wed Nov 4 20:10:19 UTC 2015


10.2-RELEASE-p6

# awk --version
awk version 20121220 (FreeBSD)

# echo 2015 | awk '/^[0-9]/ {print}'
Prints '2015'

# echo 2015 | awk '/^[0-9]{4}/ {print}'
Won't

Why range/interval specified via curly braces doesn't work.
PS: Yes I've tried escaping it with backslahes and double backslahes, nada!

man pages:
--
Regular expressions are as in egrep; see grep(1).
--


Domagoj S.


More information about the freebsd-hackers mailing list