Skip to content

Instantly share code, notes, and snippets.

@DmitrySoshnikov
Created March 14, 2017 18:52
Show Gist options
  • Save DmitrySoshnikov/2d56977cbdf38901fc09c35e0b8bf814 to your computer and use it in GitHub Desktop.
Save DmitrySoshnikov/2d56977cbdf38901fc09c35e0b8bf814 to your computer and use it in GitHub Desktop.
// RegExp:
/x*?/
// 1. Char is main, repetition is secondary (modifier)
{
type: 'Char',
value: 'x',
modifier: {
value: '*',
nonGreedy: true
}
}
// 2. Repetition is main, char is secondary (expression)
{
type: 'Repetition',
modifier: '*',
nonGreedy: true,
expression: {
type: 'Char',
value: 'x'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment