Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(?:(.+)(?:(?:\| )(--(?!-).+))|(.*))$
/

Description

This will parse command with/without arguments like:

command --arg1=string --arg2=string
Submitted by anonymous - 6 years ago