I wonder why these regexps aren't equivalent:
/(a)(a)(a)/.exec ("aaa").toString () => "aaa,a,a,a" , as expected
/(a){3}/.exec ("aaa").toString () => "aaa,a" :(
/(a)*/.exec ("aaa").toString () => "aaa,a" :(
How must the last two be reformulated so that they behave like the first? The important thing is that I want arbitrary multiples matched and remembered.
The following line
/([abc])*/.exec ("abc").toString () => "abc,c"
suggests that only one character is saved per parenthesis - the last match.
:(indeedstr.match (/([^ \n\t\(\)]+|\(|\))/g)- this also treats parenthesis as tokens. But I think this isn't the solution of the problem