File tree Expand file tree Collapse file tree 2 files changed +0
-20
lines changed
main/scala/com/github/gekomad/regexcollection Expand file tree Collapse file tree 2 files changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ trait AsciiString
94
94
trait Celsius
95
95
trait Fahrenheit
96
96
trait HtmlHref
97
- trait HtmlImg
98
97
99
98
object Collection {
100
99
@@ -159,7 +158,6 @@ object Collection {
159
158
Validator [Email ](""" [a-zA-Z0-9\.!#$%&'*+/=?^_`{|}~-]+@[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])?)*""" )
160
159
161
160
implicit val validatorEmailSimple : Validator [EmailSimple ] = Validator [EmailSimple ](""" .+@.+\..+""" )
162
- implicit val validatorHtmlImg : Validator [HtmlImg ] = Validator [HtmlImg ](""" <img>.*<\/img>|<img.*[<\/img>|\/>]+""" )
163
161
implicit val validatorHref : Validator [HtmlHref ] = Validator [HtmlHref ](""" href=[\"\'](http[s]?:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\']""" )
164
162
implicit val validatorEmail1 : Validator [Email1 ] = Validator [Email1 ](""" [_&A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*(\.[A-Za-z]{2,})""" )
165
163
implicit val validatorFacebook : Validator [Facebook ] = Validator [Facebook ](""" https:\/\/(www|[a-zA-Z]{2}-[a-zA-Z]{2})\.facebook\.com\/(pages\/[a-zA-Z0-9\.-]+\/[0-9]+|[a-zA-Z0-9\.-]+)[\/]?""" )
Original file line number Diff line number Diff line change @@ -52,24 +52,6 @@ class Validate extends FunSuite {
52
52
assert(validate[HtmlHref ](""" href="bad example"""" ) == None )
53
53
}
54
54
55
- test(" HtmlImg" ) {
56
- import com .github .gekomad .regexcollection .Validate .validate
57
- import com .github .gekomad .regexcollection .HtmlImg
58
-
59
- assert(
60
- validate[HtmlImg ](""" <img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""" ) == Some (""" <img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""" )
61
- )
62
- assert(validate[HtmlImg ](""" xxx"""" ) == Some (""" xxx"""" ))
63
- assert(validate[HtmlImg ](""" xxx"""" ) == Some (""" xxx"""" ))
64
- assert(validate[HtmlImg ](""" <a href="http://www.aaa.it/pxx/""""" ) == None )
65
- assert(
66
- validate[HtmlImg ](""" <img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""" ) == Some (""" <img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""" )
67
- )
68
- assert(validate[HtmlImg ](""" <h2 class="entry-title">"""" ) == Some (""" <h2 class="entry-title">"""" ))
69
- assert(validate[HtmlImg ](" aaaa" ) == None )
70
-
71
- }
72
-
73
55
test(" Email simple" ) {
74
56
import com .github .gekomad .regexcollection .Validate .validate
75
57
{ // custom email pattern
You can’t perform that action at this time.
0 commit comments