dragon321723
2017-04-06 19:49 阅读 585
已采纳

正则表达式按空格分割但忽略双引号字符串

I know /[\s]+/' splits a string by spaces. I am trying to expand this to ignore any spaces within double quotes. So I want Hello World to be split, but not "Hello World"

preg_split('/[\s]+/', $string) is the expression I am using in PHP.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐