Regular Expressions 101

Sponsor⁠s

Community Library

Your search did not match anything

Community Library Entry

1

Regular ExpressionOpen Workspace

/
(?xXmi) (?: (?# use non-capture for details in debugging) (?: (?<match> (?# If quoted value) (?<quot_char>(?<!\\)["']) (?# Quoted content) (?: (?: (?# Match as many characters that aren't quotation char) (?# or escape char as possible. ) (?:(?:(?!\k<quot_char>|\\)).+) (?: (?# Match any/all escape chars that do not have the) (?# quotation char following it. ) (?:(?:\\)*(?!\k<quot_char>))? (?# If there is an escape char followed by the quotation) (?# quotation char match them. ) (?:[\\]\k<quot_char>)? )*? ) ) (?<close_quot>\k<quot_char>) | (?# if simple token) (?<basic>[^ \n]+)+ ) ) (?<trail_ws>[ ]+)? )
/
gm

Description
Created·2020-07-09 01:44
Type·Substitution
Flavor·PCRE (Legacy)

Argument Parser

  • Quoted string aware

    • Both ' and "

    • Respects escaped forms: e.g. \' and \" are treated as a single char don't start or end a string token.

  • Works

    • Mostly
Submitted by disk0 <ww.github.com/disco0>
Open Workspace