I am trying to write a regular expression that matches the whole word inside a specific line, but skips words inside brackets. I currently have one regex that matches all the words:
/[a-z0-9]+(-[a-z0-9]+)*/i
I also have a regex that matches all the words inside the brackets:
/\[(.*)\]/i
I basically want to match everything that matches the first regular expression, but not everything that matches the second regular expression.
Example input text: http://gist.github.com/222857 It must correspond to each word separately, without one in brackets.
Any help is appreciated. Thanks!
source share