S
S
spido2021-07-02 01:23:42
PHP
spido, 2021-07-02 01:23:42

How to add an exception for numbers greater than 11 characters in a regular expression?

Greetings!
I use a regular expression in a function that recognizes various combinations of phone numbers and removes them from the text.
'/((\+?\d{1,3}[\d{2,}\.\- \(\)]{11,}))|(\+?[\d]{10,}) /m'

However, numbers that have more than 11 characters are also removed from the text.
Photos on the site have the name 1_2017092902182426089.jpg, 123451_2017092902182426089.png.
expression cuts out 11 characters from the name of the photo.
Can you help fix the expression so it doesn't cut numbers that have more than 11 numbers?

Thanks in advance for any help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question