You're in the right track with the negative look behind (?!base) You don't seem to have the space in there though, if your tag is <base href="http://#server_name# you would need to match; (?!base)\shref=http://#server_name# where \s matches a whitespace character
Also, don't forget to escape the dots in your server name (if you're using a properly qualified name) my.domain.com would need to become my\.domain\.com Have you got a regex tester to try out different matches with? there's a good regex tester plugin for eclipse here: http://www.brosinski.com/regex/ Regards Barry On Fri, Oct 15, 2010 at 3:18 PM, Steve Onnis <[email protected]> wrote: > Hi guys > > > > Am at a bit of a loss atm with a regular expression i am trying to get > working. Basically i need to remove the #server_name# from all links but > only if the href is not inside a <base> tag. > > > > This is what i have > > > > REReplaceNoCase(string, ‘(?!base )href="http://#server_name#"', ‘href=””’, > ‘ALL’) > > > > So basically if there IS NOT a “base” before the href then replace the href > with an empty href but it seems to be doing it regardless of if there is a > “base” string before the href. > > > > Any ideas? > > > > Steve > > > > > ======= > Email scanned by PC Tools - No viruses or spyware found. > (Email Guard: 7.0.0.21, Virus/Spyware Database: 6.16080) > http://www.pctools.com > ======= > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/cfaussie?hl=en. > -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
