<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<title>小议“排除型匹配” | 我爱正则表达式</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="原创、翻译、转载关于正则表达式的文章" />
<style type="text/css" media="screen">@import url( http://iregex.org/wp-content/themes/deep-mix/style.css );</style>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0 - all posts" href="http://feeds.feedburner.com/iregex" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0 - all comments" href="http://iregex.org/comments/feed" />
<link rel="pingback" href="http://iregex.org/xmlrpc.php" />
<!--[if lt IE 7]>
<script type="text/javascript" src="http://iregex.org/wp-content/themes/deep-mix/js/unitpngfix.js"></script>
<link rel="stylesheet" href="http://iregex.org/wp-content/themes/deep-mix/ie6.css" type="text/css" media="screen" />
<![endif]-->
<meta name='Admin Management Xtended WordPress plugin' content='2.2.1' />
<script src="http://iregex.org/wp-content/plugins/google-analytics-for-wordpress/custom_se_async.js" type="text/javascript"></script>
<link rel="alternate" type="application/rss+xml" title="我爱正则表达式 » 小议“排除型匹配” Comments Feed" href="http://iregex.org/blog/negate-match.html/feed" />
<style type="text/css">.default{
border:1px dotted #CCCCCC;
margin-left:4px;
margin-right:4px;
}
.line-numbers + td{
width:100%;
}
code.codecolorer {
padding:0 2px;
}</style>
<link rel='stylesheet' id='codecolorer-css' href='http://iregex.org/wp-content/plugins/codecolorer/codecolorer.css?ver=0.9.9' type='text/css' media='screen' />
<link rel='stylesheet' id='wp-pagenavi-css' href='http://iregex.org/wp-content/themes/deep-mix/pagenavi-css.css?ver=2.70' type='text/css' media='all' />
<script type='text/javascript' src='http://iregex.org/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://iregex.org/wp-includes/js/comment-reply.js?ver=20090102'></script>
<script type='text/javascript' src='http://iregex.org/wp-includes/js/jquery/jquery.js?ver=1.6.1'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://iregex.org/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://iregex.org/wp-includes/wlwmanifest.xml" />
<link rel='index' title='我爱正则表达式' href='http://iregex.org' />
<link rel='start' title='Hello regex world!' href='http://iregex.org/blog/hello-regex-world.html' />
<link rel='prev' title='打造自己的正则表达式助手程序' href='http://iregex.org/blog/diy-regexbuddy.html' />
<link rel='next' title='Superor老师的正则表达式视频教程' href='http://iregex.org/blog/regex-tutorial-by-superor.html' />
<meta name="generator" content="WordPress 3.2.1" />
<link rel='shortlink' href='http://iregex.org/?p=122' />
<!-- All in One SEO Pack 1.6.13.3 by Michael Torbert of Semper Fi Web Design[221,320] -->
<meta name="keywords" content="exclude,lookaround,negate,perl" />
<link rel="canonical" href="http://iregex.org/blog/negate-match.html" />
<!-- /all in one seo pack -->
<!-- Google Ajax Search -->
<link href="http://www.google.com/uds/css/gsearch.css" type="text/css" rel="stylesheet"/>
<style>
/* Width */
.gsc-control {
width: 280px;
overflow: hidden
}
.gs-result .gs-title,
.gs-result .gs-title * {
font-size: em;
color: #;
}
.gsc-results .gsc-trailing-more-results,
.gsc-results .gsc-trailing-more-results * {
color: #;
}
.gs-result a.gs-visibleUrl,
.gs-result .gs-visibleUrl {
color: #;
}
.gs-result a.gs-clusterUrl,
.gs-result .gs-clusterUrl {
color: #;
}
.gsc-resultsbox-visible {
display: table;
width: 100%;
overflow: hidden
}
</style>
<script src='http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAAvMYk0MjIQj5nesh3KwzgnRS-ptvZhtvNaay9AWwcGrso7uZ-sxTzWuVOaRgSzuNoKCmqQnHinSUbkA' type='text/javascript'></script>
<!-- Google AjaxSearch Plugin for WordPress initialization -->
<script type='text/javascript'>
function OnLoad()
{
var searchControl = new GSearchControl();
searchControl .setLinkTarget(GSearch.LINK_TARGET_SELF);
var webSearch = new GwebSearch();
webSearch.setSiteRestriction("http://iregex.org");
webSearch.setUserDefinedLabel("Results");
webSearch.setUserDefinedClassSuffix("webSearch");
var blogSearch = new GblogSearch();
blogSearch.setSiteRestriction("http://iregex.org");
blogSearch.setUserDefinedLabel("Blog Search");
blogSearch.setUserDefinedClassSuffix("siteSearch");
blogSearch.setResultOrder(GSearch.ORDER_BY_DATE);
var options = new GsearcherOptions();
options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
searchControl.addSearcher(webSearch, options);
searchControl.addSearcher(blogSearch, options);
var drawOptions = new GdrawOptions();
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_LINEAR);
searchControl.draw(document.getElementById("searchcontrol"),drawOptions);
}
GSearch.setOnLoadCallback(OnLoad);
</script>
<!-- Google Maps Plugin for WordPress (end) -->
<link rel="hub" href="http://pubsubhubbub.appspot.com" /><link rel="hub" href="http://superfeedr.com/hubbub" /><link rel="hub" href="http://www.feedsky.com/api/RPC2" /><link rel="hub" href="http://blogsearch.google.com/ping/RPC2" /><link rel="hub" href="http://blog.yodao.com/ping/RPC2" /><link rel="hub" href="http://www.feedsky.com/api/RPC2" /><link rel="hub" href="http://www.xianguo.com/xmlrpc/ping.php" /><link rel="hub" href="http://www.zhuaxia.com/rpc/server.php" /><link rel="hub" href="http://rpc.technorati.com/rpc/ping" /><link rel="hub" href="http://rpc.pingomatic.com/" /> <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
<!-- wp thread comment 1.4.9.4.002 -->
<style type="text/css" media="screen">
.editComment, .editableComment, .textComment{
display: inline;
}
.comment-childs{
border: 1px solid #999;
margin: 5px 2px 2px 4px;
padding: 4px 2px 2px 4px;
background-color: white;
}
.chalt{
background-color: #E2E2E2;
}
#newcomment{
border:1px dashed #777;width:90%;
}
#newcommentsubmit{
color:red;
}
.adminreplycomment{
border:1px dashed #777;
width:99%;
margin:4px;
padding:4px;
}
.mvccls{
color: #999;
}
</style>
</head>
<body id="top">
<div id="navigation">
<div class="inner">
<ul>
<li class="current_page_item"><a href="http://iregex.org">Home</a></li>
<li class="page_item page-item-2"><a href="http://iregex.org/about" title="About">About</a></li>
<li class="page_item page-item-4"><a href="http://iregex.org/links" title="LINKS">LINKS</a></li>
</ul>
</div>
<div class="fixed"></div>
</div>
<div id="header">
<div class="inner">
<div id="logo">
<h1 id="title"><a href="http://iregex.org/" title="我爱正则表达式" rel="home">我爱正则表达式</a></h1>
<div id="tagline">原创、翻译、转载关于正则表达式的文章</div>
</div>
</div>
<div class="fixed"></div>
</div>
<div id="wrapout" class="inner">
<div id="wrapin"> <div id="main">
<div id="content">
<div class="post">
<div class="title">
<h2>小议“排除型匹配”</h2>
<div class="fixed"></div>
</div>
<div class="info">
<span class="date">May 24th, 2010</span>
<span>Categories: <a href="http://iregex.org/blog/category/tutorial" title="View all posts in 教程" rel="category tag">教程</a>, <a href="http://iregex.org/blog/category/qa" title="View all posts in 问答" rel="category tag">问答</a></span>
<div class="fixed"></div>
</div>
<div class="content">
<p>网友cfc4n