我对正则表达式不熟悉,希望您能帮助我。我正在尝试组合一个表达式,它将使用所有没有被单引号或双引号包围的空格来拆分示例字符串。我的最后一次尝试看起来像这样: (?!")
和不是很工作。引用前的空格分开了。
示例输入:
This is a string that "will be" highlighted when your 'regular expression' matches something.
预期输出:
This
is
a
string
that
will be
highlighted
when
your
regular expression
matches
something.
请注意,"will be"
和 'regular expression'
保留了单词之间的空格。