edit-article
Home
Up
Delete
Article Name:
Article Description:
]javascript languages NATIVE 'RegExp' object
Chapter ID/Name:
Status:
Write
Writing
Written
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">language object - RegExp</h1> <h2>[WHAT]</h2> <ol> <li>] a native language object in js</li> <li>] referred to as - regExp, regex, regular expression, ascii puke </li> <li><strong>] a WAY TO describe a set of strings</strong></li> <li>* note Lea's presentation the clever use of a regular expression to describe 3/4 variations of referring to</li> <li>]</li> </ol> <h2>[WHY]</h2> <ol> <li><strong>] if a string matches a certain format ( PATTERN MATCHING)</strong></li> <ol> <li>]</li> </ol> <li><strong>] with html5's pattern attribute</strong></li> <ol> <li>]</li> </ol> <li><strong>] extract certain parts of strings</strong></li> <ol> <li>]</li> </ol> <li><strong>] replace certain parts of strings</strong></li> <ol> <li>]</li> </ol> <li>]</li> </ol> <h2>[WHERE]</h2> <ol> <li>]</li> </ol> <h2>[WHEN]</h2> <ol> <li>]</li> </ol> <h2>[EXAMPLE]</h2> <ol> <li>] + my examples IN 'validator object' checking for email address</li> </ol> <h2>[HOW-TO]</h2> <ol> <li>]</li> </ol> <h2>[REFERENCE]</h2> <ol> <li>] <span class="crayon-sy"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp" target="_blank">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp</a></span></li> <ol> <li><span class="crayon-sy">] </span></li> </ol> <li><span class="crayon-sy">] <a href="https://www.youtube.com/watch?v=EkluES9Rvak&feature=player_detailpage">https://www.youtube.com/watch?v=EkluES9Rvak&feature=player_detailpage</a> </span></li> <ol> <li><span class="crayon-sy">] Lea Verou - presents on using RegExp</span></li> </ol></ol> <p style="text-align: left;"> </p> <p style="text-align: left;"> </p> <hr /> <p style="text-align: left;">] also used in tools</p> <p style="text-align: left;">- ide, text editors</p> <p style="text-align: left;">- other languages</p> <p style="text-align: left;">- pretty much consistent</p> <p style="text-align: left;">] syntax</p> <p style="text-align: left;">/ starts with a slash</p> <p style="text-align: left;">/ ends with a slash</p> <p style="text-align: left;">whats inbetween the slashes is the pattern to match</p> <p style="text-align: left;">what follows the last slash is the RegEx switch</p> <p style="text-align: left;">js regex switches are <strong>/g, /i and /m</strong>, can be used in combination, no particular order</p> <p style="text-align: left;">> lea has a very useful little web app <a href="http://leaverou.github.io/regexplained/" target="_blank">site</a> for learning/testing RegExpressions</p> <p style="text-align: left;"> </p>