Awk and equivalence classes

Does gnu awk support POSIX equivalence classes ?

Is it possible to map [[= a =]] using awk, as is done in grep?

$ echo ábÅ | grep [[=a=]]
ábÅ

$ echo ábÅ | grep -o [[=a=]]
á
Å
+4
source share
2 answers

In the GAWK User Guide , "Caution: library functions that gawk uses for regular expression currently only recognize POSIX character classes; do not recognize matching characters or equivalence classes.".

Accordingly, you will need to write out the permitted equivalents in regex /[aáÅ]/or whatever you are looking for.

, , , , , .

+5

, :

. '[= ' =]. , "e" "e", "ê", "è" "é". '[[= e =]] , ' e, 'ê,' é 'è.

.

: , gawk , POSIX; .

+5

Source: https://habr.com/ru/post/1672622/


All Articles