kekc 1 Posted December 7, 2010 Report Share Posted December 7, 2010 Hi, Could someone explain to me how to use $find_regular_expression.Is it work same way as in perl/php For example I need split 1 variable into two, email and password: set #row test@test.com:password set #email $find_regular_expression ^(.*?):.* set #password $find_regular_expression .*.*?)$ doesn't work Quote Link to post Share on other sites
MiriamMB 63 Posted December 7, 2010 Report Share Posted December 7, 2010 Hi, Could someone explain to me how to use $find_regular_expression.Is it work same way as in perl/php For example I need split 1 variable into two, email and password: set #row test@test.com:password set #email $find_regular_expression ^(.*?):.* set #password $find_regular_expression .*.*?)$ doesn't work You're missing a few bits of information. There are three parameter fields in the Find Regular expression constant. What did you put in for the rest of the needed information? Quote Link to post Share on other sites
kekc 1 Posted December 8, 2010 Author Report Share Posted December 8, 2010 Yeah you right, but it not make difference. set #row test@test.com:password set #email $find_regular_expression $row ^(.*?):.* single set #password $find_regular_expression $row .*.*?)$ single Quote Link to post Share on other sites
DjProg 3 Posted December 8, 2010 Report Share Posted December 8, 2010 Yeah you right, but it not make difference. set #row test@test.com:password set #email $find_regular_expression $row ^(.*?):.* single set #password $find_regular_expression $row .*.*?)$ single To be honest with you I would have used substring to parse this... or actually i would have used the wonderful functions Left() and Right() that I kindly asked Lilly to be implemented, lol Quote Link to post Share on other sites
kekc 1 Posted December 8, 2010 Author Report Share Posted December 8, 2010 To be honest with you I would have used substring to parse this... or actually i would have used the wonderful functions Left() and Right() that I kindly asked Lilly to be implemented, lol In this case I've used $list_from_text with delimiter ":" But anyway, for me more convenient is to use regex. And example above doesn't work. Can someone give me example how to use $find_regular_expression and extract data from variable/text into another variable/list. Thank you. Quote Link to post Share on other sites
bluegoat 24 Posted December 14, 2010 Report Share Posted December 14, 2010 Seth or anyone else, could you please show a simple working example bot using $find_regular_expression. I've tried manytimes, but can't get it to do anything. Thanks,John Quote Link to post Share on other sites
MiriamMB 63 Posted December 14, 2010 Report Share Posted December 14, 2010 Seth or anyone else, could you please show a simple working example bot using $find_regular_expression. I've tried manytimes, but can't get it to do anything. Thanks,John going to post an example soon. Quote Link to post Share on other sites
Gogetta 263 Posted December 14, 2010 Report Share Posted December 14, 2010 going to post an example soon. That would be great. I am also curious on how to use this. Quote Link to post Share on other sites
bluegoat 24 Posted December 14, 2010 Report Share Posted December 14, 2010 going to post an example soon.Having any luck?Anxious to see how this works. Quote Link to post Share on other sites
MiriamMB 63 Posted December 14, 2010 Report Share Posted December 14, 2010 Having any luck?Anxious to see how this works. while playing with the find regex constant, we realized there was a bug within the system(not surprising in the most under used constant in the pile). That probably explains why it seems very difficult to use. So we will be releasing a fix for that sometime this week, and after ward, if you try it, and it still seems confusing, I will post an example on this thread to demonstrate how to use it. Quote Link to post Share on other sites
bluegoat 24 Posted December 14, 2010 Report Share Posted December 14, 2010 while playing with the find regex constant, we realized there was a bug within the system(not surprising in the most under used constant in the pile). That probably explains why it seems very difficult to use. So we will be releasing a fix for that sometime this week, and after ward, if you try it, and it still seems confusing, I will post an example on this thread to demonstrate how to use it.Thanks for looking into this. Quote Link to post Share on other sites
MiriamMB 63 Posted December 16, 2010 Report Share Posted December 16, 2010 Thanks for looking into this. Ok, a fix has been sent out and I have an example ready. You can go ahead and try a few things but I will still post the example Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted December 16, 2010 Report Share Posted December 16, 2010 Ok, a fix has been sent out and I have an example ready. You can go ahead and try a few things but I will still post the exampleHi lily is there any available video tutorial on how to use $regular expression on ubot? I just dont have any idea on how to use it.. THanks Quote Link to post Share on other sites
MiriamMB 63 Posted December 16, 2010 Report Share Posted December 16, 2010 Hi lily is there any available video tutorial on how to use $regular expression on ubot? I just dont have any idea on how to use it.. THanks not yet no, but there will be. Just remember, if you do not know what regular expression is, and you have never used it, it is probably best to brush up on it first before attempting to use it. This constant is for editing scraped, saved information. Here is a small example: I am trying to find out of the sentence "I must say I am Happy" The phrase "I am Happy" My coding is probably way more complicated than it needs to be, but it finds what I am looking for without issue. I\s(a|b)m*\s[A-Z]a*p{2}y So the phrase I wanted starts with the letter I, so this outputs= I \s means there is a space after the I, so this outputs= I (with a space after it) (a|b ) means the next item I am looking for starts with either a or b, so now we have= I a m* means zero or more of that letter, so now we have= I am \s for another space [H-J] means the next item in line should be a capital letter, and is between the letters H-J, so now we are at= I am H a* means zero or more of the letter a, so now we have = I am Ha p{2} means we are looking for two p's that are next in line. So now we have= I am Happ y means that the phrase ends with a y, so finally we're at= I am Happy The video tutorial will include how to trim to isolate and save urls and how to isolate phone numbers. This is just a really simple example to hopefully get you started. Quote Link to post Share on other sites
Sulliman 0 Posted February 12, 2011 Report Share Posted February 12, 2011 Hi I have some experience of using regular expressions (only in PHP).I want to use the case-insensitive modifier "i" - example: /my\sregex/i format in ubot for some reason.How do I do it?Thanks in advance... 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.