Basic and extended regular expressions are two variations on the syntax of the specified pattern. Basic Regular Expression (BRE) syntax is the default in sed (and similarly in grep).
Use the POSIX-specified -E option (-r, --regexp-extended) to enable Extended Regular Expression (ERE) syntax.
characters
| case | BRE and ERE | Perl |
|---|---|---|
| any char except newline | . |
. |
| word | [[:alphanum:]] |
\w |
| digit | [[:digit:]] |
\d |