Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 207565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:44:50+00:00 2026-05-11T17:44:50+00:00

After loosing much sleep I still cannot figure this out: The code below (its

  • 0

After loosing much sleep I still cannot figure this out:

The code below (its a simplification from larger code that shows only the problem) Identifies Item1 and Item2 on FF but does not on IE7. I’m clueless.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>

<body>
<table><tr>
<td><img src=imgs/site/trash.jpg border=1></td><td><font style="">Item1</font></td>
<td><img src=imgs/site/trash.jpg border=1></td><td><font style="">Item2</font></td>
</tr></table>

<script type="text/javascript">
    var _pattern =/trash.*?<font.*?>(.*)<\/font>/gim;
    alert (_pattern);

    var thtml = document.documentElement.innerHTML;
    alert (thtml);
    while ( _match =_pattern.exec(thtml)){
        alert (_match[1]);

    }

</script>

</body>
</html>

Notes: 1. I know there are better ways to get Item1 and Item2. this example is for showing the Regex problem I’m facing in the simplest way.
2. When I remove the table and /table tags it works.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:44:50+00:00Added an answer on May 11, 2026 at 5:44 pm

    The problem is that JScripts multiline implementation is buggy. It doesn’t allow the any char . to match a newline character.

    Use this regex instead:-

     var _pattern = /trash[\s\S]*?<font[^>]*>([^<]*)<\/font>/gi;
    

    This eliminates . altogether, note [\s\S] is equivalent but will match a new line.

    The reason why removing table changes things is the IE’s .innerHTML implementation doesn’t rely on original markup received. Instead the markup is created dynamically by examining the DOM. When it sees a table element it places newlines in the output in different places to than when table is missing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 159k
  • Answers 159k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The entire first chapter of Donald Knuth's seminal work Seminumerical… May 12, 2026 at 11:27 am
  • Editorial Team
    Editorial Team added an answer Well, svn switch --relocate is indeed the way to do… May 12, 2026 at 11:27 am
  • Editorial Team
    Editorial Team added an answer Turns out to be the documentation on the Isapi Readme...… May 12, 2026 at 11:27 am

Related Questions

My program has a component - dubbed the Scheduler - that lets other components
I'm looking for a portable interface to POSIX alarm(2) (or similar) in Ruby. That's
I am writing a server program in C wherein every time a client connects,
After spending a lot of time and code on programming in Swing, I thought

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.