Joshua
Fri Jul 22 12:11:48 CDT 2005
Awesome thanks!
"Steve Fulton" <cerberus40@geemail.com> wrote in message
news:op.st9jfzn6i0ix9l@steve...
> Joshua C. Clark wrote:
>
> > How can I use replace to replace a dynamic string that is sent over to
my
> > broswer using a wildcard?
> >
> > Here is a snip of my code,
> >
> > extract = Replace(extract, "href", "")
> >
> > for example here is what the browser sees,
> >
> >
href="javascript:show('1','
http://server/page.asp=FDR2dmwjDE%3Byt2q%26FDT7w%
> > 7Cq612d4
> >
> > but I want it to look like
> >
> > " " instead
> >
> > after the 'href' is a long string that is dynamically changed each time
the
> > page is viewed, how can I use Replace to remove anything following the
> > 'href' but nothing below that line of code?
>
> Any time you want to search for a pattern in a string (e.g. use a
> wildcard), use a regular expression.
>
> Here's an example of my find-an-HTML-attribute pattern:
>
> With New RegExp
> .Pattern = "href=(?:([""'])[\s\S]*?\1|[^\s>]*)"
> .IgnoreCase = True
> .Global = True
> newString = .Replace(oldString, "")
> End With
>
> "Introduction to Regular Expressions"
>
http://msdn.microsoft.com/library/en-us/script56/html/reconintroductiontoregularexpressions.asp
>
> "Regular Expression Object Properties and Methods"
>
http://msdn.microsoft.com/library/en-us/script56/html/vtoriregularexpressionsobjectpropmeth.asp
>
> --
> Steve
>
> Patriotism is the willingness to kill and be killed for trivial reasons.
> -Bertrand Russell