LogoDatashed :: Help
Login
Email:
Password:  

Admin:Regular Expressions

From Datashed Help

Jump to: navigation, search

Quickstart page

Case Insensitivity

Regular expressions are case-sensitive. For example, the regular expression /Flow/ would not match the string flow because of the capital F. However, you can make regular expressions ignore case by adding an i after the expression's closing slash:

/Flow/i : will match flow, Flow, FLOW, or fLOw.

Anchors

Normally, the regular expressions will match a string that appears anywhere within the target text. However, you can add an anchor to make sure the string appears at either the beginning or the end of the target text:

/^Dissolved/ : the ^ anchor matches the beginning of a string. The example pattern will only match when no text comes before Dissolved (i.e. Dissolved is at the beginning of the text).
/pH$/ : the $ anchor matches the end of a string. The example pattern will only match when no text comes after pH (i.e. pH is at the end of the text).
Personal tools