$sent1="Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated transcription factor in tobacco plants.";
$sent2="I branching formation in erythroid differentiation is regulated by transcription factor.";
$query="transcription factor";(as a phrase)
I want to match $query.
I tried using regular expression but it is not working.I gave like this:-
what is not doing ? you can at least show your output.
I don't know, here's my simulation of your problem
$sent1="Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated transcription factor in tobacco plants.";
$sent2="I branching formation in erythroid differentiation is regulated by transcription factor.";
$query="transcription factor";
print "Original sent1: $sent1\n";;
if($sent1=~/$query/i)
{
print "matched\n";
$sent1=~s/($query)/<spanstyle="background-color:#E1FF77">$1<\/span>/i;
print "<br>sentence1=$sent1<br>";
}
Here's my output.
# ./test1.pl
Original sent1: Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated transcription factor in tobacco plants.
matched
<br>sentence1=Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated <spanstyle="background-color:#E1FF77">transcription factor</span> in tobacco plants.<br>
#
But on the browser the phrase "transcription factor" is not getting highlighted.
here is th output
Original sent1: Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated transcription factor in tobacco plants.
matched
sentence1=Transactivation of wound-responsive genes containing the core sequence of the auxin-responsive element by a wound-induced protein kinase-activated transcription factor in tobacco plants.