Jump to content
UBot Underground

Regex And Curly Braces Issue


Recommended Posts

Hi,

How do I keep curly braces in Ubot when writing a regex?

 

it's \d{3}\r\n\W but when I click OK, ubot removes curly braces and it becomes \d3\r\n\W

 

Quoting the regex generates "\d\{3\}(?=\r\n\W)" which doesn't work.

 

Read & tried these already, none works:





 

Regex is correct because in Ubot's Regex Editor it selects the desired numbers.

The solutions like adding a number and comma to the curly braces don't work.

 

Sample text (the regex is supposed to get the number 542):

 



Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

542

It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


Thanks

Edited by Marani
Link to post
Share on other sites

 

Hi,
How do I keep curly braces in Ubot when writing a regex?
 
it's \d{3}\r\n\W but when I click OK, ubot removes curly braces and it becomes \d3\r\n\W
 
Quoting the regex generates "\d\{3\}(?=\r\n\W)" which doesn't work.

 

Check this regexp:

\\d\{3\}[\\n\\r]*\\W

Example:

 

alert($find regular expression("123{$new line}+","\\d\{3\}[\\n\\r]*\\W"))

 

where "123{$new line}+" - your text.

 

If you need this code:

 

\d\{3\}(?=\r\n\W)

 

Correct code for ubot:

 

\\d\{3\}(?=\\r\\n\\W)

 

If this code not will work for you, i think, you need use $eval and javascript.

Edited by Misha
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...