I'm trying to check if there is a value between 'mystring' and the end character (which is a pipe). But
new RegExp('mystring:.+\|').test('bla')
Evaluates to true, even though I am escaping the '|' operator. What I was trying to achieve was this:
new RegExp('mystring:.+\|').test('mystring:|')
Evaluate to False (as nothing between 'mystring:' and the escaped '|'.
new RegExp('mystring:.+\|').test('mystring:something|')
Evaluate to True.
This isn't the behvaior I'm seeing as everything is evaluating to True and it doesn't look like the '|' is being escaped...