Create a regular expression that matches three-letter words : Match : Regular Expressions Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Regular Expressions » Match »

 

Create a regular expression that matches three-letter words


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:RegExp = /b[a-z]{3}b/g;
        var target:String = "This string has two three letter words";
        
        var result:Array;
        while ( ( result = example.exectarget ) ) != null ) {
          traceresult );
        }
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Regular Expressions
» Match