1152 shaares
4 private links
4 private links
5 results
tagged
regex
Un site avec des regex déjà faites et une vision graphique des regex
First mobile phone number (in Switzerland, number that begins with "+41 7") :
BEGIN:VCARD(.|\n)*?FN:(.*)?\n(.|\n)*?(TEL.*?:(\+41 7.*?)\n(.|\n)*?)?END:VCARD
$2;$5
Or first phone number :
BEGIN:VCARD(.|\n)*?FN:(.*)?\n(.|\n)*?(TEL.*?:(.*?)\n(.|\n)*?)?END:VCARD
$2;$5
This is the output :
John smith;+41 79 777 77 77
my name;my phone number
They may still be some escape character, you can remove them with this :
\\(.)
$1
If you want to remove those who don't have a phone number :
.*?;\n
(TEL;TYPE=.*?:) ?(\+41|0) ?([0-9]{2}) ?([0-9]{3}) ?([0-9]{2}) ?([0-9]{2})
Then you can rewrite it like you want, for example I use this scheme: +41 98 765 43 21
$1+41 $3 $4 $5 $6