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 9240401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:11:01+00:00 2026-06-18T08:11:01+00:00

I think I’m just having too much trouble understanding how to use regex and

  • 0

I think I’m just having too much trouble understanding how to use regex and creating links…

I’m working on a Greasemonkey script for a virtual pet game that will create links to the wiki for each creature listed on a certain page. The problem is, new pets get added to the page all the time so I can’t just hardcode the links into the script. I need to search for the creatures names and then make it a link…

You can view the target page without signing up.

Sample source code from the target page:

<tr>
    <td>Flizzard</td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
</tr>
<tr>
    <td>Fluff</td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><img src="./images/icons/yes.png" /></td>
    <td align="center"><a href="accomplishments.php?family=Fluff&acc=exalted"><img src="./images/icons/no.png" border="0" /></a></td>
    <td align="center"><a href="accomplishments.php?family=Fluff&acc=herd"><img src="./images/icons/no.png" border="0" /></a></td>
</tr>  

.
.

“Flizzard” and “Fluff” would be what I want to turn into links… I found this and started working on it, and it might work, except it doesn’t seem to say where to start the match (in a way that makes sense to me anyways), and I have NO clue what to put in (The-Identifier-That-Denotes-End-Of-Text-Of-Interest)

var html = document.body.innerHTML;
html = html.replace( /(http://wiki.unicreatures.com/index.php?title=)(.*?)(The-
Identifier-That-Denotes-End-Of-Text-Of-Interest)/g, $1<a href="path/to/$2">$2</a>$3
);
document.body.innerHTML = html;  

.

Could somebody maybe please try to explain how that regex works, and what would work for (The-Identifier-That-Denotes-End-Of-Text-Of-Interest) since I don’t seem to see any punctuation or spaces after the creatures names?

Thanks!

(Please NO jQuery info… javascript is enough to wrap my brain around right now LOL)

  • 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-18T08:11:02+00:00Added an answer on June 18, 2026 at 8:11 am

    The other answer didn’t work… but this did

    var mytable = document.getElementById('right').getElementsByTagName('table')[4];
    var myrows = mytable.rows
    
    for(i=1;i < myrows.length;i++)
    {
    var oldInner;
    oldInner = myrows[i].cells[0].innerHTML;
    var critterName;
    critterName=myrows[i].cells[0].textContent;
    
     myrows[i].cells[0].innerHTML = "<a href='http://wiki.unicreatures.com
    /index.php?title=" + critterName + "'"+ 'target="_blank">'+oldInner +"</a>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I think I have a basic understanding of this, but am hoping that someone
Think it might be best if I just show you the code. while ($row
Think tic-tac-toe. You are creating the buttons in rows and columns and you want
I think this is more of my lack of understanding the intricacy of Types
Think about New Egg's e-commerce drill down model to start, where keyword links on
Think its a simple one. I am working on a site. The design is
think about having a skript where you have some words as input. now you
I think I get it how to use the NSJSONSerialization over all. The call
I think this is as much a programming practice question as it is a

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.