简体   繁体   中英

Regex Not match all occurrences

Hi I wrote an app in C# using htmlagilitypack. That is parsing prices from a webpage. The console oput looks like this;

RRP ?142 - Now ?113
?57.99&nbsp;nbsp<incl. VAT>$nbsp:
RRP ?50.00 - Now ?39.99

The problem which I am finding is that the regex which I wrote is picking up some of the first prices for the RRP and not the now price, The regex which I am using is below.

^[^£]*£(?:[0-9\.,]+)[^£]*£([0-9\.,]+)

I was just wondering why this is picking up some of the correct prices but not every single one. Thanks for any advice which you can give.

试试这个正则表达式我尝试了它,似乎很好

\w{1,}\s{1,}\?\d{1,}(.\d{1,}|)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM