regex - How to extract substrings from a string in java -
i not confident in java need help extract multiple substrings string.string given below.
i have text file perchance thousands of similar pos-tagged lines need extract original text that.i have tried using tokenizer didn't result wanted.i tried using pattern matcher , having problems regex.
string="i_prp recently_rb purchased_vbd this_dt camera_nn";
i want output= purchased camera.
i use
regex: [\/](.*?)\s\b
but not working.please help me.
try
string s= "i_prp recently_rb purchased_vbd this_dt camera_nn"; s = s.replaceall("_\\w+(?=(\\s|$))", ""); system.out.println(s);
prints
i purchased photographic camera
java regex stanford-nlp
No comments:
Post a Comment