There is a pattern ~//(.+?)//~s , but you need to make sure that it does not catch http://site , that is, it does not work when it comes // before :
How can this be done?
There is a pattern ~//(.+?)//~s , but you need to make sure that it does not catch http://site , that is, it does not work when it comes // before :
How can this be done?
Use the backward preview block (?<!:) ( find a match if there is no left to the current position : :
~(?<!:)//(.+?)//~s PHP has the ability to catch unwanted matches and filter them out using (*SKIP)(*FAIL) :
~\b(https?|ftps?)://(*SKIP)(*FAIL)|//(.+?)//~s Those. find \b(https?|ftps?):// , word boundary, protocols and :// , and then (*SKIP)(*FAIL) delete this match from the buffer, and the next match is searched for from the end of the previous match.
Source: https://ru.stackoverflow.com/questions/701178/
All Articles
~are these limiters? Issa flag? - Mikhail Vaysman