regxlib 0.1.3 → 0.1.4
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/README.md +7 -2
- data/docs/regex_library/email/regxlib_email_co_uk_com.md +15 -0
- data/docs/regex_library/string/regxlib_string_char_nospace.md +13 -0
- data/docs/regex_library/string/regxlib_string_num_nospace.md +12 -0
- data/lib/regxlib.rb +19 -0
- data/lib/regxlib/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d7ca0535703135cb3758bd0bc6b65d5aedbc999
|
|
4
|
+
data.tar.gz: b53d64090de584955fcf327f0d89471a1d10926e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7280b86b8ed8227c6b99df2d689c17eed389d72de964240a1080778409d154dc81a8499731e10b612fa4cbe752b7d729f7c2f1f0f16b20946f737202b6e2599e
|
|
7
|
+
data.tar.gz: 703f09acb37e477d5a667d3176646ac27aa057e62ada6422b7ffab35a53989ba8c4398db5e522c4558e5462a88c262ebde4119338d15b1e9810e4b63505cefea
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
##### Code Climate
|
|
7
|
-
[](https://codeclimate.com/github/zviaz/regxlib/maintainability)
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|

|
|
@@ -24,5 +24,10 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
24
24
|
* [Regxlib::Email.standard](/docs/regex_library/email/regxlib_email_standard.md)
|
|
25
25
|
* [Regxlib::Email.org](/docs/regex_library/email/regxlib_email_org.md)
|
|
26
26
|
* [Regxlib::Email.edu](/docs/regex_library/email/regxlib_email_edu.md)
|
|
27
|
+
* [Regxlib::Email.co_uk_com](/docs/regex_library/email/regxlib_email_co_uk_com.md)
|
|
27
28
|
* [Regxlib::Email.com](/docs/regex_library/email/regxlib_email_com.md)
|
|
28
|
-
* [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
|
|
29
|
+
* [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
|
|
30
|
+
|
|
31
|
+
### String
|
|
32
|
+
* [Regxlib::String.char_nospace](/docs/regex_library/string/regxlib_string_char_nospace.md)
|
|
33
|
+
* [Regxlib::String.num_nospace](/docs/regex_library/string/regxlib_string_num_nospace.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Regxlib::Email.co_uk_com
|
|
2
|
+
|
|
3
|
+
Regular expression that checks the email ends with .co.uk or .com
|
|
4
|
+
|
|
5
|
+
Regex Pattern: /\A[\w+-.]+@[a-z\d\-.]+\.([c]+[o]+\.[u]+[k]|[c]+[o]+[m])+\z/i
|
|
6
|
+
|
|
7
|
+
| Example | Result |
|
|
8
|
+
|-|-|
|
|
9
|
+
| `User_name@email.co.uk` | Pass |
|
|
10
|
+
| `user.name@email.com` | Pass |
|
|
11
|
+
| `user@website-url.co.uk` | Pass |
|
|
12
|
+
| `user-name@email.com` | Pass |
|
|
13
|
+
| `name@!email.com` | Fail |
|
|
14
|
+
| `name@_email.co.uk` | Fail |
|
|
15
|
+
| `random^name@email.co.uk` | Fail |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Regxlib::String.char_nospace
|
|
2
|
+
|
|
3
|
+
Regular expression to check for a string of characters (a-z) with no spaces.
|
|
4
|
+
|
|
5
|
+
Regex Pattern: /\A[a-zA-Z]+\z/i
|
|
6
|
+
|
|
7
|
+
| Example | Result |
|
|
8
|
+
|-|-|
|
|
9
|
+
| example | Pass |
|
|
10
|
+
| Example | Pass |
|
|
11
|
+
| example two | Fail |
|
|
12
|
+
| example3 | Fail |
|
|
13
|
+
| example_ | Fail |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Regxlib::String.num_nospace
|
|
2
|
+
|
|
3
|
+
Regular expression to check for a string of numbers with no spaces.
|
|
4
|
+
|
|
5
|
+
Regex Pattern: /\A[0123456789]+\z/i
|
|
6
|
+
|
|
7
|
+
| Example | Result |
|
|
8
|
+
|-|-|
|
|
9
|
+
| 123 | Pass |
|
|
10
|
+
| 234 567 | Fail |
|
|
11
|
+
| example3 | Fail |
|
|
12
|
+
| 1122_33 | Fail |
|
data/lib/regxlib.rb
CHANGED
|
@@ -48,6 +48,11 @@ module Regxlib
|
|
|
48
48
|
/\A[\w+-.]+@[a-z\d\-.]+\.[e]+[d]+[u]+\z/i
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
# Regxlib::Email.co_uk_com
|
|
52
|
+
def self.co_uk_com
|
|
53
|
+
/\A[\w+-.]+@[a-z\d\-.]+\.([c]+[o]+\.[u]+[k]|[c]+[o]+[m])+\z/i
|
|
54
|
+
end
|
|
55
|
+
|
|
51
56
|
# Regxlib::Email.com
|
|
52
57
|
def self.com
|
|
53
58
|
/\A[\w+-.]+@[a-z\d\-.]+\.[c]+[o]+[m]+\z/i
|
|
@@ -61,4 +66,18 @@ module Regxlib
|
|
|
61
66
|
end
|
|
62
67
|
# [END] Regxlib::Email ##############
|
|
63
68
|
|
|
69
|
+
# [START] Regxlib::String ##############
|
|
70
|
+
|
|
71
|
+
# Regxlib::String.char_nospace
|
|
72
|
+
def self.char_nospace
|
|
73
|
+
/\A[a-zA-Z]+\z/i
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Regxlib::String.num_nospace
|
|
77
|
+
def self.num_nospace
|
|
78
|
+
/\A[0123456789]+\z/i
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# [END] Regxlib::String ##############
|
|
82
|
+
|
|
64
83
|
end
|
data/lib/regxlib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Speight
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -70,10 +70,13 @@ files:
|
|
|
70
70
|
- bin/console
|
|
71
71
|
- bin/setup
|
|
72
72
|
- docs/regex_library/email/regxlib_email_co_uk.md
|
|
73
|
+
- docs/regex_library/email/regxlib_email_co_uk_com.md
|
|
73
74
|
- docs/regex_library/email/regxlib_email_com.md
|
|
74
75
|
- docs/regex_library/email/regxlib_email_edu.md
|
|
75
76
|
- docs/regex_library/email/regxlib_email_org.md
|
|
76
77
|
- docs/regex_library/email/regxlib_email_standard.md
|
|
78
|
+
- docs/regex_library/string/regxlib_string_char_nospace.md
|
|
79
|
+
- docs/regex_library/string/regxlib_string_num_nospace.md
|
|
77
80
|
- docs/regex_library/username/regxlib_username_standard.md
|
|
78
81
|
- docs/regex_library/username/regxlib_username_standard_nonum.md
|
|
79
82
|
- docs/regex_library/username/regxlib_username_strict.md
|