Answer the question
In order to leave comments, you need to log in
How to modify a regular expression?
The expression itself: ([^@]{1}|^)(@[a-zA-z\.\d]+)
Example: https://regex101.com/r/9hfuzi/2/
From the question: How to correctly compose a regular expression in php?
1. It is necessary to exclude the dot (".") after @ - @.test (exclude)
2. It is necessary to exclude the repetition in the middle of the dot (".") more than 1 time (> 1) - @test..test (exclude)
3. You need to exclude the dot at the end of the @test expression you are looking for. (delete)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question