java - Filtering whole words with delimiter -
i have delimiter in place filters out symbols , numbers. program reading in file , exclude words not words. might sound confusing example. if first line in file has word light
, second line has word lightning
, possible somehow filter out light
keep lightning
?
this code , delimiters have put in place.
string delimiters = " ,*.-?|\t\r\n^;{}()[]+=<>/1234567890_"; asciidatafile file = new asciidatafile();
are using split or replace operation delimiter ? can use : regex - "\blight\b" on split/replace operation , match "light" , not "lightning".
you can verify/test out @ javascript regexp example
hope helps.
Comments
Post a Comment