Is it possible to do something like this?
var pattern = /some regex segment/ + /* comment here */ /another segment/;
Or do I have to use new RegExp() syntax and concatenate a string? I'd prefer to use the literal as the code is both more self-evident and concise.
RegExp()
I prefer to use eval('your expression') because it does not add the /on each end/ that ='new RegExp' does.
eval('your expression')
/
='new RegExp'