JavaScript How to change the color of a line in a HTML page containing a specific word change color line plot matlab,change color line matplotlib,change

how to change the color of a line in a HTML page(text in a pre>) Containing A specifique word for example i want to change the color a any line containig "ERROR" and "Erreur"

2014/05/22 02:27:02 - X.0 - Finished processing 
2014/05/22 02:27:02 - DSA.0 - Finished processing 
2014/05/22 02:27:03 - Block.0 - Finished processing 
2014/05/22 02:27:03 - Errors CustomerGroupDimEU.0 
2014/05/22 02:27:03 - Old = New ?.0 - Finished processing 
2014/05/22 02:27:03 - Exists = 0.0 - Finished processing 

this code replace only the word

(function ($) {
    var thePage = $("body");
    thePage.html(thePage.html().replace(/Error/ig, '<span style="color: red;font-weight: bold;">Error</span>'));
})
Answer:1

The regex was tricky. But here is your desired output :)

 (function($) {
    var thePage = $("body"); 
    thePage.html(thePage.html().replace(/(^.*\b(Errors)\b.*)$/igm, 
     '<span style="color: red;font-weight: bold;">$1</span>'));
    })(jQuery);

If you want to match more keywords:

/(^.*\b(Errors|Error|Erreur)\b.*)$/igm  

You can keep on adding the keywords with |

DEMO

Answer:2

I have the following User object: { "_id" : ObjectId("someId"), "name" : "Bob", "password" : "fakePassword", "follower" : [...], "following" : [..] } I need to paginate over the follower ...

I have the following User object: { "_id" : ObjectId("someId"), "name" : "Bob", "password" : "fakePassword", "follower" : [...], "following" : [..] } I need to paginate over the follower ...

  1. mongodb limit fields returned
  2. mongodb limit fields
  3. mongodb find limit fields
  4. mongodb lookup limit fields
  5. mongodb aggregate limit fields
  6. mongodb query limit fields
  7. spring data mongodb limit fields

I am working through a project for a company I plan on working for and I was given a code challenge to create a choropleth map of Kenya. I have been able to generate the map using GeoJSON and TopoJSON ...

I am working through a project for a company I plan on working for and I was given a code challenge to create a choropleth map of Kenya. I have been able to generate the map using GeoJSON and TopoJSON ...

I am trying to show a list grouped by date but the list isn't sorted and I don't know when the date change. It's like I have this Json : list = {name: first, date: 2014-05-21}, { {name: second, date:...

I am trying to show a list grouped by date but the list isn't sorted and I don't know when the date change. It's like I have this Json : list = {name: first, date: 2014-05-21}, { {name: second, date:...

  1. array with arrays javascript
  2. array with arrays
  3. array with arrays python
  4. array with arrays php
  5. array with arrays c#
  6. array with arrays numpy
  7. array with arrays merge
  8. array with arrays in java
  9. array of arrays matlab
  10. array of arrays js
  11. array of arrays typescript
  12. array of arrays swift
  13. array of arrays vba
  14. array of arrays arduino
  15. array of arrays json
  16. array of arrays perl
  17. array of arrays bash
  18. array of arrays ruby
  19. array of arrays golang
  20. array of arrays powershell

How can i call a javascript function without any event. I have a session variable namely x. what I need is to call a javascript function demo() if the session variable is not null. <% if((String)...

How can i call a javascript function without any event. I have a session variable namely x. what I need is to call a javascript function demo() if the session variable is not null. <% if((String)...

  1. call function javascript in html
  2. call function javascript in php
  3. call function javascript when page load
  4. call function javascript by name
  5. call function javascript from another file
  6. call function javascript from c#
  7. call function javascript with parameters
  8. call function javascript button click
  9. call function javascript w3schools
  10. call function javascript onclick
  11. call function javascript in jquery
  12. call function javascript every 5 seconds
  13. call function javascript console
  14. call function javascript with arguments
  15. call function javascript after delay
  16. call function javascript dynamically
  17. call function javascript onclick button