正则表达式格式

临西小包公

临西小包公

2016-02-19 16:39

有了下面这个正则表达式格式教程,不懂正则表达式格式的也能装懂了,赶紧get起来装逼一下吧!

  正则表达式在PHP中被用来处理复杂的文字串。支持正则表达式的函数有:

  

ereg()ereg replace()eregi replace()split() 

  这些函数都将正则表达式作为他们的第一个参数。PHP使用POSIX扩展规则表达式(使用POSIX 1003.2)。要找到所有的关于POSIX扩展规则表达式的描述,请查看包括在PHP发行版本之内的regex man页面。

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/webkaifa/)

  Example 2-4. Regular expression examples

  

ereg("abc",$string); 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/webkaifa/)

  

/* Returns true if "abc"is found anywhere in $string. */ereg("^abc",$string);/* Returns true if "abc"is found at the beginning of $string. */ereg("abc$",$string);/* Returns true if "abc"is found at the end of $string. */eregi("(ozilla.[23]|MSIE.3)",$HTTP_USER_AGENT);/* Returns true if client browseris Netscape 2, 3 or MSIE 3. */ereg("([[:alnum:]]+) ([[:alnum:]]+) ([[:alnum:]]+ )",$string,$regs);/* Places three space separated wordsinto $regs[1], $regs[2] and $regs[3]. */ereg_replace("^","BR",$string);/* Put a BR tag at the beginning of $string. */ereg_replace("$","BR",$string);/* Put a BR tag at the end of $string. */ereg_replace("n","",$string);/* Get rid of any carriage returncharacters in $string. */

展开更多 50%)
分享

猜你喜欢

正则表达式格式

Web开发
正则表达式格式

正则表达式

Web开发
正则表达式

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

正则表达式口诀 正则表达式学习工具

Web开发
正则表达式口诀 正则表达式学习工具

正则表达式语法

Web开发
正则表达式语法

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

正则表达式简介

C语言教程 C语言函数
正则表达式简介

正则表达式验证

Web开发
正则表达式验证

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

解决Incorrect string value错误

解决Incorrect string value错误

Win8对硬件配置有何要求

Win8对硬件配置有何要求
下拉加载更多内容 ↓