# Regular Expressions in AS3

**URL:** <https://forum.kirupa.com/t/regular-expressions-in-as3/284609>\
**Category:** flash\
**Created:** [March 20, 2009, 8:24pm UTC](https://forum.kirupa.com/t/regular-expressions-in-as3/284609 "2009-03-20T20:24:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [March 20, 2009, 8:24pm UTC](https://forum.kirupa.com/t/regular-expressions-in-as3/284609/1 "2009-03-20T20:24:18Z")

</div>

Hi

I want to do an If. Example:

var fileName:String = “téste.xml”;

if(???){  
trace(“file name as invalid characters, please replace”);  
}else{  
trace(“do iT”)  
};

I need to know how I do this with regular expressions. Instead of writing 100 else if ofr each character á é í í ú ó #$%&/ that can’t be in a file name!

I hope someone can help me!

Thanks
