Welcome To Snipplr


Everyone's Recent Regular Expression Snippets Tagged regex



« Prev 1 2
RFC 5322 compliant regex
1 1355 posted 7 years ago by cyrilfr
* Usefull as shell command and everyting else `get-ip='egrep -o "[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}"'` `get-ipport='egrep -o "[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}[0-9 :]+" | sed -e "s/ //g"'`
0 1181 posted 9 years ago by dbiesecke
Regular Expression to find native Javascript console and AngularJS $log log warn or info that are NOT comments / commented out
1 1438 posted 9 years ago by brandonjp
Leading and Trailing Whitespace
0 2996 posted 12 years ago by Pavonz
Removes any lines from the file that don't start with "ERROR"
1 1083 posted 12 years ago by gamerzfuse
It removes all standard C-style comments(/* 1-n */) and all single line comments("//"). Greedy matching.
0 1359 posted 12 years ago by XtreamIT
thanks to... http://gskinner.com/RegExr/ http://daringfireball.net/2010/07/improved_regex_for_matching_urls
1 2732 posted 12 years ago by brandonjp
Regex code to match hexadecimal colors
0 1967 posted 13 years ago by guilhermehn
Requirement from work was to refactor an 8000 line if elseif code block to select case syntax. Not a manual task, even for a 1984 olympics button bashing champ. note, id is the test variable here, as in elseif (id ="test") then ...
0 1177 posted 13 years ago by pflangan
This regex captures non-printing characters (specifically those found when copying text from Photoshop). It's not fully tested, but it worked for me when I needed it. I will add to it as necessary.
0 1092 posted 13 years ago by oobleck
Ridiculously comprehensive date validation regex - matches dd/mm/yyyy or dd/mm/yy. Also correctly matches number of days in months. ie. it won't match 30th Feb...
0 1249 posted 14 years ago by shodan_uk
Matches text between each pair of asterisks (see URL above for demo) **Example:** Make text between asterisks bold, like in Textile (in Ruby): `test.gsub(/(\*)+([^.*?$]+)+(\*)/, '<strong>\\2</strong>')`
0 1687 posted 14 years ago by inko9nito
I\'m trying to find an expression to match a whole sentence. So really the pattern is the regex of the subject.
1 1374 posted 14 years ago by thefrosty
As an example – will find and replace all `<b>` elements with `<strong>`
0 1582 posted 14 years ago by jayphen
Use this regex search in Dreamweaver's find/replace to remove any html tag attributes
1 2592 posted 14 years ago by bjornredemption
3 1194 posted 15 years ago by nkm
search for anything in-between two <TAG>'s and then replace the found string into the PHP if/else staement. $1 is wher TextMate stores the found string. (see http://screenflicker.com/mike/code/textmate-regex-replace/)
3 1399 posted 15 years ago by rwczippy
Accepts: * 123456789 * 123123456789 * 123 123456789
2 1029 posted 15 years ago by devision
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 1949 posted 15 years ago by pacey
« Prev 1 2