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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:29:03+00:00 2026-05-30T12:29:03+00:00

I am working with the following block of code: <li class=standby id=id4> <a href=www.google.com

  • 0

I am working with the following block of code:

<li class="standby" id="id4"> 
<a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
<li class="standby" id="id5"> 
<a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
<li class="standby" id="id6"> 
<a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
<li class="standby" id="id7"> 
<a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>

I have com across quite a few different patterns, but I can not seem to get any to work for what I need. I have been working with /^(?:<li>.*?</li>\s*)/ but I know it’s way off. Basically I need to use regex to find and remove an LI based on the Id, which will be handled dynamically. so if the above were a menu, I would need to remove 5 for example. If I can get the regex working to highlight 5 for example in http://regexpal.com/ I should be able to wrap this up.

Update:
I need to use a non js based function to accomplish this, so no jquery. specifically I am using the : http://cfquickdocs.com/cf9/#rematchnocase

  • 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-30T12:29:05+00:00Added an answer on May 30, 2026 at 12:29 pm

    Thank you to my teammate @Alex Brown for the updated regex functions, @Paul Alexander for the correct direction on the php/cf versions and @Splash-x @nnnnn for the jquery versions I needed. here is a test case for the cf side, will update once I get the jquery setup:

    <cfsavecontent variable="Psuedo">
    <li class="standby" id="id4"> 
    <a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
    <li class="standby" id="id5"> 
    <a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
    <li class="standby" id="id6"> 
    <a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI>
    <li class="standby" id="id7"> 
    <a href="www.google.com" target="_self" title="Contact Information"> Contact Information<font class="menuItemType">(BB)</font></a></LI> 
    </cfsavecontent>
    <cfscript >
    t=structNew();
    //find one and kill it
    t.Psuedo=Psuedo;
    t.1.testCase1='<li[^>]*?id="id5".*?li>';
    t.1.after1=reReplaceNoCase(t.Psuedo,t.1.testCase1,"","All");
    t.1.testCase2='<li[^>]*?id="id4".*?li>';
    t.1.after2=reReplaceNoCase(t.1.after1,t.1.testCase2,"","All");
    t.1.testCase3='<li[^>]*?id="id7".*?li>';
    t.1.after3=reReplaceNoCase(t.1.after2,t.1.testCase3,"","All");
    //find more than 1 and kill them
    t.2.testCase1='<li[^>]*?id="id(5|7)".*?li>';
    t.2.after1=reReplaceNoCase(t.Psuedo,t.2.testCase1,"","All");
    </cfscript>
    <cfdump var="#t#">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with the following code block: <UL id=nav-main-links> <li class=standby id=id61> <a
I am currently working with the following pseudo code block to fix a regex
I need a transformation of the following working curl command: curl --data-binary @data.txt http://www.example.com/request.asp
I have the following block of code in a jQTouch app I'm working on:
In the following (working) code example, the templated register_enum() function is used to iterate
I am working on the following code: import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.*; import
Here is the approx. code I am working with. public class Note { public
So I have the following code: import java.lang.Thread; import java.lang.Integer; class MyThread extends Thread
I have the following code: <div id=ftr_btm> <div id=ftr_ctr> <div class=hdr_lnk> <ul> <li><a>Test1</a></li> <li><a>Test2</a></li>
I have following code. Parent Class: class Parent{ void a() { if(// some logic

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.