DICE PACKS BUNDLE
Page 2 of 2 First 12
  1. #11
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    Quote Originally Posted by celestian View Post
    Your best bet is to have 2 checks, one with 1d6 and 1d6+3. In actual regex you could do something like "^(%d+)[dD](%d+)([%+%-]%d+)?$" and it would match 1d6 and 1d6+3 but Lua doesn't seem to support ()?.
    So using "^(%d+)[dD](%d+)([%+%-]%d+)?$" and "^(%d+)[dD](%d+)$" would catch both.

    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

  2. #12

  3. #13
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,674
    Blog Entries
    1
    Quote Originally Posted by Varsuuk View Post
    Cool guys gonna check these out later tonight when things settle. Been on road most of day between appointment for son’s ambulatory surgery setup for Thurs And my OT (frozen shoulder) (he is “ok”, he had a bike accident where his nose was fractured in several places and twisted a bit. - they need to put him out to do the... adjustments) Tomorrow is covid test pre procedure and I gotta fit in my day job in between all this. Good thing I sleep little ...
    Good luck with all the medical drama!
    My wife's frozen shoulder is hopefully almost better - after more than 18 months.

  4. #14
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    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.

  5. #15
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,674
    Blog Entries
    1
    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

  6. #16
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in