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

  • SEARCH
  • Home
  • 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 9087343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:40:45+00:00 2026-06-16T21:40:45+00:00

In a boatload of HTML pages, I need to replace all strings like this:

  • 0

In a boatload of HTML pages, I need to replace all strings like this:

language[0].attributes[24].value;

with this:

language[0].getAttribute("attr"+24);

where ’24’ can be any number.

I thought I could use Notepad++’s Find and Replace with regular expressions to do this, but have had no luck so far after much trial and error. I don’t want to have to do this manually.

(This is because, when I upgraded to IE10, all the text on the webpages I support went out of whack. It seems that by definition XML attributes can be in any order, and that newer versions of IE reorder them. I now need to reference the attributes by name instead of index.)

Appreciate the help.

  • 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-06-16T21:40:46+00:00Added an answer on June 16, 2026 at 9:40 pm

    find the following regular expression:

    \.attributes\[(\d+)\]\.value
    

    And replace it with

    .getAttribute("attr"+\1)
    

    http://regexr.com?33b0j <– See it in action!

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

Sidebar

Related Questions

This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
I have a boatload of text files (see below) that I need to parse.
If I put this code in a .cpp file and run it, it runs
I realize this question is a bit subjective and won't have a definitive answer
I noticed this particular line of code when I was profiling my application (which
How does Wikipedia implement the edit this section feature for its articles, wherein a
I have an app which loads a boatload of images and displays them in
When ASP.NET receives a request, how does it determine whether to serve it or
I have a Ruby on Rails app that needs process many background jobs simultaneously:
As discussed elsewhere, NSTabView does not have a setBackgroundColor method and subclassing NSTabView and

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.