-
July 28th, 2020, 22:44 #11
Glad I mostly figured the right Regex out. I haven’t done much with them. Was looking at the lua book for format and saw the comment about not being able to apply modifiers to non char sets. But implied there were “advanced techniques” further on (which I did not detect/see/understand)
I’ll try your thing Damned! If it doesn’t do what I need, I will do it in two parts
Thanks so much for the helping hand
-
July 28th, 2020, 23:10 #12
the one i posted above works fine in my testing
string.match(foo, "(%d+)[dD](%d+)(.*)")
-
July 28th, 2020, 23:58 #13
-
July 29th, 2020, 02:17 #14
And I can verify that Damed's version does the job for me. I appreciate it.
I am going to use that one, however the failing it has is that it does not "validate" the last segment. 2d6+Fred would parse as would 2d6ILikePez with (my guess) "+Fred" and "ILikePez" for the "mod" section.
I am fine with throwing an error in this case for now. Later I may get jiggier with it.
-
July 29th, 2020, 02:22 #15
Thats true - but neither is there any validation on the 2d6 part...
I usually run the validation in an earlier line and spit out a warning if its invalid
-
July 29th, 2020, 03:03 #16
Hmmm ... seems like missed something brb..
Last edited by Varsuuk; July 29th, 2020 at 03:13.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks