regxlib 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +5 -1
- data/docs/regex_library/email/regxlib_email_multi.md +28 -0
- data/docs/regex_library/string/regxlib_string_char_nospace.md +12 -0
- data/lib/regxlib.rb +38 -2
- data/lib/regxlib/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 390418ebfc5902e0b297ee3347dfdec470fbbe32
|
|
4
|
+
data.tar.gz: e8ee919b95c3302cdbf5a7f8c20a4f7e8b8f415b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72306f5bcf89aa3af18f9738b56c7b4c4eacc2c30f3cb6624ca8b98bcc0b62de0beef69c6fb56455964cb73dfe86bbe5ec8b2911bccb0b8dfe683014a8b85f4d
|
|
7
|
+
data.tar.gz: dadd57a027efdbacb873da1edefea213224d11d7126b8f39dd45a926a1e37f32dc458b679296e216c32671b5ae759ea95c73a13f385744de5f3d0ee4230c2afb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -21,9 +21,13 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
21
21
|
* [Regxlib::Username.strict_nonum](/docs/regex_library/username/regxlib_username_strict_nonum.md)
|
|
22
22
|
|
|
23
23
|
### Email
|
|
24
|
+
* [Regxlib::Email.multi](/docs/regex_library/email/regxlib_email_multi.md)
|
|
24
25
|
* [Regxlib::Email.standard](/docs/regex_library/email/regxlib_email_standard.md)
|
|
25
26
|
* [Regxlib::Email.org](/docs/regex_library/email/regxlib_email_org.md)
|
|
26
27
|
* [Regxlib::Email.edu](/docs/regex_library/email/regxlib_email_edu.md)
|
|
27
28
|
* [Regxlib::Email.co_uk_com](/docs/regex_library/email/regxlib_email_co_uk_com.md)
|
|
28
29
|
* [Regxlib::Email.com](/docs/regex_library/email/regxlib_email_com.md)
|
|
29
|
-
* [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
|
|
30
|
+
* [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
|
|
31
|
+
|
|
32
|
+
### String
|
|
33
|
+
* [Regxlib::String.char_nospace](/docs/regex_library/string/regxlib_string_char_no_space.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Regxlib::Email.standard
|
|
2
|
+
|
|
3
|
+
Standard email regular expression that checks for emails ending in a specific list of country codes.
|
|
4
|
+
|
|
5
|
+
Regex Pattern: `/\A[\w+-.]+@[a-z\d\-.]+\.([i]+[o]|[c]+[o]+[m]|[m]+[s]+[i]+[l]|[c]+[o]+\.[a]+[u] |[c]+[o]+\.[u]+[k]|[c]+[o]+\.[u]+[s]|[c]+[o]+\.[b]+[r]|[c]+[o]+\.[d]+[k]|[c]+[o]+\.[e]+[u]|[c]+[o]+\.[f]+[i]|[c]+[o]+\.[f]+[r]|[c]+[o]+\.[d]+[e]|[c]+[o]+\.[g]+[r]|[c]+[o]+\.[i]+[n]|[c]+[o]+\.[i]+[e]|[c]+[o]+\.[i]+[t]|[c]+[o]+\.[n]+[z]|[c]+[o]+\.[n]+[o]|[c]+[o]+\.[e]+[s]|[c]+[o]+\.[s]+[e])+\z/i`
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- .io
|
|
9
|
+
- .com
|
|
10
|
+
- .mail
|
|
11
|
+
|
|
12
|
+
- australia
|
|
13
|
+
- uk
|
|
14
|
+
- usa
|
|
15
|
+
- brazil
|
|
16
|
+
- canada
|
|
17
|
+
- denmark
|
|
18
|
+
- finland
|
|
19
|
+
- france
|
|
20
|
+
- germany
|
|
21
|
+
- greece
|
|
22
|
+
- india
|
|
23
|
+
- ireland
|
|
24
|
+
- italy
|
|
25
|
+
- new zealand
|
|
26
|
+
- norway
|
|
27
|
+
- spain
|
|
28
|
+
- switzerland
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Regxlib::String.char_nospace
|
|
2
|
+
|
|
3
|
+
Regular expression that only allows a-z (uppercase or lowercase) and no spaces
|
|
4
|
+
|
|
5
|
+
Regex Pattern: /\A[a-zA]+[a-zA-Z-_]+[a-zA]\z/i
|
|
6
|
+
|
|
7
|
+
| Example | Result |
|
|
8
|
+
|-|-|
|
|
9
|
+
| example | Pass |
|
|
10
|
+
| Example | Pass |
|
|
11
|
+
| Example Fail | Fail |
|
|
12
|
+
| Example 4 | Fail |
|
data/lib/regxlib.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Regxlib
|
|
|
14
14
|
|
|
15
15
|
# Regxlib::Username.standard_nonum
|
|
16
16
|
def self.standard_nonum
|
|
17
|
-
/\A[a-zA]+[a-zA-Z
|
|
17
|
+
/\A[a-zA-Z]+[a-zA-Z\-_]+[a-zA]\z/i
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# Regxlib::Username.strict
|
|
@@ -24,7 +24,7 @@ module Regxlib
|
|
|
24
24
|
|
|
25
25
|
# Regxlib::Username.strict_no_num
|
|
26
26
|
def self.strict_nonum
|
|
27
|
-
/\A[a-zA]+[a-zA]+[a-zA]\z/i
|
|
27
|
+
/\A[a-zA-Z]+[a-zA-Z]+[a-zA-Z]\z/i
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
end
|
|
@@ -33,6 +33,31 @@ module Regxlib
|
|
|
33
33
|
# [START] Regxlib::Email ###########
|
|
34
34
|
class Email
|
|
35
35
|
|
|
36
|
+
# Regxlib::Email.multi
|
|
37
|
+
def self.multi
|
|
38
|
+
/\A[\w+-.]+@[a-z\d\-.]+\.(
|
|
39
|
+
[i]+[o]
|
|
40
|
+
|[c]+[o]+[m]
|
|
41
|
+
|[m]+[a]+[i]+[l]
|
|
42
|
+
|[c]+[o]+\.[a]+[u]
|
|
43
|
+
|[c]+[o]+\.[u]+[k]
|
|
44
|
+
|[c]+[o]+\.[u]+[s]
|
|
45
|
+
|[c]+[o]+\.[b]+[r]
|
|
46
|
+
|[c]+[o]+\.[d]+[k]
|
|
47
|
+
|[c]+[o]+\.[e]+[u]
|
|
48
|
+
|[c]+[o]+\.[f]+[i]
|
|
49
|
+
|[c]+[o]+\.[f]+[r]
|
|
50
|
+
|[c]+[o]+\.[d]+[e]
|
|
51
|
+
|[c]+[o]+\.[g]+[r]
|
|
52
|
+
|[c]+[o]+\.[i]+[n]
|
|
53
|
+
|[c]+[o]+\.[i]+[e]
|
|
54
|
+
|[c]+[o]+\.[i]+[t]
|
|
55
|
+
|[c]+[o]+\.[n]+[z]
|
|
56
|
+
|[c]+[o]+\.[n]+[o]
|
|
57
|
+
|[c]+[o]+\.[e]+[s]
|
|
58
|
+
|[c]+[o]+\.[s]+[e]
|
|
59
|
+
)+\z/i
|
|
60
|
+
end
|
|
36
61
|
# Regxlib::Email.standard
|
|
37
62
|
def self.standard
|
|
38
63
|
/\A[\w+-.]+@[a-z\d\-.]+\.[a-z]+\z/i
|
|
@@ -66,4 +91,15 @@ module Regxlib
|
|
|
66
91
|
end
|
|
67
92
|
# [END] Regxlib::Email ##############
|
|
68
93
|
|
|
94
|
+
# [START] Regxlib::String ##############
|
|
95
|
+
class String
|
|
96
|
+
|
|
97
|
+
# Regxlib::String.char_nospace
|
|
98
|
+
def self.char_nospace
|
|
99
|
+
/\A[a-zA-Z]+\z/i
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
# [END] Regxlib::String ##############
|
|
104
|
+
|
|
69
105
|
end
|
data/lib/regxlib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: regxlib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Speight
|
|
@@ -73,8 +73,10 @@ files:
|
|
|
73
73
|
- docs/regex_library/email/regxlib_email_co_uk_com.md
|
|
74
74
|
- docs/regex_library/email/regxlib_email_com.md
|
|
75
75
|
- docs/regex_library/email/regxlib_email_edu.md
|
|
76
|
+
- docs/regex_library/email/regxlib_email_multi.md
|
|
76
77
|
- docs/regex_library/email/regxlib_email_org.md
|
|
77
78
|
- docs/regex_library/email/regxlib_email_standard.md
|
|
79
|
+
- docs/regex_library/string/regxlib_string_char_nospace.md
|
|
78
80
|
- docs/regex_library/username/regxlib_username_standard.md
|
|
79
81
|
- docs/regex_library/username/regxlib_username_standard_nonum.md
|
|
80
82
|
- docs/regex_library/username/regxlib_username_strict.md
|