liveBook · Manning

Metacharacter

A regular-expression metacharacter is a character with special syntactic or matching meaning rather than a purely literal meaning.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Third Edition

A regex metacharacter is a character with special syntactic meaning in a regular expression.

How it is used
Distinguishes special regex syntax from characters matched literally.
How deep it goes
Defines the metacharacter set and explains escaping, while leaving each character’s individual meaning for later treatment.
Examples
Uses `/test/` and `[az]{5}` to illustrate literal sequences, character classes, and repetition.
What you can do after
Apply escaping to match special characters literally and distinguish regex literals from string-based patterns.

Read how Secrets of the JavaScript Ninja, Third Edition explains metacharacter →

Secrets of the JavaScript Ninja, Second Edition

A character in a regular expression that has a syntactic meaning rather than being matched literally.

How it is used
Frames metacharacters as part of a refresher on regular-expression syntax.
How deep it goes
Surveys common regular-expression characters but stops short of an exhaustive tutorial.
Examples
Names ^, $, ?, +, *, braces, -, |, backslash, and parentheses as examples.
What you can do after
Understand that listed characters carry regular-expression syntax rather than matching literally.

Read how Secrets of the JavaScript Ninja, Second Edition explains metacharacter →

Also covered in

Related concepts

Questions about metacharacter

What is metacharacter?

A regular-expression metacharacter is a character with special syntactic or matching meaning rather than a purely literal meaning.

Which Manning books explain metacharacter?

Secrets of the JavaScript Ninja, Third Edition and Secrets of the JavaScript Ninja, Second Edition.

What is the difference between metacharacter and injection attack?

A regular-expression metacharacter is a character with special syntactic or matching meaning rather than a purely literal meaning. An injection attack is a security attack in which crafted or untrusted input is interpreted as commands, code, or query structure by a target system.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.