karliky 0 Report post Posted May 12, 2009 Here is the code: #include <array.au3> $array = StringRegExp('sedfsdfsdsdfs wefweffwef wefwewef sfsdfsdfsdf sdfsdfsd@gmail.com wefrwerfwefew wefwefwefwef wefwefwefwef', '[a-z]@gmail.com', 1) _ArrayDisplay($array) I'm trying to extrac all *@gmail.com mails from the text. But the result from the code always is: d@gmail.com and not sdfsdfsd@gmail.com Help and thank you Share this post Link to post Share on other sites
SmOke_N 199 Report post Posted May 12, 2009 (edited) Here is the code: #include <array.au3> $array = StringRegExp('sedfsdfsdsdfs wefweffwef wefwewef sfsdfsdfsdf sdfsdfsd@gmail.com wefrwerfwefew wefwefwefwef wefwefwefwef', '[a-z]@gmail.com', 1) _ArrayDisplay($array) I'm trying to extrac all *@gmail.com mails from the text. But the result from the code always is: d@gmail.com and not sdfsdfsd@gmail.com Help and thank youYou're only telling it to get 1 [a-z]. Don't forget that emails can have other types of characters as well. #include <array.au3> Local $s_str = "sedfsdfsdsdfs wefweffwef wefwewef sfsdfsdfsdf sdfsdfsd@gmail.com wefrwerfwefew wefwefwefwef wefwefwefwef" Local $s_pattern = "((?i:[A-Z0-9\._%+-]+@gmail\.com))" Local $a_sre = StringRegExp($s_str, $s_pattern, 3) _ArrayDisplay($a_sre) Edited May 12, 2009 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
weaponx 10 Report post Posted May 12, 2009 Put a + after ] Share this post Link to post Share on other sites