|
-
Mar 26th, 2007, 04:01 AM
#1
Thread Starter
Hyperactive Member
[2005] URGENT help with RegEx..
Hi all, I want to detect <a href..></a> tag using regex and replace it's href value with specific value..
like
<a href="a.aspx" >a.aspx</a>
to
<a href="http://xyz/a.aspx" >a.aspx</a>
I don't know how to use regex and it's urgent.
Normal testing conditon for heperlink are like
Code:
<a href=a.aspx> ' Without Double Quotes
<a href= a.aspx> 'Space after =
<a href="a.aspx"> ' Normal
<a
href="
a.aspx"> 'New line
IT'S REALLY URGENT plz help me guys.
I am using .NET 2010 with Windows 7
-
Mar 26th, 2007, 04:32 AM
#2
Hyperactive Member
Re: [2005] URGENT help with RegEx..
I dont know what regex is but I'm sure if you pur runat="server" you should be able to edit the control via server-side code.
-
Mar 26th, 2007, 12:38 PM
#3
Hyperactive Member
Re: [2005] URGENT help with RegEx..
I agree with Studz, a simple runat="server" property in those links would make them editable server side.
On the other hand I would probably just use the <asp:HyperLink> control myself.
If this post helps, please RATE MY POST!
Using Visual Studio 2005 SE
-
Mar 27th, 2007, 08:21 AM
#4
Re: [2005] URGENT help with RegEx..
If you are attempting to read your own page, then you shouldn't even be attempting a search like this. You could have looped through your control collection on the page, or added a runat="server".
If you are attempting to read some other page, then you'd of course use a regular expression. Here's a start
Code:
<a.+href=\"(.+?)\">
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|