Mega Code Archive

 
Categories / Ruby / String
 

Basic Special Characters and Symbols Within Regular Expressions

Character      Meaning  ^              Anchor for the beginning of a line $              Anchor for the end of a line \A             Anchor for the start of a string \Z             Anchor for the end of a string .              Any character \w             Any letter, digit, or underscore \W             Anything that \w doesn't match \d             Any digit \D             Anything that \D doesn't match (non-digits) \s             Whitespace (spaces, tabs, newlines, and so on) \S             Non-whitespace (any visible character)