Match a phone number : Phone Number : Regular Expressions Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Regular Expressions » Phone Number »

 

Match a phone number


 
package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var document:String = "My name is John Doe, SSN 123-45-6789,I live at 120 Birch st...";
        var ssn:RegExp = /d{3}-d{2}-d{4}/g;
        document = document.replace(ssn, "<SSN REMOVED>");
        trace(document);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Regular Expressions
» Phone Number