Forum Moderators: phranque
strSearch = "Data"
Once the text is found (case insensitive), "bold" it.
For instance, the text that I'm going to match is "Data",
1.) if the first content has "data" just bold it data , not
Data
2.) If the content has "DATA", just bold DATA , not
Data
Please advice, thanks. Currently I only manage to replace whatever text found with the strSearch. As long as there has "Data" matched, it will bold it with "Data", but this is not what i want.
$text =~ s [perldoc.com]!(data)!<b>$1</b>!i;
$text = preg_replace [php.net]("'(data)'i", "<b>\\1</b>", $text);
will do the job in either Perl [perl.com] or PHP [php.net].
Andreas