web analytics
Using Regular Expressions in VBScript Options
davegate
Posted: Sunday, January 17, 2016 3:20:46 PM

Rank:Advanced Member
Groups: Member
Joined: 12/14/2015
Posts: 164
Points: 801

Regular Expresion String - "^([0-9]{2, 3})-([0-9]{7})$"

 - ^ and $: matches at the very start and very end of the subject string;

 -  "([0-9]{2, 3})": matches the area code of an phone number , and is enclosed in brackets so that this section can be used in the replacement of the pattern ($1);

 - "-": matches hyphen;

-  "([0-9]{7})": matches 7-digit phone number, and is also enclosed in brackets so that this section can be used in the replacement of the pattern ($2);

 

Replacement String - "($1)$2"

 - "$1": references to the fist catpure above, that is the area code;

 - "$2": references to the second catpure above, that is the phone number;

 

 

Sponsor
Posted: Sunday, January 17, 2016 3:20:46 PM
Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2017 Digcode.com. All rights reserved.