Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

regular expression in explorer 6 and 7

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);


Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial