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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:55:23+00:00 2026-05-27T04:55:23+00:00

I have some existing code that looks something like this: [tag:cb cbid=12345 cbwidth=200 cbclassname=calloutbox

  • 0

I have some existing code that looks something like this:

[tag:cb cbid="12345" cbwidth="200" cbclassname="calloutbox" cbposition="left"] Lorem ipsum dolor sit amet, consectetur adipiscing elit.
[tag:cb cbid="123" cbwidth="200" cbclass="calloutbox2" cbposition="left"] Suspendisse eleifend enim a magna pretium porttitor.

I need to write a VB .Net global function that will match these [tag:cb] and take the optional parameters and rewrite the string with Html tags.

<div id="12345" width="200" class="calloutbox" position="left">content (based on id)</div>

Any help is appreciated. Thanks.

  • 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-27T04:55:24+00:00Added an answer on May 27, 2026 at 4:55 am

    Here’s a start:

    ^\[tag:cb([^\]]*)\](.*)$
    

    And then you use capturegroup 1 and 2 to make the new string:

    <div$1>$2</div>
    

    This will generate something like:

    <div cbid="12345" cbwidth="200" cbclassname="calloutbox" cbposition="left"> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
    <div cbid="123" cbwidth="200" cbclass="calloutbox2" cbposition="left"> Suspendisse eleifend enim a magna pretium porttitor.</div>
    

    The problem is that it will still have attributes like cbid="123" instead of id="123". Preferably you would like to run it through another regexp to replace all occurances of cb([^=]*) and replace with capturegroup 1.

    That would output the following:

    <div id="12345" width="200" classname="calloutbox" position="left"> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
    <div id="123" width="200" class="calloutbox2" position="left"> Suspendisse eleifend enim a magna pretium porttitor.</div>
    

    All you have to do now is to implement it in VB .Net 🙂

    You can see the first part in action here: http://regexr.com?2vbkq
    and the second part here: http://regexr.com?2vbl3

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

Sidebar

Related Questions

Some existing web services I consume have methods that look something like this: List<Employee>
I have some code that looks like this: <h3>Thursday Sep 10</h3> <ul>great stuff in
I have an existing table structure that looks something like this: AnimalTable ------------- |Id
I frequently have code that looks something like this: if (itm != null) {
I have a simple server that looks something like this: void *run_thread(void *arg) {
I have some existing code that retrieves data from a database using ADO.NET that
I have some existing code. This code uses an html table for a banner.
I have some existing code that uses an enum instead of a function pointer
I have a data structure that looks like this: public class Node { public
I have some existing code which isn't formatted consistently -- sometimes two spaces are

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.