# Help with Regular Expressions

**URL:** <https://forum.kirupa.com/t/help-with-regular-expressions/270234>\
**Category:** flash\
**Created:** [September 7, 2008, 7:12am UTC](https://forum.kirupa.com/t/help-with-regular-expressions/270234 "2008-09-07T07:12:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emadzedan](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@emadzedan](https://forum.kirupa.com/u/emadzedan)\
**Post date:** [September 7, 2008, 7:12am UTC](https://forum.kirupa.com/t/help-with-regular-expressions/270234/1 "2008-09-07T07:12:39Z")

</div>

Hi

I need help in regular expressions:  
I’m creating a Find and Replace tool for a text editor

the attached code is part of the code I use for Find Next Button, but it only finds [a-z] and [A-Z] and [0-9],  
if the string contains any other character all code go wrong.  
notice that the RegExp object is created dynamically so that it change from time to time.

any body can give me a code that find and string in the v\_Find variable.

please see the code.

thanks a lot.  
Attach Code

var matches:Array = new Array();  
var StartIndexes:Array = new Array();  
var i:Number;  
var v\_Find:String = new String();  
var v\_Modified:String = new String();  
//====================  
MyRegExp1 = new RegExp(v\_Find, “gi”);  
//====================  
/\*  
inside Find Next button code I use:  
(a lot of code but this is the part I need you to see)  
_/  
//====================  
v\_Find = T1.text;  
v\_Modified = T3.text;  
var MyRegExp1:RegExp;  
i = 0;  
while ((matches = MyRegExp1.exec(v\_Modified)) != null) {  
StartIndexes_= matches.index;  
i++;  
//trace(matches.index);  
}
