Solved

regular expression in explorer 6 and 7

Posted on 2006-11-22
2
156 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 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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