Welcome To Snipplr


Everyone's Recent Snippets Tagged regex



Accepts: * 123456789 * 123123456789 * 123 123456789
2 1500 posted 16 years ago by devision
In case you find yourself parsing a string with unrecognizable ASCII character codes, use the regex below to replace them. The pattern matches only the valid keyboard symbols.
1 1286 posted 16 years ago by arangil
There are multiple ways of checking email adresses about their validity. This script is based on RFC 2822. Please note that based on RFC 2822 [email protected] is considered valid. The second snippet is the one I prefer, which only accepts T...
2 3322 posted 16 years ago by pacey
. must be escaped using \ . It means something in regexp
0 1562 posted 16 years ago by godstroke
Matches are as follows: 0 = protocol 1 = fqdn 2 = subdomain 3 = top level subdomain 4 = domain (blah.com) 5 = port 6 = path 7 = query string 8 = hash
1 1417 posted 16 years ago by remotezygote
Read a page's GET URL variables and return them as an "associative array." Calling the function while at `example.html?foo=asdf&bar=jkls` sets `map['foo']='asdf'` and `map['bar']='jkls'`
17 11269 posted 16 years ago by the_coder
Functions to make using regular expressions a bit easier. They're named after the respective PHP function.
2 1721 posted 16 years ago by wizard04
1 1712 posted 16 years ago by joet3ch
This finds individual CSS attributes, i.e. "foo : bar;" or "bar : 2px solid foo;"
4 2391 posted 16 years ago by mocha0range
This finds CSS style names, i.e. "#foo" or "#foo, .bar" Note: You'll need to chomp the trailing "\s{" off the end of the matched string. I matched it just to make sure that it didn't get anything else.
5 1672 posted 16 years ago by mocha0range
This finds the entire style definition - from #foo to the last brace. i.e. ".foo, #bar { foo: bar; foo: bar; bar: foo; }"
4 1509 posted 16 years ago by mocha0range
Use this to quickly clean-up a file which has opening braces on a new line, a particular annoyance of mine.
1 1436 posted 16 years ago by Zenithus
0 1048 posted 16 years ago by funkadelicsoul
This snippet is useful if you want to extract the relevant parts out of an Date header field of an email message. It was created according to the [RFC 5322 rules](http://tools.ietf.org/html/rfc5322#page-15 "RFC 5322, Page 15"). It supports named capt...
1 1731 posted 16 years ago by dreadwarrior
Credits to Julie. Here is a regex if you want this criteria: * Passwords will contain at least (1) upper case letter * Passwords will contain at least (1) lower case letter * Passwords will contain at least (1) number or special character...
2 1362 posted 16 years ago by axelitus
http://www.trentmueller.com/blog/search-and-replace-wildcard-characters-in-dreamweaver.html -and- http://www.webmasterworld.com/forum46/1288.htm
0 1219 posted 16 years ago by rwczippy
2 9057 posted 16 years ago by resurge
This allows you to get contents of any div with ID tag. $matches[0] returns with parent div tag $matches[1] returns with out parent div tag
1 3828 posted 16 years ago by Gustavs
<p(.+)"> wählt alle p tags <option> dies entfernt alle <option> <option> <option>
0 1053 posted 16 years ago by nico65
4 3865 posted 16 years ago by fackz
0 1046 posted 16 years ago by kokikr