<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - 正则表达式</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=135</link>
    <description>Latest 20 threads of 正则表达式</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Mon, 25 May 2026 04:49:56 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>preg_replace() -- 字符串替换</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7087</link>
      <description><![CDATA[preg_replace() 的功能是执行正则搜索和替换，原型如下：


该函数从第 3 个参数 $subject 中按照第 1 个参 ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Tue, 22 May 2012 05:42:45 +0000</pubDate>
    </item>
    <item>
      <title>preg_grep() -- 将匹配项返回到数组当中</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7085</link>
      <description><![CDATA[preg_grep() 原型如下：

函数返回与第 1 个参数中的正则匹配的数组单元。

测试代码：

运行输出：]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Tue, 22 May 2012 02:18:35 +0000</pubDate>
    </item>
    <item>
      <title>preg_match_all() -- 全局正则搜索匹配</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7077</link>
      <description><![CDATA[preg_match_all() 函数和pre_match() 函数功能类似，不同的是 preg_match() 在第一次匹配后就会停止搜索，而 preg_match_all() 会一直搜索到指定的字符串末尾，因此可以获取到所有匹配的结果。函数语法格式如下：
[mw_shl_code=text,true]int preg_match_all ( string $ ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Mon, 21 May 2012 16:49:07 +0000</pubDate>
    </item>
    <item>
      <title>pre_match() -- 搜索匹配的字符串</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7076</link>
      <description><![CDATA[pre_match() 函数用来搜索匹配的字符串，原型如下：

函数的第 1 个和第 2 个参数是必选参数。第 1 个参数 $ ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Mon, 21 May 2012 12:59:06 +0000</pubDate>
    </item>
    <item>
      <title>非捕获元(?:, ?=, ?!)</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7074</link>
      <description><![CDATA[正则表达式一个最重要的特性就是将匹配成功的模式的某部分进行存储供以后使用这一能力。

对一个正则表达式模式或部分模式两边添加圆括号将导致这部分表达式存储到一个临时缓冲区中。所捕获的每个子匹配都按照在正则表达式模式中从左至右所遇到的内容存储。存储子匹配的 ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Mon, 21 May 2012 11:09:53 +0000</pubDate>
    </item>
    <item>
      <title>模式修正符</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7073</link>
      <description><![CDATA[模式修正符号在正则表达式界定符之外使用，比如 /groad/i 中的 i 就是修正符，它表示不区分大小写。模式修正符可以调整正则表达式的解释，扩展正则表达式在匹配，替换等操作时的某些功能。可以将多个修正符号组合使用以增强正则表达式的能力。下标是一些常用的修正符号 ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Mon, 21 May 2012 09:03:46 +0000</pubDate>
    </item>
    <item>
      <title>模式匹配优先级</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7071</link>
      <description><![CDATA[相同的优先级从左到右，不同的优先级从高到低。各种操作符的匹配优先级从高到低如下表所示：]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Mon, 21 May 2012 03:15:14 +0000</pubDate>
    </item>
    <item>
      <title>元字符</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7070</link>
      <description><![CDATA[元字符就是用于构建正则表达式的具有特殊含义的字符，如 \'?\'，‘*’, ‘+’ 等。如果要匹配元字符本身，可以在其前面加上反斜杠 \'\\\' 使其失去特殊含义。下表汇总了这些特殊的字符：


原子的概念
原子是正则表达式的最基本组成单位，而且在每个模式中至少包含一个原子。 ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Sun, 20 May 2012 16:34:41 +0000</pubDate>
    </item>
    <item>
      <title>非打印字符</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7069</link>
      <description><![CDATA[]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Sun, 20 May 2012 16:03:46 +0000</pubDate>
    </item>
    <item>
      <title>量词</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=4458</link>
      <description><![CDATA[有时想进行更丰富的查找，或在更大范围内进行更多的搜索。比如想找到至少包含两个 \'p\' 字符的字符串，甚至是以 \'p\' 开头或以 \'p\' 结尾的字符串等。

在正则表达式中插入特定的字符就可以实现这些要求。下面是一些示例：

p+ : 匹配任何至少包含一个 p 的字符串。

p* :  ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Thu, 25 Aug 2011 08:35:50 +0000</pubDate>
    </item>
    <item>
      <title>方括号 []</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=3447</link>
      <description><![CDATA[1. 方括号的 [:xxxx:] 样式有如下匹配：

[:alpha:]&#160;&#160;:&#160;&#160;匹配任何字母

[:alnum:] :&#160;&#160;匹配任何字母和数字

[:aldit:]&#160;&#160;:&#160;&#160; 匹配任何数字

[:space:] :&#160;&#160;匹配空格符

[:upper:] :&#160;&#160; 匹配任何大写 ...]]></description>
      <category>正则表达式</category>
      <author>beyes</author>
      <pubDate>Sat, 23 Apr 2011 12:49:49 +0000</pubDate>
    </item>
  </channel>
</rss>