V
V
Vlad2018-01-07 21:52:37
PHP
Vlad, 2018-01-07 21:52:37

How to unload all phone numbers from text?

Tell me, please, how to unload all phone numbers from a footcloth of text?
Here is an example of entering phone numbers:
1) 372 123456
2) 372123456
3) 372 12 34 56
4) 12 3456
5) text123456text

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Antonio Solo, 2018-01-07
@solotony

use regular expressions preg_match

A
Andrew, 2018-01-08
@mhthnz

Regular, but it will probably take too much, you still need to make a post check of all the results, or adjust this regular to the text (make the matching more strict):

preg_match_all("/\d{2,3}(?:\s*)\d+/", $input_lines, $output_array);

A
Anton Kiselyov, 2018-01-10
@zamboga

Download a free set of macros and add-ons Asap Utilites fo Excel (the Russian language is there on a regular basis).
Next, the "Text" menu, item 15 (well, 11, 13 at the same time). https://i.imgur.com/pjMjESR.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question