I am using this lib for validation and are trying to add my own regex.
What I want to do is to make a regex that allows alphanumeric A-Z 0-9 together with dashes and unserscores -_
I have tryed
let regex = "[a-zA-Z0-9_-]"
let intRegex = "^[0-9]*$"
Your regex look good but it will only match a single character. Do this
"^[a-zA-Z0-9_-]*$" instead to match more than one character.
^ -- start of string
[\pL0-9_-] -- characters you want to allow
* -- any number of characters (the crucial bit you were missing)
$ -- end of string