Reputation: 2237
Here's what I have so far, I'm not a regex expert by any means....
I need to be able to match globally. (/g)
total-matched=\"([^\"]*)\"
total-matched="1618"
total-matched= "1618"
total-matched ="1618"
total-matched = "1618"
total-matched='1618'
total-matched= '1618'
total-matched ='1618'
total-matched = '1618'
Upvotes: 0
Views: 37
Reputation: 781503
total-matched\s*=\s*(["'])(.*?)\1
total-matched
- matched literally\s*
- optional whitespace before =
=
- matched literally\s*
- optional whitespace after =
(["'])
- match either type of quote, and remember it as \1(.*?)
- non-greedy match for any text, captured as group 2\1
- match the same kind of quote we matched earlierUpvotes: 2