cleanup regex

This commit is contained in:
timka 2023-11-23 18:55:20 +03:00
parent 3d637372ca
commit 9c11d5e07c

View File

@ -19,7 +19,7 @@ class AddLink extends Component {
}
short () {
const regex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
const regex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
if (this.state.value === "" || this.state.value.includes('timka.su') || !(regex.test(this.state.value))) {
return
}