I want a regular expression in Java which will match only if it is in the method signature of .css method.
For example
$('div').css( 'zIndex','10' );
In this case comma appears in the method signature of .css. Hence it should be matched.
Consider another example
$('div').css( 'zIndex' );
The example given below should not be matched as it has no comma in .css method.
I wrote a regex
\.css\(.+,.+\)
This works correctly in some cases only.
For example parseInt ( $('div').css('zIndex') , 10 );
In this example regex should not have matched as there is no comma .css method, but my regex matches.
Please help how to do it in java?
Use this regex:
In Java it can be translated to:
Live Demo