I have a regular expression in PHP and its working fine but i want to use it in js as well can any please tell me how to do that i am not much familiar with it
In php this expression is working like this it allow hyphen symbol (-) between number and character but remove hyphen symbol between characters and replace it with white space Like if i use any of this string
$string ="Al-Abbas - Manama - 100" or
$string ="100 - Al-Abbas - Manama"
$repl = preg_replace('/\d\h*-\h*(*SKIP)(*F)|-(?!\h*\d)/', ' ', $string);
after this i am getting this output
Al Abbas Manama - 100
100 - Al Abbas Manama
i want to do same like this in javascript how can i convert this expression in javascript or any other way to do like this in javascript.