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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:54:56+00:00 2026-06-11T00:54:56+00:00

Please help me to replace all the additional Facebook information from here using C#

  • 0

Please help me to replace all the additional Facebook information from here using C# .net Regex Replace method.

Example

<a href="/l.php?u=http%3A%2F%2Fon.fb.me%2FOE6gnB&amp;h=yAQFjL0pt&amp;s=1" target="_blank" rel="nofollow nofollow" onmouseover="LinkshimAsyncLink.swap(this, &quot;http:\/\/on.fb.me\/OE6gnB&quot;);" onclick="LinkshimAsyncLink.swap(this, &quot;\/l.php?u=http\u00253A\u00252F\u00252Fon.fb.me\u00252FOE6gnB&amp;h=yAQFjL0pt&amp;s=1&quot;);">http://on.fb.me/OE6gnB</a>somehtml

Output

somehtml <a href="http://on.fb.me/OE6gnB">on.fb.me/OE6gnB</a> somehtml

I tried following regex but they didn’t work for me

searchPattern = "<a([.]*)?/l.php([.]*)?(\">)?([.]*)?(</a>)?";
replacePattern = "<a href=\"$3\" target=\"_blank\">$3</a>";

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-06-11T00:54:57+00:00Added an answer on June 11, 2026 at 12:54 am

    I manage to do this using regex with following code

     searchPattern = "<a(.*?)href=\"/l.php...(.*?)&amp;?(.*?)>(.*?)</a>";
              string html1 = Regex.Replace(html, searchPattern, delegate(Match oMatch)
        {
            return string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", HttpUtility.UrlDecode(oMatch.Groups[2].Value), oMatch.Groups[4].Value);
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help me with this script to replace all the string matching dev with
Please help me I am stuck! I want to copy all the subfolders from
Could someone please help me with the regexp javascript code to replace all <br
Please help to replace these jQuery functions with Prototype ones: $(button,input,label,select,textarea).bind('mouseover mouseout', function(){$(this).toggleClass('hover')}); $(button,input,select,textarea).bind('focus
Please Help me in creating a replace function. Problem: Their is a alphanumeric value
Please help me to prevent my data from SQL injection. I have replaced '
Please help me to improve the following script: http://jsfiddle.net/n9BkM/8/ I need the following fucntionality:
Please help, the question is at the bottom. CREATE OR REPLACE TYPE NameType AS
I'm a complete noob when it come to regex, Can someone please help with
Dear all..before i give up after multiple trial and error attempts,can someone please help

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.