daverawcus 6 Posted September 6, 2018 Report Share Posted September 6, 2018 Hi guys I am trying to grab just the weekday in this case Thursday for C:\\Users\Rawcus\Desktop\couldbeanythingtext_1234-Thursday-1537.png It will always have a - in front and behind ie -Thursday- It will always have a file path as well and some text before containing possibly numbers and an underscore can anyone help Thanks in advance Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 6, 2018 Report Share Posted September 6, 2018 Try this: (?<=[a-zA-Z0-9_]-)[a-zA-Z]+(?=-) Quote Link to post Share on other sites
Sanjeev 46 Posted September 6, 2018 Report Share Posted September 6, 2018 also this - (?<=-)[^-]+(?=-) Quote Link to post Share on other sites
johnwalton 12 Posted September 7, 2018 Report Share Posted September 7, 2018 this regex builder might be helpful to you in future:http://imautobots.com/downloads/regex-builder/ 2 Quote Link to post Share on other sites
daverawcus 6 Posted September 7, 2018 Author Report Share Posted September 7, 2018 Thanks guys thats helped lots am stuck on getting the first 2 digits from a 4 digit number ie 1359 I want 13 I can grab all the number just not the first 2, I know I need a {2} to grab only 2 I just can't do it! (^\d+) Quote Link to post Share on other sites
Sanjeev 46 Posted September 7, 2018 Report Share Posted September 7, 2018 Well you haven't mentioned anything else about the line the digits are on..are you saying this doesn't work? I need a {2} to grab only 2 I just can't do it! alert($find regular expression(1359,"^(\\d\{2,2\})")) https://cl.ly/e32f2db9c812 alert($find regular expression(1359,"^\\d\\d")) https://cl.ly/d6e22baa6034 this works too! or alert($find regular expression(1359,"^[0-9][0-9]")) Again , like I said we need to know the placement of the digits in a line - if this doesn't work. 1 Quote Link to post Share on other sites
Sanjeev 46 Posted September 7, 2018 Report Share Posted September 7, 2018 Or maybe you want to capture the digits into a named group? Quote Link to post Share on other sites
daverawcus 6 Posted September 7, 2018 Author Report Share Posted September 7, 2018 there are on their own line That works perfect in UBot thanks alot but not in Note++ which is odd Quote Link to post Share on other sites
Sanjeev 46 Posted September 7, 2018 Report Share Posted September 7, 2018 there is a bug in Ubot -where \d{2} doesn't work.. have to use this form -- \d{2,2} https://cl.ly/47e6a1ba0134 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.