Solved

regular expression in explorer 6 and 7

Posted on 2006-11-22
2
151 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
  • 2
2 Comments
 
LVL 62

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 62

Accepted Solution

by:
Fernando Soto earned 500 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now