Regex: match at least 3 characters per line in a specific order

How to search inside a given string so that a match is recorded every 3 (or more) characters ordered ? I use it to apply some conditional restrictions in the input of an HTML search ... My best attempt so far:

/[deleted]{3,}/g

I need " del ", " ele ", " let ", " ete " or " ted ", but also " dele ", " eted " or even the complete remote > ". The previous regex does the trick, but now the problem is in order characters, since it also captures strings such as " ltd " or " eded " that are out of order with the word and should not.

Any help?

Thanks in advance.

+4
source share
1 answer

, , . . . :

, PHP, ( ) @Tushar :

strpos('deleted', $inputString) !== false

, , . , , :

strpos($inputString, 'deleted') !== false

" " "", , , stackoverflow... , @Tushar . . , .

0

Source: https://habr.com/ru/post/1682109/


All Articles