Jump to content
Larry Ullman's Book Forums

Format Of End Of Regular Expressions

Recommended Posts

Hello everyone


I see that regular expressions in the book usually end with /i




However, on page 86 under point 7, the i is left off after the end forward slash:



Why has the i been left off in this instance?




Link to comment
Share on other sites

Welcome to the forum, Warwick.


The regex itself actually ends at the forward slash. The i after the forward slash is one of many possible modifiers that affects the entire regex. Specifically, the i meaning that the regex should search for strings in a case-insensitive fashion. The other common modifier you see for regexes is g, which is used for global searches (i.e., don't stop after the first match).


While for JavaScript, the following link might shed some light on things:


  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...