mozilla

Compare Revisions

Regular Expressions

Change Revisions

Revision 422065:

Revision 422065 by Aqw on

Revision 424769:

Revision 424769 by ironpingwin on

Title:
Regular Expressions
Regular Expressions
Slug:
Web/JavaScript/Guide/Regular_Expressions
Web/JavaScript/Guide/Regular_Expressions
Tags:
"Regular Expressions", "NeedsBrowserCompatibility", "JavaScript"
"Regular Expressions", "NeedsBrowserCompatibility", "JavaScript"
Content:

Revision 422065
Revision 424769
n755      Regular expressions have four optional flags that allow forn755      Regular expressions have four optional flags that allow for
> global and case insensitive searching. To indicate a global sear> global and case insensitive searching. These flags can be used s
>ch, use the <code>g</code> flag. To indicate a case-insensitive s>eparately or together in any order, and are included as part of t
>earch, use the <code>i</code> flag. To indicate a multi-line sear>he regular expression.
>ch, use the <code>m</code> flag. To perform a "sticky" search, th 
>at matches starting at the current position in the target string, 
> use the <code>y</code> flag. These flags can be used separately  
>or together in any order, and are included as part of the regular 
> expression. 
tt757    <table class="standard-table">
758      <caption style="text-align: left;">
759        Table 4.4 Regular expression flags.
760      </caption>
761      <thead>
762        <tr>
763          <th scope="col">
764            Flag
765          </th>
766          <th scope="col">
767            Description
768          </th>
769        </tr>
770      </thead>
771      <tbody>
772        <tr>
773          <td>
774            <code>g</code>
775          </td>
776          <td>
777            Global search.
778          </td>
779        </tr>
780        <tr>
781          <td>
782            i
783          </td>
784          <td>
785            Case-insensitive search.
786          </td>
787        </tr>
788        <tr>
789          <td>
790            m
791          </td>
792          <td>
793            Multi-line search.
794          </td>
795        </tr>
796        <tr>
797          <td>
798            y
799          </td>
800          <td>
801            Perform a "sticky" search, that matches starting at t
 >he current position in the target string.
802          </td>
803        </tr>
804      </tbody>
805    </table>

Back to History