Mega Code Archive

 
Categories / Flash ActionScript / Regular Expressions
 

Create a pattern to match against a string

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var example:RegExp = /abc/;         trace( example.test( "A string with abc in it" ) );         trace( example.test( "abc" ) );         trace( example.test( "Another string to test against..." ) );     }   } }