Home » Developer & Programmer » JDeveloper, Java & XML » Regular expression for exact word and occurance (JAVA )
Regular expression for exact word and occurance [message #547714] Thu, 15 March 2012 23:57 Go to next message
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
Re: Regular expression for exact word and occurance [message #547736 is a reply to message #547714] Fri, 16 March 2012 02:10 Go to previous messageGo to next message
Michel Cadot
Messages: 68044
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In which language do you want to do this test (shell, perl...)?

Regards
Michel
Re: Regular expression for exact word and occurance [message #547744 is a reply to message #547736] Fri, 16 March 2012 03:32 Go to previous message
Plymouth_Rock
Messages: 13
Registered: December 2008
Junior Member
I need this in Java version=1.6

Regards,
P_R
Previous Topic: ORA-1460 while working with XML (merged 3)
Next Topic: putting values on the same row of the jsp
Goto Forum:
  


Current Time: Fri Dec 03 05:54:10 CST 2021