Regular expression for exact word and occurance [message #547714] |
Thu, 15 March 2012 23:57 |
Plymouth_Rock
Messages: 13 Registered: December 2008
|
Junior Member |
|
|
I need to search a specific pattern from a source code. In word, I need to check whether "getCode" has been called or not, for all the string inside double-quote("). Following are sample code lines -
1.->if(val==23){ month_desc = "a sample data"; }
2.->if(val==23){ month_desc = getCode("a sample data"); }
3.->if(val==23){ month_desc = "a " + getCode("sample data"); }
4.->if(val==23){ month_desc = getCode("sample data"); var2="sample data2";}
Now, expression should be such that it will return true during check for 1, 3 and 4, although, for 3 & 4 getCode has been called for part of the String.
Can anybody help me for this?
Thanks in Advance,
P_R
|
|
|
|
|