-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
73 lines (64 loc) · 1.36 KB
/
README
File metadata and controls
73 lines (64 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Match - Readable Expressions for JavaScript
* Copyright 2010, Marcus Phillips
* marcus@readableexpressions.com
*
*
* *** Licensing Information ***
* Licensed under the GPL Version 2 license
*
*
* *** Purpose ***
* Match provides a more accesible alternative to the syntax of Regular Expression literals
*
*
* *** Example usage ***
* see qombat.m.examples.js
*
*
* *** Todo ***
* \xxx Find the ASCII character expressed by the octal number xxx 1 4 4
* \xdd Find the ASCII character expressed by the hex number dd 1 4 4
* \uxxxx Find the ASCII character expressed by the UNICODE xxxx 1 4 4
* lookahead()
*/
// * *** Example usage ***
// roughly equivalent to /^[-0-9A-z._+&]+@(?:[-0-9A-z]+\.)+[A-z]{2,6}\.?$/i
email_matcher = M(
M.beginning,
M.some(
M.or(
M.alphanumerics, '-', '.', '_', '+', '&'
)
),
'@',
M.some(
M.some(
M.or(
M.alphanumerics,
'-'
)
),
'.'
),
M.between(2, 6,
M.alphas
),
M.maybe('.'),
M.end,
M.insensitive
);
// equivalent to /<([A-z][0-9A-z]*)\b[^>]*>[^]*<\/\1>/
html_tag_matcher = M(
'<',
M.grouping(
M.alphas,M.any(M.alphanumerics)
),
M.boundary,
M.any( M.nor('>') ),
'>',
M.any(),
'</',
M.backreference(1),
'>'
);