?
Solved

regular expression in explorer 6 and 7

Posted on 2006-11-22
2
Medium Priority
?
158 Views
Last Modified: 2010-04-16
In explorer 6  I need to remove "about:blankahm-011-en.html#AHM011-3.1"
about:blank infront of ahm-011-en.html#AHM011-3.1

and in explorer 7 I need to remove the about:

NewMatch = Regex.Matches(Str2LookIn, @"^about:[blank]*([\#a-z0-9\._-]*)", RegexOptions.IgnoreCase);


0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 17998821
Hi mathieu_cupryk;

I hope that this is what you are looking for.

Imports System.Text.RegularExpressions

        Dim input As String = "about:blankahm-011-en.html#AHM011-3.1"
        Dim output As String

        output = Regex.Replace(input, "(about:blank)(ahm)", "$2", RegexOptions.IgnoreCase)

        'output will have the value = "ahm-011-en.html#AHM011-3.1"

        output = Regex.Replace(input, "(about:)(blankahm)", "$2", RegexOptions.IgnoreCase)

        'output will have the value = "blankahm-011-en.html#AHM011-3.1"


Fernando
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 17998851
Sorry here it is in C#.

using System.Text.RegularExpressions;

        string input = "about:blankahm-011-en.html#AHM011-3.1";
        string output;

        output = Regex.Replace(input, "(about:blank)(ahm)", "$2", RegexOptions.IgnoreCase);

        'output will have the value = "ahm-011-en.html#AHM011-3.1"

        output = Regex.Replace(input, "(about:)(blankahm)", "$2", RegexOptions.IgnoreCase);

        'output will have the value = "blankahm-011-en.html#AHM011-3.1"

Fernando
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question