Activity Stream
48,167 MEMBERS
61459 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Default JQuery and RegExr Help :|

    Hi guys.
    I have really big difficulties of doing the following so any help would be appreciated.

    Here's my stack
    Code: 
    $(document).test(1000).mouseover(function(){
    alert(1); alert(2);
    });
    
    $(document).inbetween();
    $(document).test(2000).mouseover(function(){alert(1); alert(2);});
    Ok so i want to take the functions(that are bold) with regexr that contain test() function attached. It must work in all major browsers + IE6.

    I have the following pattern but can't do it good enough to work.
    \$\(.*\)\.test\(\d*\)\.(?:\r|\n|.)+\);(?:\$)+

    Thanks

    EDIT: Ok i found the proper pattern guys. It's :
    \$\(.*\)\.test\(\d*\)\.[^\$]*
    Porsche_maniak Reviewed by Porsche_maniak on . JQuery and RegExr Help :| Hi guys. I have really big difficulties of doing the following so any help would be appreciated. Here's my stack $(document).test(1000).mouseover(function(){ alert(1); alert(2); }); $(document).inbetween(); Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    well regarding the pattern, I don't really see why (?:\$)+ is at the end, it means 'at least one dollar sign after the ;' and maybe you need to make the '.' non-greedy by adding question marks: \$\(.*?\)\.test\(\d*\)\.(?:\r|\n|.)+?\);

  4.     
    #3
    Member
    Website's:
    maxneeds.info
    Yes i know that (?:\$)+ is not correct. But i think thats the only way delimiter for the next match.. or maybe you are close ?
    The thing is that if i have a function or something that ends with ); inside the mouseover function the regex doesn't work as expected.Your pattern matches till the first occurance of );
    but it should be to the last. How to do this?

  5.     
    #4
    Member
    Yes you're right... I think for this you need to match nested parentheses and such, and Regular expression is not the best tool for that.

    http://stackoverflow.com/questions/1...ested-patterns

  6.     
    #5
    Member
    Website's:
    maxneeds.info
    @deliteblogger thanks for you help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Hiring] Coder with exp in DLE, jquery
    By newshit in forum Completed Transactions
    Replies: 0
    Last Post: 11th Jan 2012, 09:42 PM
  2. JQuery help
    By xElliex in forum Web Development Area
    Replies: 5
    Last Post: 25th Aug 2011, 10:38 PM
  3. jQuery Tooltips Help
    By Chris2k in forum Web Development Area
    Replies: 1
    Last Post: 11th May 2011, 07:18 PM
  4. jQuery tooltip help :S
    By Porsche_maniak in forum Web Development Area
    Replies: 5
    Last Post: 20th Oct 2010, 04:27 PM
  5. Anyone who knows Javascript / jquery / Css
    By Czechi in forum Completed Transactions
    Replies: 5
    Last Post: 17th Aug 2010, 06:41 AM

Tags for this Thread

BE SOCIAL