I have
^\s*(\w+(\,\w+)*\s*(:|,|\()(\(|\[)?\s*)
Which works great in extracting "commands" from two set of strings like this
**Strict pattern**
command:some text
command: some text
command,command2: some text
**Loose pattern**
command :some text
command( some text )
command, some txt
Here is link for more clarity in my problem. http://rubular.com/r/epTIiU32Dj
Can you please write two separate RegExp for strict and lose pattern?
So that using one RegExp, I just get strict-pattern-commands and using other I just get lose-pattern-commands.
Whenever, I am trying something, I end up overstepping each other pattern. I am not able to get a working RegExp for each pattern.