Jump to content
UBot Underground

Problem On Regex. Works On Editpad But Failed On Ubot


Recommended Posts

Hi, i want to scrape text which have length 20 characters. i use editpad and it works perfectly the regex code. but if i use it it on ubot, it always error or nothing item scrapped s it shows nothing. 

set(#scrape pin,"445434219393205687
558587160034686664
754775218784510962
303500462390250257
853080354401358008345565465464
330029478945439979
381680137172436924
763571311802063541
413346072052565131
806425877009023435asdfdsfsd
163396292718663893
717127940645876651
539376492864104338
604889793685992641
562316703473757198
50243352079460572","Global")
set(#scrape pin,$find regular expression(#scrape pin,"^\\d\{1,20\}$"),"Global")
Link to post
Share on other sites

Regex is fine, the reason its not working here is because of the ^ and $ - which are fine actually but keep reading.

 

It's trying to match the start and end of the string. You want it to match the start and end of each line. To do that you need to add a flag: (?m)

 

So try this:

(?m)^\d{1,20}$

"or the m inline option, enables the regular expression engine to handle an input string that consists of multiple lines. It changes the interpretation of the ^ and $ language elements so that they match the beginning and end of a line, instead of the beginning and end of the input string."

 

https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-options#multiline-mode

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