usauae Posted January 31, 2023 Report Posted January 31, 2023 I have a list of strings that are always 4 characters {'a001', 'aa01', 'aaa1', 'aaaa' } I need to select only the ones that are alph num num num ex: 'a001' any ideas ? Quote
Popular Post MiryalgudaMaruthiRao Posted January 31, 2023 Popular Post Report Posted January 31, 2023 did u check in chatgpt 4 Quote
Barbarik Posted January 31, 2023 Report Posted January 31, 2023 use regex match pattern... Regex - ^a\d{3}$ you can test this pattern here - https://regex101.com/ 1 Quote
uoY Posted January 31, 2023 Report Posted January 31, 2023 Really bro? Language? 100 of libraries vuntayi already in ur project Quote
krishnaaa Posted January 31, 2023 Report Posted January 31, 2023 9 minutes ago, usauae said: I have a list of strings that are always 4 characters {'a001', 'aa01', 'aaa1', 'aaaa' } I need to select only the ones that are alph num num num ex: 'a001' any ideas ? You can ask chatGPT Quote
Barbarik Posted January 31, 2023 Report Posted January 31, 2023 if you want to match with both small/cap "a"... then use this regex - ^[Aa]\d{3}$ Quote
MiryalgudaMaruthiRao Posted January 31, 2023 Report Posted January 31, 2023 @dasari4kntr uncle springboot start cheddam anukuntunna I have some projects in mind as well ela ekkada start cheyyali Quote
MiryalgudaMaruthiRao Posted January 31, 2023 Report Posted January 31, 2023 Just now, krishnaaa said: You can ask chatGPT repost Quote
ramudu Posted January 31, 2023 Report Posted January 31, 2023 try this regex - ^[a-z]{1}[0-9]{3}$ (any a to z 1 char and followed by 3 numbers) all you need to do is , loop through your words and apply this regex on your string , if it matches return that or add to your results list Quote
dasari4kntr Posted January 31, 2023 Report Posted January 31, 2023 Just now, MiryalgudaMaruthiRao said: @dasari4kntr uncle springboot start cheddam anukuntunna I have some projects in mind as well ela ekkada start cheyyali first intellij community edition download chesuko... next have this spring initilizer for boiler plate... https://start.spring.io/ try to create simple api...many youtube videos are ther...follow them... Quote
MiryalgudaMaruthiRao Posted January 31, 2023 Report Posted January 31, 2023 2 minutes ago, dasari4kntr said: first intellij community edition download chesuko... idi done next have this spring initilizer for boiler plate... https://start.spring.io/ try to create simple api...many youtube videos are ther...follow them... Quote
MiryalgudaMaruthiRao Posted January 31, 2023 Report Posted January 31, 2023 step 2 deniki uncle Quote
dasari4kntr Posted January 31, 2023 Report Posted January 31, 2023 2 minutes ago, MiryalgudaMaruthiRao said: step 2 deniki uncle boiler plate...it will generate strucuture for your spring boot project...contains pom.xml and main method...etc Quote
usauae Posted January 31, 2023 Author Report Posted January 31, 2023 16 minutes ago, Saloly said: Regex try chesava aa regex chala chiraku ga vuntundi bro, regex logic kosam ye asking Quote
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.