Jump to content
UBot Underground

Recommended Posts

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

Link to post
Share on other sites

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?

pic.jpg

Link to post
Share on other sites

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 :P

Link to post
Share on other sites

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 :P

 

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.

Link to post
Share on other sites

Seth or anyone else, could you please show a simple working

example bot using $find_regular_expression. I've tried many

times, but can't get it to do anything.

 

Thanks,

John

 

 

 

going to post an example soon.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

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

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 1 month later...

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...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...