<!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>Counting and Grouping</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-221D898E-7328-4D8F-AACE-FE955134C020" lang="en" xml:lang="en">
         <h2 class="section1-title" id="GUID-221D898E-7328-4D8F-AACE-FE955134C020__GUID-A4D3FF66-A7CF-4FFC-B107-CCF41F85472A">Counting and Grouping <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-221D898E-7328-4D8F-AACE-FE955134C020__GUID-3A481E02-9073-4F55-B437-517CA325F21D">
               
               <div class="table" id="GUID-221D898E-7328-4D8F-AACE-FE955134C020__I_pwhx9m_">
                  <h4 class="table-title" id="GUID-221D898E-7328-4D8F-AACE-FE955134C020__GUID-6F8C54D9-ECA6-42A8-86E1-AEF7BCD88B9C">Counting and Grouping</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">.</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">The dot or period character represents any character except new line
                                 character.
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">do. matches doe, dog, don, dos, dot, etc.d.r matches deer, door, etc.</div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">*</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">The asterisk character means zero or more instances of the preceding element.</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">do* matches d, do, doo, dooo, doooo, etc.</div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">+</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">The plus sign character means one or more instances of the preceding element.</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">do+ matches do, doo, dooo, doooo, etc. but not d</div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">?</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">The question mark character means zero or one instances of the preceding
                                 element.
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">do?g matches dg or dog but not doog, dooog, etc.</div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">( )</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Parenthesis characters group whatever is between them to be considered as a
                                 single entity.
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">d(eer)+ matches deer or deereer or deereereer, etc. The + sign is applied to the
                                 substring within parentheses, so the regex looks for d followed by one or more of
                                 the grouping &quot;eer.&quot; 
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">[ ]</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Square bracket characters indicate a set or a range of characters.</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">d[aeiouy]+ matches da, de, di, do, du, dy, daa, dae, dai, etc. The + sign is
                                 applied to the set within brackets parentheses, so the regex looks for d followed
                                 by one or more of any of the characters in the set [aeioy].
                              </div>
                              
                              <div class="p">d[A-Z] matches dA, dB, dC, and so on up to dZ. The set in square brackets
                                 represents the range of all upper-case letters between A and Z.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">^</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Carat characters within square brackets logically negate the set or range
                                 specified, meaning the regex will match any character that is not in the set or
                                 range.
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">d[^aeiouy] matches db, dc or dd, d9, d#. d followed by any single character
                                 except a vowel.
                              </div>
                              
                           </td>
                        </tr>
                        <tr class="row">
                           <td class="entry">
                              
                              <div class="p">{ }</div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">Curly brace characters set a specific number of occurrences of the preceding
                                 element. A single value inside the braces means that only that many occurrences
                                 will match. A pair of numbers separated by a comma represents a set of valid
                                 counts of the preceding character. A single digit followed by a comma means there
                                 is no upper bound.
                              </div>
                              
                           </td>
                           <td class="entry">
                              
                              <div class="p">da{3} matches daaa. d followed by 3 and only 3 occurrences of ”r;a”. da{2,4}
                                 matches daa, daaa, daaaa, and daaaa (but not daaaaa). d followed by 2, 3, or 4
                                 occurrences of ”r;a”. da{4,} matches daaaa, daaaaa, daaaaaa, etc. d followed by 4
                                 or more occurrences of ”r;a”.
                              </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>