liveBook · Manning

Literal match

As explained in Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

A literal match is a regular-expression match that requires a specified sequence of characters without pattern variation.

A literal match uses an exact string as a regular expression. In PowerShell, matching is case-insensitive by default, so Car matches CAR, car, Car, and CaR. section 21.2

Matching an exact word

Use Car when you want to find that character sequence rather than describe a variable pattern. Regex characters such as word markers, character sets, periods, and repetition operators extend matching beyond literals. section 21.2

How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it

How deep it goes
Defines exact-string matching and contrasts it with metacharacters and variable-text patterns, without developing a full matching procedure.
Examples
Uses Car to demonstrate exact text matching and PowerShell's case-insensitive variants.
What you can do after
Apply it via PowerShell to match a specified text sequence before introducing variable-pattern syntax.
How it connects
Connects literal matches to regular expressions, escape characters, character classes, and quantifiers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.