So I am working with Regex inside JavaScript to get data matched from a plain text file with various list items starting with a dash "- ".
At first I used the following RegEx:
/(?<=- |\d\. ).*/g
But it turns out Positive Lookbacks aren't allowed to be used anymore in browsers so they currently only work with Chrome but no other browsers.
I then tried to get around this without using a lookback by using:
(\-\ |\d\.\ ).+
But this also selects the actual dash and first space which is also something I do not want as I need everything behind the first dash and space.
The info I have is formatted like:
- List item 1
- List item 2
- List item 3
- List item 4
And I require the output as "List item #" for every single row in the text file. Can someone perhaps guide me in the right direction to solve this or an alternative to the JavaScript .match() function?
Thanks in advance.