我想解析某些地址,我想刪除/ s/o中的/除外的特殊字符| S/O | d/o | D/O | W/O等replaceAll正則表達式排除某些發生
因此,可以說我有一個字符串。就像是。
@Jane Doe.
W/O John Doe.
House #250,
Campbell & Jack ^Street,
\Random * State, Nowhere.
我會在
String parsedString = addressString.replaceAll(regex,"");
使用什麼樣的正則表達式,使parsedString將有輸出。
Jane Doe
W/O John Doe
House 250
Campbell Jack Street
Random State, Nowhere
(我代替@,#^ & /(除W/O)。)
赫姆Offtopic:但可能有助於[澄清一些事情...](https://i.stack.imgur.com/TsJyw.jpg) –
你的正則表達式在哪裏? –
可能的重複https://stackoverflow.com/questions/8248277/how-to-determine-if-a-string-has-non-alphanumeric-characters – SomeDude