php preg_split 功能
有没有办法理解拆分模式中包含的以下逻辑:preg_split("/[\s,]+/", "超文本语言,编程");
在宏伟的计划中,我理解它在做什么,但我真的想详细了解它是如何做的使用转义符和特殊字符符号。有没有对此有详细的解释?如果没有,请有人提供其工作原理的详细说明。这是非常有用的东西,可以说,我想完全拥有它。
is there a way to understand the following logic contained in the splitting pattern:preg_split("/[\s,]+/", "hypertext language, programming");
in the grand scheme of things i understand what it is doing, but i really want a granular understand of how to use the escapes and special character notation. is there a granular explanation of this anywhere? if not could someone please provide a breakdown of how this works. it is something very useful, and something i would like to have completely under in my belt so to speak.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这会将文本分割为 1 个或多个空格和逗号,在一起
肯定会读取 http://www.regular-expressions。 info/ 正如 Silfverstrom 推荐的那样。另外帮助我学习的是这个游戏:http://www.javaregex.com/agame.html
This will split the text by 1 or more spaces and commas together
definitely read http://www.regular-expressions.info/ as Silfverstrom recommended. Also what helped me learn was this game: http://www.javaregex.com/agame.html
你应该看看正则表达式,这可能是一个很好的起点
http://www.regular-expressions.info/reference.html
you should have a look at regular expressions, this might be a good place to start
http://www.regular-expressions.info/reference.html