Jump to content

Cut string :(


Recommended Posts

Hello, I need to cut this string to just have "test@test.com" ( email could be variable ) :

"i'+'lto:'+qxs+plb+jab+szu+giq+att+'">'+'test@test.com'+'</a>');

</blabla><test> <b>testtest</b></test></td>"

So i need to have email between '+'

Another string cut... I would like to cut this string :

"blablablabla TEstSambalec" or

"bliblibliblibli TEstSambalec" or

"tadadadaa TEstSambalec"

I need to have "Sambalec" :D

Thanks a lot !

Link to comment
Share on other sites

Oh, you mean - extracting it.

Look at the String* functions.

For example:

Dim $sMail = 'toto@hotmail.com'
Dim $sVar ="i'+'lto:'+qxs+plb+jab+szu+giq+att+'"">'+'test@test.com'+'</a>');"& _
                  "</blabla><test> <b>testtest</b></test></td>"

$sVar = StringRegExpReplace($sVar, '+', $sMail)
ConsoleWrite($sVar & @LF)

Or you mean something different?

Edit: Pff...

Edited by Authenticity
Link to comment
Share on other sites

Hello, I need to cut this string to just have "test@test.com" ( email could be variable ) :

"i'+'lto:'+qxs+plb+jab+szu+giq+att+'">'+'test@test.com'+'</a>');

</blabla><test> <b>testtest</b></test></td>"

So i need to have email between '+'

Another string cut... I would like to cut this string :

"blablablabla TEstSambalec" or

"bliblibliblibli TEstSambalec" or

"tadadadaa TEstSambalec"

I need to have "Sambalec" :D

Thanks a lot !

Never fear! StringRegEx() is here!
#include <Array.au3>

Global $sString = "i'+'lto:'+qxs+plb+jab+szu+giq+att+'"">'+'test@test.com'+'</a>');" & @CRLF & _
        "</blabla><test> <b>testtest</b></test></td>"
Global $avRET = StringRegExp($sString, "(?:>\'\+\')(.+)(?:\'\+\'<)", 3)
_ArrayDisplay($avRET, "$avRET")


$sString = "blablablabla TEstSambalec" & @CRLF & _
        "bliblibliblibli TEstSambalec" & @CRLF & _
        "tadadadaa TEstSambalec"
$avRET = StringRegExp($sString, "(?:.+\sTEst)(\w+)", 3)
_ArrayDisplay($avRET, "$avRET")

:o

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

#include <string.au3>
$source="""i'+'lto:'+qxs+plb+jab+szu+giq+att+'"">'+'test@test.com'+'</a>');</blabla><test> <b>testtest</b></test></td>"""
$array=_StringBetween($source,">'+'","'+'<")
MsgBox(0, 'E-Mail is',$array[0] )

Edit: just a second too late. :D

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

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