highlight « Regular Expression « Javascript Data Type Q&A

Home
Javascript Data Type Q&A
1.Array
2.Clojure
3.date
4.decimal
5.function
6.global
7.loop
8.math
9.number
10.object
11.Regular Expression
12.scope
13.String
14.Var
15.variable
Javascript Data Type Q&A » Regular Expression » highlight 

1. Javascript: highlight substring keeping original case but searching in case insensitive mode    stackoverflow.com

I'm trying to write a "suggestion search box" and I cannot find a solution that allows to highlight a substring with javascript keeping the original case. For example if I search for ...

2. Javascript: Highlighting part of a string with tags    stackoverflow.com

I'm trying to highlight a match in a string by inserting <b> tags around the matching substring. For example, if the query is "cat" then:

"I have a cat."
should become:
"I have ...

3. Search and Highlight Text With Bracketed Text in javascript by regular expression    stackoverflow.com

I am doing one project for tat i want to search and highlight text the words i can able to search the words and multiple words through regular expression.my code is

var ...

4. How to match for more than one value in a string using regex match    stackoverflow.com

Hi i want to highlight whole gold ring for this i am doing as

var match = hitem.text[0].match(/<em>(.*?)<\/em>/);
where hitem.text[0]=<em>Gold</em> <em>Ring</em>
but the problem is var match is getting only Gold so i am ...

5. Syntax Highlighting in Javascript    stackoverflow.com

I am currently working on some syntax highlighting in Javascript. To match strings, I would use something like this:
code = code.replace(/("([^"\\]*(\\.[^"\\]*)*)")/gm, "<span class=\"string\">$1</span>"); // string This would match an integer:
code = code.replace(/(\d+)/gm, "<span ...

6. JS regex name highlighting    stackoverflow.com

I'm creating an auto complete and I'm having a little problem the results highlighting. You see my searching algorithm is very generous and ignores apostrophes in the result so therefore a ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.