Added URL regex match
This commit is contained in:
parent
1640923001
commit
9e145fea13
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,10 @@ const PropertyValueElement = (props:Props): JSX.Element => {
|
|||
const emailRegexp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
return emailRegexp.test(val.toLowerCase())
|
||||
}
|
||||
case 'url': {
|
||||
const urlRegexp = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w\-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/
|
||||
return urlRegexp.test(val.toLowerCase())
|
||||
}
|
||||
case 'text':
|
||||
return true
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue