Metacharacter
Encyclopedia
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.
Literal
Literal may refer to:*Literal and figurative language, taken in a non-figurative sense*Literal translation, the close adherence to the forms of a source language text...
meaning) to a computer program, such as a shell interpreter or a regular expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...
engine.
Examples
- In some Unix shellUnix shellA Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...
s and Windows PowerShellWindows PowerShellWindows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework...
, the ; (semicolon) character is a statement separator. - In many regular expression engines, the . (dot) character matches any character, not just a dot.
- In XMLXMLExtensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
and HTMLHTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
, the & (ampersand) character introduces an HTML entityCharacter encodings in HTMLHTML has been in use since 1991, but HTML 4.0 was the first standardized version where international characters were given reasonably complete treatment...
. - In many programming languageProgramming languageA programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
s, stringString (computer science)In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....
s are delimitedDelimiterA delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.Delimiters represent...
using quoteQuoteQuotation is the repetition of someone else's statement/thoughts. This can be in the form of words, songs, American Sign Language, written, or any other form of communication. Quotation marks are punctuation marks used in text to indicate the words of another speaker or writer...
s. In some cases, escape characterEscape characterIn computing and telecommunication, an escape character is a character which invokes an alternative interpretation on subsequent characters in a character sequence. An escape character is a particular case of metacharacters...
s (and other methods) are used to avoid delimiter collision. Example : "He said : \"Hello\"".