1 | ![status](https://secure.travis-ci.org/wearefractal/xemplar.png?branch=master)
|
2 |
|
3 | ## Information
|
4 |
|
5 | <table>
|
6 | <tr>
|
7 | <td>Package</td><td>xemplar</td>
|
8 | </tr>
|
9 | <tr>
|
10 | <td>Description</td>
|
11 | <td>Community collection of RegEx patterns</td>
|
12 | </tr>
|
13 | <tr>
|
14 | <td>Node Version</td>
|
15 | <td>>= 0.4</td>
|
16 | </tr>
|
17 | </table>
|
18 |
|
19 | ## Usage
|
20 |
|
21 | ```
|
22 | var patterns = require('xemplar');
|
23 | ```
|
24 |
|
25 | ```js
|
26 | var patterns = require('xemplar');
|
27 | var actual = 'some text with words';
|
28 | var regexp = patterns.text.words;
|
29 |
|
30 | console.log(actual.match(regexp));
|
31 | console.log(regexp.exec(actual));
|
32 | ```
|
33 |
|
34 |
|
35 | ## Patterns so far
|
36 |
|
37 | #### {Object} text
|
38 | - **{RegExp}** `words`
|
39 | - **{RegExp}** `nonblank`
|
40 | - **{RegExp}** `trim`
|
41 | - **{RegExp}** `ltrim`
|
42 | - **{RegExp}** `rtrim`
|
43 |
|
44 | #### {Object} number
|
45 | - **{RegExp}** `percent`
|
46 | - **{RegExp}** `all`
|
47 | - **{RegExp}** `negative`
|
48 | - **{RegExp}** `positive`
|
49 |
|
50 | #### {Object} information
|
51 | - **{RegExp}** `email`
|
52 | - **{RegExp}** `phone`
|
53 | - **{RegExp}** `credit_card`
|
54 | - **{RegExp}** `zip_code`
|
55 |
|
56 | #### {Object} time
|
57 | - **{RegExp}** `gmt`
|
58 | - **{RegExp}** `military`
|
59 | - **{RegExp}** `standard`
|
60 | - **{RegExp}** `date`
|
61 | - **{RegExp}** `date_time`
|
62 | - **{RegExp}** `month`
|
63 |
|
64 | #### {Object} technology
|
65 | - **{Object}** `frequency`
|
66 | + **{RegExp}** `all`
|
67 | + **{RegExp}** `thz`
|
68 | + **{RegExp}** `ghz`
|
69 | + **{RegExp}** `mhz`
|
70 | + **{RegExp}** `khz`
|
71 | + **{RegExp}** `hz`
|
72 | - **{Object}** `size`
|
73 | + **{RegExp}** `all`
|
74 | + **{RegExp}** `tb`
|
75 | + **{RegExp}** `gb`
|
76 | + **{RegExp}** `mb`
|
77 | + **{RegExp}** `kb`
|
78 | + **{RegExp}** `b`
|
79 |
|
80 | #### {Object} security
|
81 | - **{Object}** `xss`
|
82 | + **{RegExp}** `simple`
|
83 | + **{RegExp}** `img`
|
84 | + **{RegExp}** `paranoid`
|
85 | - **{RegExp}** `lfi`
|
86 | - **{RegExp}** `sql`
|
87 |
|
88 | #### {Object} currency
|
89 | - **{RegExp}** `dollars`
|
90 |
|
91 | #### {Object} code
|
92 | - **{RegExp}** `cli`
|
93 | - **{Object}** `comment`
|
94 | + **{RegExp}** `single`
|
95 | + **{RegExp}** `block`
|
96 | - **{Object}** `color`
|
97 | + **{RegExp}** `hex`
|
98 | + **{RegExp}** `rgb`
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | ## LICENSE
|
104 |
|
105 | (MIT License)
|
106 |
|
107 | Copyright (c) 2012 Fractal <contact@wearefractal.com>
|
108 |
|
109 | Permission is hereby granted, free of charge, to any person obtaining
|
110 | a copy of this software and associated documentation files (the
|
111 | "Software"), to deal in the Software without restriction, including
|
112 | without limitation the rights to use, copy, modify, merge, publish,
|
113 | distribute, sublicense, and/or sell copies of the Software, and to
|
114 | permit persons to whom the Software is furnished to do so, subject to
|
115 | the following conditions:
|
116 |
|
117 | The above copyright notice and this permission notice shall be
|
118 | included in all copies or substantial portions of the Software.
|
119 |
|
120 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
121 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
122 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
123 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
124 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
125 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
126 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
\ | No newline at end of file |