I am stuck on preg_match vs regex
I am trying to verify user input value on client side. For their first and last name i have this expression that is good for preg_match;
~^([\p{L}-\s']+)$~ui  <--- working fine with preg_match
I need the équivalent for JavaScript Regex
I have a lot of hard time figuring it out and nothing works.
Ex;
Jean-François d'abigaël    passes with  ~^([\p{L}-\s']+)$~ui Preg_match
I need the Regex version of it.
Also would like a version for PHP Preg_match and JavaScript Regex that would accept the same thing but with numbers [0-9].
EDIT
 var re = /~^([\p{L}-\s']+)$~/i;    <----- Not working at all
     if (re.test(value) == true){ 
    // it passes regex
    }
else{
   // it does not
    }
String example ;
- à_wéird_Us0r-Nam3 <--- Unicode with A-Z àéçûö.... 0-9 -_’' Regex + Pregmatch
- Étiène Boîs d'autêgne <--- Same but no _ or numbers for Regex
Help would be much appreciated.
 
     
    