1
(1). I would like to validate a string by checking that it only has {[a-z], [A-Z], [0-9], '-'}
if(minhaString.ContemApenas({[a-z], [A-Z], [0-9], '-'}) == true)
{
// Minha string é válida!
}
(2). I also need to validate if such a string is a Guid.
if(minhaString == Guid){
// String é um Guid Válido!
}
You have the
regex
ready and does not know how to apply, this?– Jéf Bueno
In fact, I think there should be two separate questions.
– Jéf Bueno
I don’t have Regex, I’d like to learn how to ride it.
ContemApenas()
was just an example. I asked the same question because they are validations for the same object.– Jedaias Rodrigues
I recommend reading http://answall.com/questions/42459/express%C3%A3o-regular-n%C3%A3o-works-correctly-in-webform/42486
– Guilherme Lautert