Menu

#29 Regexp doesn't work in Flex

closed-fixed
None
7
2006-04-05
2006-03-31
No

var result : Boolean = Pattern.matches("a*b", "aab");

In this particular case result equals true in Flash,
but either false or undefined in Flex.

Discussion

  • Sergey Kovalyov

    Sergey Kovalyov - 2006-03-31
    • milestone: 498267 -->
    • priority: 5 --> 7
    • assigned_to: nobody --> simonwacker
     
  • Staslon

    Staslon - 2006-04-04

    Logged In: YES
    user_id=1494052

    I spent 4 hours and I have just fixed that bug! :)

    So it doesn't work in Flex because, of this
    (org.as2lib.regexp.Pattern):

    static var ACCEPT:Node = new Node();
    static var LASTACCEPT:Node = new LastNode();

    A classes instance variables may only be initialized to
    compile-time
    constant expressions!!!

    And Flex compiler doesn't give us that error when we
    use "static"
    variables. BUG?

    So to fix this we just need to initialize this variables at
    constructor for example, like this:

    static var ACCEPT:Node;
    static var LASTACCEPT:Node

    public function myConstructor() : Void {
    if(!ACCEPT) {
    ACCEPT = new Node();
    }

    if(!LASTACCEPT) {
    LASTACCEPT= new LastNode();
    }
    }

    Say Thanks to me by email if that helps : )

    By the way you should check all your code for this.

     
  • Simon Wacker

    Simon Wacker - 2006-04-04
    • assigned_to: simonwacker --> isadovskiy
     
  • Simon Wacker

    Simon Wacker - 2006-04-04

    Logged In: YES
    user_id=922171

    Assigned the bug to isadovskiy.

    Sergey: Thanks for the huge help, we'll check the code for
    other occurrences of this.

     
  • Igor Sadovskiy

    Igor Sadovskiy - 2006-04-05
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.