Reputation: 2742
I need to be able to match a price value from a string given the string starts with Shipping (UK):</span>
string
Shipping (UK):</span>£2.95
regex so far
(?<=\):<\/span>).*
I have tried to do something like this...
(?<=\Shipping (UK):<\/span>).*
but this does not work, what is the right way to construct this regular expression?
Upvotes: 0
Views: 45
Reputation: 59699
You need to escape the parenthesis in your current regex to get it to match:
(?<=Shipping \(UK\):<\/span>).*
Also, Charmander is correct, you don't want the shorthand \S
, you want just S
.
Upvotes: 2