Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 4a73ca6f7231b813c0d8e8dbe5dcabe92a33e54d @tj tj committed Aug 17, 2012
Showing with 45 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +11 −0 Makefile
  3. +17 −0 Readme.md
  4. +10 −0 component.json
  5. +5 −0 index.js
2 .gitignore
@@ -0,0 +1,2 @@
+components
+build
11 Makefile
@@ -0,0 +1,11 @@
+
+build: components index.js
+ @component build
+
+components:
+ @Component install
+
+clean:
+ rm -fr build components template.js
+
+.PHONY: clean
17 Readme.md
@@ -0,0 +1,17 @@
+
+# regexps
+
+ Collection of regular expressions.
+
+## API
+
+ These are exported:
+
+ - `email`
+ - `url`
+ - `cc`
+ - `urlsafe`
+
+## License
+
+ MIT
10 component.json
@@ -0,0 +1,10 @@
+{
+ "name": "regexps",
+ "description": "Collection of regular expressions",
+ "version": "0.0.1",
+ "keywords": ["regexp", "regular", "expressions"],
+ "dependencies": {},
+ "scripts": [
+ "index.js"
+ ]
+}
5 index.js
@@ -0,0 +1,5 @@
+
+exports.email = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/;
+exports.url = /^(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?:\w+:\w+@)?((?:(?:[-\w\d{1-3}]+\.)+(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|edu|co\.uk|ac\.uk|it|fr|tv|museum|asia|local|travel|[a-z]{2}))|((\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)(\.(\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)){3}))(?::[\d]{1,5})?(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?:#(?:[-\w~!$ |\/.,*:;=]|%[a-f\d]{2})*)?$/i;
+exports.cc = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
+exports.urlsafe = /^[^&$+,\/:=?@ <>\[\]\{\}\\^~%#]+$/;

0 comments on commit 4a73ca6

Please sign in to comment.
Something went wrong with that request. Please try again.