inwmsn Posted April 1, 2008 Share Posted April 1, 2008 Hi All, I couldn't figure out why StringRegExp function returm fail if the expression is including "(someword)" here is my code#include <IE.au3>$oIE = _IEAttach ("My Video")$Text = _IEBodyReadText ($oIE)If StringRegExp ($Text, "This is my (dog)") Then ;;;;===> It's fail when I use "(dog)" MsgBox (0,"","FOUND")ElseMsgBox (0,"","NOT FOUND")EndIfI got "NOT FOUND" but if I take "(dog)" out it FOUND like this $oIE = _IEAttach ("My Video")$Text = _IEBodyReadText ($oIE)If StringRegExp ($Text, "This is my") Then ;;;;===> It's work when I take "(dog)" outMsgBox (0,"","FOUND")ElseMsgBox (0,"","NOT FOUND")EndIfCan somebody helping me. Thanks Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 1, 2008 Share Posted April 1, 2008 Hi, what about escaping the ( and ) with this \( and \) 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 More sharing options...
inwmsn Posted April 1, 2008 Author Share Posted April 1, 2008 It's work!!!!! Thank you!! Xenobiologist ^^ Link to comment Share on other sites More sharing options...
inwmsn Posted April 1, 2008 Author Share Posted April 1, 2008 Hi Xenobiologist. Anyway it come up another problem when change the code like this Dim $Array [3] = ["cat", "\(dog\)", "hourse") For $i = 0 To UBound ($Array) -1 $oIE = _IEAttach ("My Video") $Text = _IEBodyReadText ($oIE) If StringRegExp ($Text, $Array [$i]);;;; ====> It work just fine. _IELinkClickByText ($oIE, $Array [$i]);;;;===> But It won't click on the second element of array Else MsgBox (0,"","NOT FOUND") EndIf Please help again. Thanks Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 1, 2008 Share Posted April 1, 2008 Hi, why not changing StringRegExp to StringInStr ? 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 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