Regular Expression REGEXP - 密码测试很强

(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$

Regular Expression RegEx在TextMate中查找替换

Search Term:
<TAG>(.*)</TAG>

Replace Term:
\$$1 = \$_POST['$1'];
if (\$$1) echo "<tr><td>$1</td><td>\$$1</td></tr>";
else echo "";

Regular Expression 在Dreamweaver中使用Regex查找和替换删除html标记属性

If you find yourself having to grab content off older websites and have to remove inline styles - or worse inline javascript! - use this code in Dreamweaver's find and replace dialog :


---- for style attribute -----
in the Find box :
(<[^>]*)style\s*=\s*('|")[^\2]*?\2([^>]*>)

in the Replace box :
$1$3

so the following
<a href="http://www.website.com" style="color:red;">Click here</a>
will be reduced to
<a href="http://www.website.com" >Click here</a>


---------
actually you could remove any tag attribute by replacing the 'style' with the name of the attribute you want to remove

Regular Expression 正则表达式 - 匹配IPv4地址

/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/

Regular Expression 十六进制值

/(#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})\b)/

Regular Expression 正则表达式从C#代码文件中获取ClassName

(?<=class\s)\s*\S*

Regular Expression 正则表达式从C#代码文件中获取方法名称。

\S*\s*(?=\()

Regular Expression 正则表达式从C#代码文件中获取对象引用名称。

\S*\s*(?=\=\s*\S*\s*new\s)

Regular Expression 正则表达式从C#代码文件中获取对象类型名称。

(?<=new\s)\s*\S*?\s*(?=[\[\(])

Regular Expression 美国邮政编码

/(^\d{5}$)|(^\d{5}-\d{4}$)/