Tags: Programming Language.
A metacharacter is a character that has a special meaning (instead of a literal meaning) to a computer program such as a shell interpreter or a regular expression engine.In regular expressions there are 12 metacharacters that must always be preceded by a backslash to be used inside of the expression:The opening square bracket [ the closing square bracket ] the backslash the caret ^ the dollar sign $ the period or dot . the vertical bar or pipe symbol the question mark ? the asterisk or star * the plus sign + the opening round bracket ( and the closing round bracket ).If you want to use any of these characters as a literal in a regex you need to escape them with a backslash.