Created
June 12, 2020 17:20
-
-
Save ppazos/559c8caf11da5a4b46e410db8e8ac052 to your computer and use it in GitHub Desktop.
Checks if the template id matches our normalized format just checking the ending
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def regex = /.*\.([a-z]{2})\.v([0-9]+[0-9]*(\.[0-9]+[0-9]*(\.[0-9]+[0-9]*)?)?)$/ | |
def input = [ | |
'c_o_v_i_d-19_pneumonia_diagnosis_and_treatment_(7th_edition)_en_v1_en_v1.en.v1', | |
'Cualequier Cosa.es.v1', | |
'Cualequier Cosa.es.v234.234', | |
'Cualequier Cosa.es.v234.234.234', | |
'`1234567890-=~!@#$%^&*(){}"|>?><,./;[].en.v1', | |
'asdasda.v1' | |
] | |
input.each { | |
if (it.matches(regex)) | |
{ | |
println "matches" | |
} | |
else | |
{ | |
println "no match" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment