# match

    .match content:{InlineMarkdownContent} \
           pattern:{String} \
       replacement:{Lambda}
    -> Node

Content copied to clipboard

Finds every substring of content that matches the regular expression pattern and replaces each match with the inline content produced by replacement.

Matches are searched within plain text leaves only: existing inline structure (links, emphasis, code spans, transformed text, etc.) is preserved around the matches.

The replacement lambda receives the matched substring as its single argument and returns inline content to insert in its place. If pattern is empty, content is returned unchanged.

Example:

    .match {Quarkdown takes its name from quarks} pattern:{[Qq]uark(down|s)?}
        match:
        **.match**

Content copied to clipboard

Output:

> Quarkdown takes its name from quarks

#### Return

content with every match of pattern replaced by the output of replacement

#### Parameters

content

inline content to scan for matches

pattern

regular expression to match

replacement

- Likely a body argument

lambda invoked with each matched substring, producing the inline content that replaces it

#### Throws

IllegalArgumentException

if pattern is not a valid regular expression