Код: Выделить всё
something foo somethingelse // matches: [something, foo, somethingelse]
something1 something.foo-somethingelse // matches: [something1, something, foo, somethingelse]
Код: Выделить всё
something1 something>foo-.somethingelse // matches: [something1, something, somethingelse]
Код: Выделить всё
(?(?)(\w+)|\w+)
(? - if
(? - literal '>'
)
(\w+) - capture a group of 1 or more word characters
| - else
\w+ - match 1 or more word characters without capturing them
)
Также поправьте меня, пожалуйста, если это не так.
Подробнее здесь: https://stackoverflow.com/questions/790 ... -a-specifi