I am removing specific string from string. First i am reading text file through file reader and after this i am storing file's contents into string array and removing some specific string from string array
my input text is :
:VL
15
n
3 c
09:0.023
15th:0.023
1987:0.025
1st:0.025
2:0.013
2.0:0.043
2003:0.056
2005:0.056
Top Terms:
Weight :
props
optional
: Point:
1.0:
15th:0.068
now i am reading this text and storing into string array that is : String [] Result
my code:
for(String t1: Result){
Pattern = Pattern.compile("\\b:[0-9]\\b");
matcher = pattern.matcher(t1);
if(matcher.find()){
System.out.println(t1);
}
and output i am getting :
09:0.023
15th:0.023
1987:0.025
1st:0.025
2:0.013
2.0:0.043
2003:0.056
2005:0.056
Top Terms:
Weight :
15th:0.068
but i don't want this output. my output should be this :
09:0.023
15th:0.023
1987:0.025
1st:0.025
2:0.013
2.0:0.043
2003:0.056
2005:0.056
15th:0.068
Give me some idea about what regular expression i have to apply to get this output.
"2005:0.056 Top Terms: Weight :"might actually be a single line.