I want to use regex to search for the pattern "<?=test.getObjectName...?>"
If the parenthesis has 3 parameters then return 2nd one.
If the parenthesis has 4 parameters then retrun 3rd&2nd.
So expected output:
Please be aware that a regex does not "return" anything but only matches something. Those matches may be deleted, substituted, shoved around, whatsoever. My proposal above does all of these.
For your problem, you may need two different regexes, one for either case.