Code: Select all
if {[regexp -nocase {012-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]|013-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]|014-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]|016-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]|017-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]|019-?[0-9]{7}[^A-Z0-9+&@#/%?=~_|!:,.;]} $text]} {
The cell operator numbers are: 012, 013, 014... and so on as you can see.
Then there is a 7 digit phone number after the cell operator number.
After the last digit (7th digit) of the phone number there shouldn't be any number.
The number can be like:
0126708090
or even like:
012-6708090
This piece of code looks very long and blotty to me, although it works. Any suggestions for improvement?