luis carlos 94 Posted October 23, 2013 Report Share Posted October 23, 2013 Hi there, anyone could help me with this code? thks comment("Need this phone numbers in a list:")load html("<p class=\"abac0\">(005) 376-6780</p><p class=\"abcs2\">(005) 376-6781</p><p class=\"afbc4\">(005) 376-6782</p><p class=\"abgc5\">(005) 376-6783</p><p class=\"abhc6\">(005) 376-6784</p><p class=\"abcj8\">(005) 376-6785</p>")comment("I tried using these 2 regex codes, but they dont work")add list to list(%phone0, $find regular expression($scrape attribute($element offset(<tagname="body">, 0), "innertext"), "\\([0-9]3\\)[-. ]?[0-9]3[-. ]?[0-9]4\\b"), "Delete", "Global")add list to list(%phone1, $find regular expression($scrape attribute($element offset(<tagname="body">, 0), "innertext"), "\\(\\d*\\) \\d*-\\d{4}"), "Delete", "Global") Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 23, 2013 Report Share Posted October 23, 2013 Can you say more about it? What exactly are you trying to scrape or will it show up exactly like this? It matters a lot in regex so knowing where it came from and what it is helps a lot. Are you really going to be getting them from a load html? Quote Link to post Share on other sites
luis carlos 94 Posted October 23, 2013 Author Report Share Posted October 23, 2013 Nope, I am getting it from a website. The problem is even though the regex code woks (I checked on regex hero and Edit Pad Pro), after running the script the list is empty. Thanks for yuor help. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 23, 2013 Report Share Posted October 23, 2013 Nope, I am getting it from a website. The problem is even though the regex code woks (I checked on regex hero and Edit Pad Pro), after running the script the list is empty. Thanks for yuor help. Okay, it's not Ubot friendly regex though (not your fault) - try this - not in code view though, just in the regex box. \(\d{3,3}\)\s\d{3,3}\-\d{4,4} 1 Quote Link to post Share on other sites
luis carlos 94 Posted October 23, 2013 Author Report Share Posted October 23, 2013 Okay, it's not Ubot friendly regex though (not your fault) - try this - not in code view though, just in the regex box. \(\d{3,3}\)\s\d{3,3}\-\d{4,4}You did it. Thank you so much. But my last question is, what is "ubot friendly"? I just learning about regex, so everything is new for me. Thanks again. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 23, 2013 Report Share Posted October 23, 2013 You did it. Thank you so much. But my last question is, what is "ubot friendly"? I just learning about regex, so everything is new for me. Thanks again. Glad to hear it! Well, that's a tough question to answer. But you did trip upon one of the most important issues which is that using {3} would not work so you have to use {3,3} which will work in any other regex tester but so would the original {3} whereas that would not work in Ubot. 1 Quote Link to post Share on other sites
luis carlos 94 Posted October 23, 2013 Author Report Share Posted October 23, 2013 Glad to hear it! Well, that's a tough question to answer. But you did trip upon one of the most important issues which is that using {3} would not work so you have to use {3,3} which will work in any other regex tester but so would the original {3} whereas that would not work in Ubot.Got it. 1000s Thanks. =) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.