What is the most widely used word anchor used in Regex?

Hello, All

I learned from book about word anchor "\<" and "\>"; however when I tested them, they seem to work only in grep.

Can anyone suggest word anchor that can be used in grep, awk, perl ...?

In perl, the word anchor is \b

1 Like

Thank you.
Is there any word anchor for AWK?

Don't know about other awk implementations but gawk does have these egrep like regexp characters. From man gawk :

       \y         matches the empty string at either the beginning or the  end
                  of a word.

       \B         matches the empty string within a word.

       \<         matches the empty string at the beginning of a word.

       \>         matches the empty string at the end of a word.
1 Like