Jump to content

String


will88
 Share

Recommended Posts

Which string function do I use to do this?

$IE = _IECreate($url,0,1,1)
$Text = _IEBodyReadHTML($IE)

href="/phpfile?s=randomletters"

I want to get the letters where it says randomletters and the randomletters won't always be the same length, but the randomletters always end with " at the end.

I've tried a bunch of string functions, but I can't seem to find one that works.

Edited by will88
Link to comment
Share on other sites

Stupid question, forgive me if it make no sense... Does the "/phpfile?s=" part remain the same?

yeah "href="/phpfile?s=" will always be the same

Also im reading from an html page, so I can't use StringMid() as far as I know, because href="/phpfile?s=randomletters" isn't the only thing on the page, it may be on a differen't line sometimes or different positon on the lines

Edited by will88
Link to comment
Share on other sites

I didn't bother to check some combination like alphanumeric random key or it's always numeric ?

Opt('MustDeclareVars', 1)

Dim $sText, $sPattern = '[0-9]*'

$sText = '<>,o,o<><,,href.,,,.,0^^"/phpfile?s=123123" a'

Dim $pos = StringInStr($sText, '"/phpfile?s=')
Dim $sRand = StringRegExp($sText, $sPattern, 1, $pos+StringLen('"/phpfile?s='))

MsgBox(0x10, 'title', $sRand[0])
Link to comment
Share on other sites

I didn't bother to check some combination like alphanumeric random key or it's always numeric ?

Opt('MustDeclareVars', 1)

Dim $sText, $sPattern = '[0-9]*'

$sText = '<>,o,o<><,,href.,,,.,0^^"/phpfile?s=123123" a'

Dim $pos = StringInStr($sText, '"/phpfile?s=')
Dim $sRand = StringRegExp($sText, $sPattern, 1, $pos+StringLen('"/phpfile?s='))

MsgBox(0x10, 'title', $sRand[0])
sorry letters not numbers, ill try editing that and seeing if I can get it to work

Thanks

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