Jump to content
Sign in to follow this  
BrettF

RegExp Help

Recommended Posts

BrettF

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?

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
BrettF
Xenobiologist

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

Share this post


Link to post
Share on other sites
BrettF

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

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.