mardi 30 mai 2017

How can I check some arbitrary regular expression and then its length?

I would like it all to be in one regular expression, because the (to me) black box tool validating the input accepts only one regex, and I would rather not introduce my own external logic to double-check.

Specifically, I am trying to modify dperini's URL regex to make sure the input is a valid URL and then make sure its length is no greater than a certain number of characters, so it fits in the database column.

i.e., I want to combine regex_check('<insert dperini's magic>); and regex_check('^.{0,250}'); into one regular expression.




Aucun commentaire:

Enregistrer un commentaire