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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:26:16+00:00 2026-05-15T07:26:16+00:00

I have content stored as raw text in a database that I show in

  • 0

I have content stored as raw text in a database that I show in a HTML table on a web site. In the content people refer to numbers and i want to have those numbers automatically become links

For example, in a field I might have

This description is for driving a car.  The manual refers to ABC:25920 and is very durable.

In this case above I want ABC:2590 to actually be an HTML link that translates to this HTML

<a href='www.mysite.com/parts/25920'>ABC:25920</a>

What is the best way of doing this. Some kind of find and replace? Is there some other pattern matching / regex solution here?

  • 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-15T07:26:17+00:00Added an answer on May 15, 2026 at 7:26 am

    It’s not clear precisely what format the numbers have. If the rule is that anything which consists of capital letters, a colon, and a number n should be turned into the link www.mysite.com/parts/n, then you can use a regex-based find-and-replace solution. You would want to look for the regex [A-Z]+:(\d+). What this says is “find one or more capital letters, a colon, and (capturing them) find one or more digits”. You then want to replace this with <a href='www.mysiste.com/parts/$1'>$0</a>; in this case, $1 refers back to the capturing group (that is, the digits), and $0 refers to the whole match. I don’t know C#, but I think this would look like

    using System.Text.RegularExpressions;
    // ...
    string result = Regex.replace( getTextFromDatabase()
                                 , @"[A-Z]+:(\d+)"
                                 , "<a href='www.mysiste.com/parts/$1'>$0</a>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table having HTML content stored as binary serialized blob. I
I have a content query web part that queries by content type against a
I have a stored procedure in a MS-SQL 2005 database that: Creates two temp
I have static content like html,css javascript stored in DB. when a user requests
I have the following content stored inside a database column: <p>Lorem ipsum dolor sit
I have an application where the contents of e-mails that get sent are stored
I have some content that i have to render as a excel file in
I'm starting a Wordpress Blog that will have adult content on it, so I'll
In silverlight 2.0. I have some content that i want to scroll vertically and
I'm using Ajax to dynamically populate a DIV. I have each page content stored

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.