The slashes are being removed when you use them in a string literal. Did you try a regexp literal?

var pattern:RegExp = /^\s*(package\s(.*){)/g;

Otherwise, it's double slashes...


Peter


On 3/5/06, Teoti Graphix <[EMAIL PROTECTED]> wrote:
Hello,

I am here using regular expressions and for some reason didn't relaize that when you create an _expression_ like :

var packages:String = '^\s*(package\s(.*){)';

pattern:RegExp = new RegExp(packages, "g");

will trace :

/^s*(packages(.*){)/g

Notice where the ^s are together, there should be a back slash to say space character.

I tried with both " and ', dosn't make a difference. So obviously you need to double backslash a special charatcer in regular _expression_ strings.

This sucks big time, the reason is I have a parsing library full of registered regular expressions.

Am I seing this right? This is the way it always has been? I guess using php, it is different with how it treats a "RegExp" through it's methods.

Anyway,

Does anybody see any negative effects from using an actual RegExp object in the static library ? Would this cause any confilcts because some internal properties of the RegExp object are not reset or updated correctly. I know the modifiers would have to be flagged correctly.

I use a;

var pattern:RegExp =  RegExpLibrary.getPattern(RegExpLibrary.PACKAGE_PATTERN, "g") as RegExp;

Any thoughts?

Peace, Mike





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to