Search Results

Search found 3 results on 1 pages for 'llamerr'.

Page 1/1 | 1 

  • parse string with regular exression

    - by llamerr
    I trying to parse this string: $right = '34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4]'; with following regexp: const word = '(\d{3}\d{2}\)S{0,1}\([^\)]*\)S{0,1}\[[^\]]*\])'; preg_match('/'.word.'{1}(?:\s{1}([+-]{1})\s{1}'.word.'){0,}/', $right, $matches); print_r($matches); i want to return array like this: Array ( [0] => 34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4] [1] => 34601)S(1,6)[2] [2] => - [3] => 34601)(11)[2] [4] => + [5] => 34601)(3)[2,4] ) but i return only following: Array ( [0] => 34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4] [1] => 34601)S(1,6)[2] [2] => + [3] => 34601)(3)[2,4] ) i think, its becouse of [^)]* or [^]]* in the word, but how i should correct regexp for matching this in another way? i tryied to specify it: \d+(?:[,#]\d+){0,} so word become const word = '(\d{3}\d{2}\)S{0,1}\(\d+(?:[,#]\d+){0,}\)S{0,1}\[\d+(?:[,#]\d+){0,}\])'; but it gives nothing

    Read the article

  • is it some bug in firefox or jquery or i doing something wrong?

    - by llamerr
    I want to change hidden input value on div click, so i do following: $('#gallery').click(function(){ if ($('input[name=isgallery]').attr('value') == '0') { $('input[name=isgallery]').attr('value', '1') } else { $('input[name=isgallery]').attr('value', '0') } $('#filterform').attr('action',$('#filterform').attr('act')); alert('ok'); $('#filterform').submit(); } ); when it equals 0 i change it to 1 and otherwise but it did not work and following code works: $('#gallery').click(function(){ if ($('input[name=isgallery]').attr('value') == '0') { $('input[name=isgallery]').attr('value', '0') } else { $('input[name=isgallery]').attr('value', '1') } $('#filterform').attr('action',$('#filterform').attr('act')); alert('ok'); $('#filterform').submit(); } ); and also, when i delete the function at all it still works and form submits maybe i have one more handler for this div, but i can't find one you can check it on http://www.4block.org/en/museum/posters and click "gallery view" on top-right

    Read the article

  • how to view associated click function code

    - by llamerr
    For example, i associate following function with some element $('table#users tbody tr:first #save').click(function(){ $(this).closest('tr').remove(); }); Now, if i don't know where this function is stored, is there a way to view associated with click() code? In above example, i want a way to view that in firebug, or in another way $(this).closest('tr').remove(); If I'm writing in console following, i'm get a link to dom inspector >>> ($('table#users tbody tr:first #save').click) function() but link is for jquery library, not the code i want.

    Read the article

1