Tag Archives: Regular Expressions

Regular Expressions

Regex Library /pattern/modifiers; Number: /^d+$/ Whitespace at start of line: ^[ s]+ Date: ([01]?\d)[-\/ .]([0123]?\d)[-\/ .](\d{4}) Email address: [-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4} Web Address: ((\bhttps?:\/\/)|(\bwww\.))\S* US Zipcode: \d{5}(-\d{4})? US Phone number: \(?(\d{3})\)?[ -.](\d{3})[ -.](\d{4}) Hex color value: /^#[a-fA-F0-9]{6}$/ or !”#$%&'()*+,-./@:;<=>[\]^_`{|}~ Using String search() with RegEx / with String Use String … Continue reading

Posted in JavaScript | Tagged ,