<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head><meta content="text/html; charset=UTF-8" http-equiv="content-type" />
      
      <title>Character Classes (Shorthand)</title>
      <meta content="PortalProtect 2.6 Online Help" name="description" />
      <meta content="IE=8" http-equiv="X-UA-Compatible" />
      <link href="resources/webhelp.css" rel="stylesheet" type="text/css" />
   <link href="_wh/user/resources/jquery-ui.css" rel="stylesheet" type="text/css" /><link href="_wh/wh.css" rel="stylesheet" type="text/css" /><script src="_wh/user/resources/jquery.min.js" type="text/javascript"></script><script src="_wh/user/resources/jquery-ui.min.js" type="text/javascript"></script><script type="text/javascript">
            var whMessageTranslations =  [
                'Contents',
                'Index',
                'Search',
                'Collapse All',
                'Expand All',
                'Previous Page',
                'Next Page',
                'Toggle search result highlighting',
                'No results found for %W%.',
                '1 result found for %W%.',
                '%N% results found for %W%.'
            ];
          </script><script charset="UTF-8" src="_wh/wh.min.js" type="text/javascript"></script><script charset="UTF-8" src="_wh/search.js" type="text/javascript"></script><link href="_wh/user/tm.css" rel="stylesheet" type="text/css" /></head>
   
<body>
      <div id="wh-header">
    <table cellpadding="0" cellspacing="0" id="page-header" width="100%">
      <tr valign="top">
        <td align="left" width="115">
          <a href="http://www.trendmicro.com">
            <img alt="Trend Micro homepage" border="0" height="40" id="tm-logo" src="_wh/user/resources/trendball.png" width="104" />
          </a>
        </td>
	<td align="left" valign="middle">
          <h1 id="title">
	     <script type="text/javascript">
               $('#title').html($('meta[name=description]').attr('content'));
             </script>
	  </h1>
	</td>
      </tr>
    </table></div>
      <div id="wh-body">
         <div id="wh-navigation">
            <ul id="wh-tabs">
               <li id="wh-toc-tab"><a href="#wh-toc-pane"><span>Contents</span></a></li>
               <li id="wh-index-tab"><a href="#wh-index-pane"><span>Index</span></a></li>
               <li id="wh-search-tab"><a href="#wh-search-pane"><span>Search</span></a></li>
            </ul>
            <div id="wh-toc-pane">
               <div id="wh-toc-form"><span id="wh-toc-control"><a href="#">Collapse All</a><a href="#">Expand All</a></span><button id="wh-toc-previous">Previous</button><button id="wh-toc-next">Next</button></div><script charset="UTF-8" src="_wh/toc.js" type="text/javascript"></script></div>
            <div id="wh-index-pane">
               <div id="wh-index-form"><input id="wh-index-field" type="text" /></div><script charset="UTF-8" src="_wh/index.js" type="text/javascript"></script></div>
            <div id="wh-search-pane">
               <div id="wh-search-form"><input id="wh-search-field" type="text" /><button id="wh-search-button">Search</button><span id="wh-highlight-group"><input checked="checked" id="wh-highlight-toggle" type="checkbox" /><label for="wh-highlight-toggle">Toggle Highlight</label></span></div>
               <div id="wh-search-results"></div>
            </div>
            <div id="wh-external-search-pane"></div>
         </div>
         <div id="wh-separator"></div>
         <div id="wh-content">
      <div class="reference" id="GUID-61507721-7A7E-47C1-B1F1-7D11D9D612AD" lang="en" xml:lang="en">
         <h2 class="section1-title" id="GUID-61507721-7A7E-47C1-B1F1-7D11D9D612AD__GUID-A4D3FF66-A7CF-4FFC-B107-CCF41F85472A">Character Classes (Shorthand) <span class="topic-navigation-bar"><a accesskey="U" class="navigation-link" href="About-Regular-Expres_001.html#GUID-96033F68-736E-44D8-8771-46A074FA9278" title="Parent topic: About Regular Expressions"><img alt="Parent topic" class="navigation-icon" height="16" src="resources/parent.png" width="16" /></a></span></h2>
         <div class="refbody">
            <div class="section" id="GUID-61507721-7A7E-47C1-B1F1-7D11D9D612AD__GUID-3A481E02-9073-4F55-B437-517CA325F21D">
               
               <div class="table" id="GUID-61507721-7A7E-47C1-B1F1-7D11D9D612AD__table_rlm_tpj_wfb">
                  <h4 class="table-title" id="GUID-61507721-7A7E-47C1-B1F1-7D11D9D612AD__GUID-C3BA2E16-3074-44A7-A645-6299D8D31C96">Character Classes (shorthand)</h4>
                  <table border="1" class="tgroup">
                     <col class="colspec" width="18%" />
                     <col class="colspec" width="41%" />
                     <col class="colspec" width="41%" />
                     <thead class="thead">
                        <tr class="row">
                           <th class="header-entry">
                              
                              <div class="p">Element</div>
                              
                           </th>
                           <th class="header-entry">
                              
                              <div class="p">What It Means</div>
                              
                           </th>
                           <th class="header-entry">
                              
                              <div class="p">Example</div>
                              
                           </th>
                        </tr>
                     </thead>
                     <tbody class="tbody">
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\d</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any digit character; functionally equivalent to [0-9] or [[:digit:]]</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">\d matches 1, 12, 123, etc., but not 1b7. One or more of any digit
                                 characters.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\D</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any non-digit character; functionally equivalent to [^0-9] or [^[:digit:]]</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">\D matches a, ab, ab&amp;, but not 1. One or more of any character but 0, 1, 2,
                                 3, 4, 5, 6, 7, 8, or 9.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\w</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any &quot;word&quot; character. That is, any alphanumeric character; functionally
                                 equivalent to [_A-Za-z0-9] or [_[:alnum:]]
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">\w matches a, ab, a1, but not !&amp;. One or more upper- or lower-case letters or
                                 digits, but not punctuation or other special characters.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\W</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any non-alphanumeric character; functionally equivalent to [^_A-Za-z0-9] or
                                 [^_[:alnum:]]
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">\W matches *, &amp;, but not ace or a1. One or more of any character but upper-
                                 or lower-case letters and digits.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\s</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any white space character; space, new line, tab, non-breaking space, etc.;
                                 functionally equivalent to [[:space]]
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">vegetable\s matches &quot;vegetable&quot; followed by any non-white space character. So the
                                 phrase &quot;I like vegetables in my soup&quot; would trigger the regex, but &quot;I like a
                                 vegetable in my soup&quot; would not.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">\S</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Any non-white space character; anything other than a space, new line, tab,
                                 non-breaking space, etc.; functionally equivalent to [^[:space]]
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">vegetable\S matches &quot;vegetable&quot; followed by any non-white space character. So the
                                 phrase &quot;I like vegetables in my soup&quot; would trigger the regex, but &quot;I like a
                                 vegetable in my soup&quot; would not.
                              </div>
                              
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
               
            </div>
         </div>
      </div>
   </div>
      </div>
      
      <div id="wh-tm-footer">
         <div id="page-tm-footer">© 2019 Trend Micro Incorporated. All rights reserved.<br /><a href="http://esupport.trendmicro.com/"><span>Search Knowledge Base</span></a></div>
      </div>
   </body></html>