I’m trying to make a regular expression that will find a character that I specify and then return all numbers after it, but stop before the next letter. Right now i’m using,
self.DNA = “A99B26C101D2E89” --Example String
traitValue = string.gmatch(string.gmatch(self.DNA, trait … “%d*”)(), “%d”)
– Returns 9 for A and 2 for B etc
– Needs to return 99 for A 26 for B, 101 for C, etc
and it returns one number, but i need all numbers till the next letter, I’ve tried adding a * to the second expression, I’m using 2 expressions because I just want the number for my next function. I’m pretty sure someone who understand this better could do it in one, but that’s not me. Any help is appreciated, thanks in advance.