I’m wondering how to change this exact php regex feature into javascript?
$ismatch= preg_match('|She is a <span><b>(.*)</b></span>|si', $sentence, $matchresult);
if($ismatch)
{
$gender= $matchresult[1];
}
else{ //do other thing }
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not quite trivial since JavaScript doesn’t support the
smodifier.The equivalent regex object would be
The functionality of the code (extracting group 1 from the match if there is a match) would be done in JavaScript like this: