I’m trying to build my regular expression, but I’ve failed.
I’m trying to get everything after single or double dash (you can try it here):
var regEx = /(?<=[-{1,2}])[^-]\S*/g;
It works just fine, but it selects even if we have 3+ dashes too. I’ve tried something like /(?<=^[-{1,2}])[^-]\S*/g and /(?<=\b[-{1,2}])[^-]\S*/g, but then it crashes at all.
Thanks in advance.
Unfortunately
javascriptdoesn’t supportlookbehindYou can use this regex with
multilineoptionAfter this you can use group 1 to access the required match..