Skip to content

Tag: regex

This regex works on regex101 but not in my script, why?

I have this regex: Which is not working as it should, see this code: I wrote my regex using this and it is working fine, until i add the regex to my script. https://regex101.com/r/EmebOT/1 If i replace [aàâ] with “â” in the regex so the regex looks like this, it works: Answer I got this working wi…

Regex to find repeated sentences from more to less

i have string like $string = “hello this is a string and hello but this is a string hello but this is a string and “; in it there is repeated words and repeated sentences but i only want the sentences so i expect hello but this is a string to be captured i tried using this regex (.{10,}).*?1 but