This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
consider the following lines of a text file: a abc aefbc d cf ad c bc ae ef ab df c b e g af c b c abcdef fdaebc
i have via string tokenizer got the individual strings, now i need to get how many lines match string "abc",for example first line has two strings which contains "abc",i.e it is not essential that we may need to get a than b than c,they maynot occur continuosly,like fifth and sixth line contains string abc.
but it matches those abc which are separated in more than one line, for example it matches: a bc deab c
I think you have a different definition what what is a "line". With text files a "line", ends with a carriage return / line feed. So, in your example, there is only one line. Please explain to us what you mean by a "line".
what i need is that,it should match defabc f cdea f
Please explain to us what you mean by a "line" with this too -- as there isn't even a "b" in the second line. With text files, there are two lines here.
How many are there under your definition? What are they? And what do you expect to match?
sorry for misleading,ya that is the meaning of line,also i wrote incorrectly my problem,consider the following lines f fabcde fdaebc af f f i need to write regular expression for matching "abc",the above line matches abc,where as below lines doesnot, de a a a bc def a de