I need some help, I have a replacement pattern:
/(?<!\S)(\b|\(|\[)(?:\d+\s*x\s*)?\d+(?:\.\d+)?\s*litres($|\s|\.|;|,|\)|\])/is
with function:
preg_replace('/(?<!\S)(\b|\(|\[)(?:\d+\s*x\s*)?\d+(?:\.\d+)?\s*litres($|\s|\.|;|,|\)|\])/is', '', $string);
which replace to '' - empty string and in 99% cases works great, however there is some which are not working as exprected.
So i.e.
Bottle (blue, 10 Litres) - will be replaced to Bottle (blue, instead of Bottle (blue,).
it looks like the right boundry {in example above ) sign} is being treated as a part of the string to replace. Any ideas?
cheers