Does anyone have a regular expression that can match various types of text strings, including empty chains and word combinations?
"" (empty chain)
word1->word2
word1 -> word2
succesives \r\s\t
\n
etc. The words can contain digits, # symbols, or any symbol except \n.
I've tried using the following regex:
const expreg = new RegExp('([^"->"\n]->[^"->"\n])|(([^"->"\n]->[^"->"\n])\n)*');
But it's not capturing all the variations I need, such as
word1->
and it doesn't work for hello1->hello2 either.
((^(\s\r\t|\n|->)^(->|\n)->^(\s|\r|\t|\n|->)^(->|\n))|(^(\s|\r|\t|\n|->)^(->|\n)->^(\s|\r|\t|\n|->)^(->|\n)\n)|(\n)|([\s\r\t]+)|([\s\r\t]+\n))