Y
Y
Yii-sibnet2022-02-14 14:37:30
PHP
Yii-sibnet, 2022-02-14 14:37:30

What is the regular expression to remove all similar strings?

There is a module for parsing SimplePars, it works on Opencart and uses regular expressions for search and replace. In the instructions for it ( https://simplepars.top/index.php?page=note&n=37 ) I found the rule

{reg[#^(.*?)\s+?^(?=.*^\1$)#m]}| - Will delete two identical rows one after the other
How to write a rule that will remove all identical lines, not just consecutive ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yii-sibnet, 2022-02-14
@Yii-sibnet

Answer to my question
{reg[#^(.*?)\R+(?=(?s:.*?)^\1$)#m]}|

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question