Metacharacter

Metacharacters or function characters are characters in a file or string that does not appear within a certain context for themselves, but similar control characters have special significance for the processing of the data. The meaning of metacharacters depends on the program with which the data are processed.

Frequently non- alphanumeric characters are selected as metacharacters. To metacharacters to use as a pure sign next to their special importance, rules are provided for masking often.

Examples

  • When importing a CSV file in a spreadsheet program has a character ( usually, or ;), the function of a delimiter, which separates individual items from each other, so that these elements are imported into different cells of the table.
  • When EDIFACT is communicated to the EDI program ( optional UNA segment ), which character for this file have the function data element separator, segment separator, escape character and element group separator. For a text editor, these characters, however, have no function.

Metacharacters in XML

In XML, the following characters are metacharacters < and & (at every point ) and ' or ' in attribute values.

Metacharacters in programming languages

Within a programming language metacharacters are the characters used for operators and separators. In C and C ajar programming languages ​​such as C , Java, PHP, Perl, Tcl, Python, Ruby, C #, for example, are usually the characters! " % & / () = {[ ]} \ * ~ <> |; :. - ^ And ' defined as metacharacters.

Metacharacters in regular expressions

In a regular expression metacharacters are the characters that are not for themselves, but of particular importance as an anchor, character class, or have similar quantifier. In most implementations of regular expressions following characters are metacharacters:

  • ^ ( Anchor to start ( line or string) )
  • $ ( Anchor to end ( line or string) )
  • ? * { } ( Quantifiers or repetition factors )
  • \ ( Converting the meta- status of a character ( a metacharacters lose their special meaning or a non- metacharacter receives a special meaning) )
  • . [] ( Character class )
  • & ( Back reference )
  • () ( Grouping)
  • | Alternative
355980
de