I have string regex
"product_default_shipping_cost:\['(.*)'"
and string
"product_sale_price:['19.99'], product_default_shipping_cost:['1.99'], product_type:['Newegg']"
and i want get only 1.99
.
My code :
Pattern pattern = Pattern.compile(regex_string);
Matcher m = pattern.matcher(html);
while (m.find()) {
for (int i = 1; i <= groupCount; i++) {
Log.w(TAG,m.group(i));
}
}
But i have got 1.99'], product_type:['Newegg']
Strange that it regular expression works perfectly in python and SWIFT but not java. I can not change this regular. What could be the issue and how to fix it?
P.S i really can't change this regular, it takes dynamic