G
glennremar
I was tring to write a function to make that took the letters that a
user is searching for and making the first occurrence of it bold in
the results (ignoring the case).
the results, I am getting a bold $1 with IE6.
How can I determine what the occurrence of the phrase is in the
correct case?
I realize I can write this parsing the string without regular
expressions but I thought this would be cleaner.
var match = new RegExp( escapeCharsForRegExp(typedLetters), "i");
if (match.test(text))
{
text = text.replace(match, '<b>' + '$1' + '</b>' );
}
user is searching for and making the first occurrence of it bold in
the results (ignoring the case).
thought this would work. Perhaps I misunderstood what $1 is. But inFrom reading javascript books and looking at posts in this group, I
the results, I am getting a bold $1 with IE6.
How can I determine what the occurrence of the phrase is in the
correct case?
I realize I can write this parsing the string without regular
expressions but I thought this would be cleaner.
var match = new RegExp( escapeCharsForRegExp(typedLetters), "i");
if (match.test(text))
{
text = text.replace(match, '<b>' + '$1' + '</b>' );
}