[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.
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.
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.
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=\"(.+?)\">