article

language object - RegExp

[WHAT]

  1. ] a native language object in js
  2. ] referred to as - regExp, regex, regular expression, ascii puke 
  3. ]  a WAY TO describe a set of strings
  4. * note Lea's presentation the clever use of a regular expression to describe 3/4 variations of referring to
  5. ]

[WHY]

  1. ] if a string matches a certain format ( PATTERN MATCHING)
    1. ]
  2. ] with html5's pattern attribute
    1. ]
  3. ] extract certain parts of strings
    1. ]
  4. ] replace certain parts of strings
    1. ]
  5. ]

[WHERE]

  1. ]

[WHEN]

  1. ]

[EXAMPLE]

  1. ] + my examples IN 'validator object' checking for email address

[HOW-TO]

  1. ]

[REFERENCE]

  1. ] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
    1. ]
  2. ] https://www.youtube.com/watch?v=EkluES9Rvak&feature=player_detailpage 
    1. ] Lea Verou - presents on using RegExp

 

 


] also used in tools

- ide, text editors

- other languages

- pretty much consistent

]  syntax

/ starts with a slash

/ ends with a slash

whats inbetween the slashes is the pattern to match

what follows the last slash is the RegEx switch

js regex switches are /g, /i and /m, can be used in combination, no particular order

> lea has a very useful little web app site for learning/testing RegExpressions

 

Details Photos Edit more

Details

ID: 2705

NAME: RegExp

DESCRIPTION: ]javascript languages NATIVE 'RegExp' object

AUTHOR: article.author/s

EDITOR: article.editor/s

PUBLISHER: article.publisher/s

STATUS: Write

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

page_photo

actions

Email Email-Owner SMS and