我不能得到這個工作..Java的正則表達式不分裂之前或之後單或雙引號
我有,我想拆就空格的字符串。不過,我不想在Strings裏面分割。也就是說,內部是雙引號或單引號的文本。
例
分割以下字符串:
private String words = " Hello, today is nice " ;
..should產生以下令牌:
private
String
words
=
" Hello, today is nice "
;
我可以使用什麼樣的正則表達式的這個?
不應該這樣做嗎? 「[^ \\ s \」'] + | \「[^ \」] * \「|'[^'] *'」 – jpaw 2012-04-03 14:02:15
Duplicate of [this](http://stackoverflow.com/questions/366202/regex-for-splitting-a-string-using-space-when-not-surround-by-single-or-double) – 2012-04-03 14:09:46
正在看着它,但認爲它是不同的。現在我意識到這是同一個問題。抱歉! – jpaw 2012-04-03 15:23:39