Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Flex Regex Versus Java Regex + Howto Embed Regex In Flex

DZone's Guide to

Flex Regex Versus Java Regex + Howto Embed Regex In Flex

·
Free Resource
// Only allow 6 to 9 digits (and no more)
Flex: ^\d{6,9}$
Java: \\d{6,9}

Following code will NOT function as desired (the {} are interpreted as binding markers, thus not part of the regex):


  


Following code will function as desired:



  
    ..
   public var regex:String = "^\\d{6,9}$";
   ..


   


  

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}