Jump to content

RegExp Help


BrettF
 Share

Recommended Posts

Ok... I'm doing some stuff with webpages, and I want to change the souce, so I need to change links and stuff. Like so:

<a href="index.htm">Index</a>

to

<a href="http://www.somesite.com/index.htm">Index</a>

If that makes sense... I'm pretty sure it can be done with RegExp, but how, I am completely clueless... Is there any chance that someone could get me started with the RegExp?

Link to comment
Share on other sites

Hi,

???

Global $str = '<a href="index.htm">Index</a>'
MsgBox(0, $str, StringRegExpReplace($str, '(?<=<a href=").*?(?=index.htm">Index</a>)', 'http://www.somesite.com/'))

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Thanks heaps! I really should learn this stuff hey... :)

HI,

no problem. If you got questions, I could teach you all I know.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

no problem. If you got questions, I could teach you all I know.

So long,

Mega

Ok. But I will ask them another day. Got to sleep now, so I can be refreshed for work tommorow... And then the days after...
Link to comment
Share on other sites

Ok. But I will ask them another day. Got to sleep now, so I can be refreshed for work tommorow... And then the days after...

HI,

okay. Haha, it is 12:48 in Germany so there a minimum 12 hours left for me going to sleep.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

???

Global $str = '<a href="index.htm">Index</a>'
MsgBox(0, $str, StringRegExpReplace($str, '(?<=<a href=").*?(?=index.htm">Index</a>)', 'http://www.somesite.com/'))

So long,

Mega

Excellent example! You have slightly diminished the weakness of my RegExp Fu, in the area of Lookahead and Lookbehind Assertions.

Thanks.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi,

LOL I don't think you got a problem there.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...