This maybe technically a regex question, but I am using it in ST3 and I’m really really stuck (>2hrs).
Shot from ST3 (the format is .vcf)
Better Format
BEGIN:VCARD VERSION:2.1 N:;Coop Bank 24hr;;; FN:Coop Bank 24hr TEL;CELL;PREF:03457212212 TEL;CELL:0169553760 END:VCARD BEGIN:VCARD VERSION:2.1 N:;Coop Bank Frank;;; FN:Coop Bank Frank TEL;CELL;PREF:01179293519 END:VCARD BEGIN:VCARD VERSION:2.1 N:Tax;Council;;; FN:Council Tax TEL;CELL:01225477777 END:VCARD BEGIN:VCARD VERSION:2.1 N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:;=43=C3=B6=6E=64=6F=72=20=46=65=72=72=79;;; FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=43=C3=B6=6E=64=6F=72=20=46=65=72=72=79 TEL;CELL;PREF:01202207299 END:VCARD BEGIN:VCARD VERSION:2.1 N:;D V L A;;; FN:D V L A TEL;CELL;PREF:03001230883 END:VCARD
I’m trying to select text between BEGIN:VCARD and END:VCARD (for example)
I’ve tried (using the find (regex) function in ST3)
(?<=BEGIN)\n*.*(?=END)
(?<=BEGIN)\n{2,}(?=END)
(?<=BEGIN).*(?=END)
(?<=BEGIN)\s\S.*(?=END)
(?<=sms protocol)(.*)(?=New)
This selected text between sms protocol and New when it was all on one line (in a completely different file)(thus I can get it to work when there are no newline characters involved).
But I can’t get the regex to work for capital letters and any number of newlines.
I’ve also looked at a lot of StackOverflow questions, but to no avail.
Hopefully this question will be handy for other fellow noobs too as the power (or one of it’s powers) of ST relies on regex…
ATB Loz
Ps All the phone numbers are in the public domain (or obsolete), just in case any folk were worrying