Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Metacharacter
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Character that has a special meaning to a computer program}} {{Lead rewrite|reason=definition and lead are only about regular expression metacharacters, but article is not |date=April 2019}} A '''metacharacter''' is a [[Character (computing)|character]] that has a special meaning to a computer program, such as a shell interpreter or a [[regular expression]] (regex) engine. In [[POSIX]] extended regular expressions, there are 14 metacharacters that must be ''escaped'' β preceded by a backslash (<code>\</code>) β in order to drop their special meaning and be treated literally inside an expression: opening and closing square brackets (<code>[</code> and <code>]</code>); backslash (<code>\</code>); caret (<code>^</code>); dollar sign (<code>$</code>); period/full stop/dot (<code>.</code>); vertical bar/pipe symbol (<code>|</code>); question mark (<code>?</code>); asterisk (<code>*</code>); plus and minus signs (<code>+</code> and <code>-</code>); opening and closing curly brackets/braces (<code>{</code> and <code>}</code>); and opening and closing parentheses (<code>(</code> and <code>)</code>). For example, to match the arithmetic expression <code>(1+1)*3=6</code> with a regex, the correct regex is <code>\(1\+1\)\*3=6</code>; otherwise, the parentheses, plus sign, and asterisk will have special meanings.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)