Results 1 to 4 of 4

Thread: [2005] URGENT help with RegEx..

  1. #1

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Unhappy [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

  2. #2
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    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.
    §tudz

    Studzworld.com - Portfolio

  3. #3
    Hyperactive Member kayos's Avatar
    Join Date
    Apr 2004
    Location
    Largo, Florida
    Posts
    306

    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

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width