Hi,
I am looking for a Perl regular expression to match the below pattern of a java script file.
var so = object.device.load('camera','value');
I want to grep out such lines present in the *.js files. The conditions are:
a) the line may start with blank space(s)
b) always the string remains same as "var so = object.device.load(....);" but differs in the arguments & quotes (may be single or double) inside parantheses
c) should not be included if it is commented using /* */ (or) // where as it may be multi-line comments (i.e)
/*
.....
var so = .....
*/
Somehow, I managed to get the below regexp by google search
^(\\s*)var *.*object[ .]*device.*[ )] *;$
but not working with the comments part
Any help would be highly appreciated!!