Answer the question
In order to leave comments, you need to log in
How to replace a lower case in a regular expression without touching the corresponding capital?
There is this code:
if (условие) $i = preg_replace('/https:\/\/site.com\/([^\s]*)a.jpg/U','https://site.com/$1b.jpg',$i);
Answer the question
In order to leave comments, you need to log in
This is how it works by default.
print preg_replace('/https:\/\/site.com\/([^\s]*)a.jpg/U','https://site.com/$1b.jpg', 'https://site.com/testa.jpg');
// https://site.com/testb.jpg
print preg_replace('/https:\/\/site.com\/([^\s]*)a.jpg/U','https://site.com/$1b.jpg', 'https://site.com/testA.jpg');
// https://site.com/testA.jpg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question