so i have a file of lines like so....
valueA +920.32 % valueA +479.89%
valueB +886.82 % valueB +424.59%
--- insert more similar lines ---
And I was using the following Regex to get only the two percents and store them in an array
myObject.valueA = text.match(/(?<=valueA)(?:.+?(?=%))/g);
resulting in which is what I desire
valueA: Array [ " +920.32 ", " +479.89" ]
I was very happy with that, and keep moving forward with my little project until I was trying to test it with my friend on an iPhone, and nothing happened. Which I have found out is due to safari not supporting positive look behinds so I have been looking for something to produced a similar result.
With a positive look ahead I got close but it included 'valueA ' in the result which i really don't want to have to remove with an extra line of code.
(?=valueA)(?:.+?(?=%))
Result
valueA: Array [ "valueA +920.32 ", "valueA +479.89" ]
I'm sure there's a simple way to do this, but I've been messing around on RegExr and had no luck. Thank you ahead of time.