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
9494trait Celsius
9595trait Fahrenheit
9696trait HtmlHref
97- trait HtmlImg
9897
9998object Collection {
10099
@@ -159,7 +158,6 @@ object Collection {
159158 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])?)*""" )
160159
161160 implicit val validatorEmailSimple : Validator [EmailSimple ] = Validator [EmailSimple ](""" .+@.+\..+""" )
162- implicit val validatorHtmlImg : Validator [HtmlImg ] = Validator [HtmlImg ](""" <img>.*<\/img>|<img.*[<\/img>|\/>]+""" )
163161 implicit val validatorHref : Validator [HtmlHref ] = Validator [HtmlHref ](""" href=[\"\'](http[s]?:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\']""" )
164162 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,})""" )
165163 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 {
5252 assert(validate[HtmlHref ](""" href="bad example"""" ) == None )
5353 }
5454
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-
7355 test(" Email simple" ) {
7456 import com .github .gekomad .regexcollection .Validate .validate
7557 { // custom email pattern
You can’t perform that action at this time.
0 commit comments