sambalec Posted April 3, 2009 Share Posted April 3, 2009 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" Thanks a lot ! Link to comment Share on other sites More sharing options...
Authenticity Posted April 3, 2009 Share Posted April 3, 2009 You mean to copy it to the clipboard or to cut it from the control? Link to comment Share on other sites More sharing options...
sambalec Posted April 3, 2009 Author Share Posted April 3, 2009 Yes string in variable Link to comment Share on other sites More sharing options...
Authenticity Posted April 3, 2009 Share Posted April 3, 2009 (edited) 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 April 3, 2009 by Authenticity Link to comment Share on other sites More sharing options...
sambalec Posted April 3, 2009 Author Share Posted April 3, 2009 No to remplace this email, but to take email between '+' Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 3, 2009 Share Posted April 3, 2009 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" 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") 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 More sharing options...
Authenticity Posted April 3, 2009 Share Posted April 3, 2009 #include <String.au3> Dim $sMail = '' Dim $sVar ="i'+'lto:'+qxs+plb+jab+szu+giq+att+'"">'+'test@test.com'+'</a>');"& _ "</blabla><test> <b>testtest</b></test></td>" $sMail = _StringBetween($sVar, ">'+'", "'+'<") If IsArray($sMail) Then $sMail = $sMail[0] ConsoleWrite($sMail & @LF) Link to comment Share on other sites More sharing options...
Exit Posted April 3, 2009 Share Posted April 3, 2009 (edited) #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. Edited April 3, 2009 by forumer100 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Authenticity Posted April 3, 2009 Share Posted April 3, 2009 lol, I see I'm in a good company. ;] Link to comment Share on other sites More sharing options...
sambalec Posted April 3, 2009 Author Share Posted April 3, 2009 Many thank's ! All is good. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now