taufiqkyu 0 Posted November 10, 2019 Report Share Posted November 10, 2019 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") Quote Link to post Share on other sites
pash 504 Posted November 10, 2019 Report Share Posted November 10, 2019 try \d{1,20}$ Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted November 10, 2019 Report Share Posted November 10, 2019 Just to add to the above. Need to make sure the Regex is a .Net flavour, there are variances. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted November 12, 2019 Report Share Posted November 12, 2019 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 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.