Regex syntax makes my head spin so I recently removed all but the most basic of usage from my own framework (link in sig below). I also don't like those bizarre dialogs strFind pops up if it doesn't find a matched group. Although my framework is written for 4e, you can use my Get Field macro for any stream of text:

Of course, to use the FM option you will also need my Filter Metacharacters macro which gets rid of any weird non-printable (and just plain unwanted) text. If you are using 4e I suggest, downloading the MPB and looking at the Import macros near the bottom of the Lib token. These show how Get Field is called. However, to address your specific question let's look at the Adult Red Dragon from pg 8 of the 5e DMG.

To get the creature's Skills, you would assign the text to the variable "StatBlock" and use:

This returns "Perception +13, Stealth +6" as expected. This assumes the following field will always be "Damage Immunities" … which it might not. To guard against this possibility, list another field that comes after Skills for sure:

This way, even if "Damage Immunities" isn't present, Get Field knows to stop gathering text at "Senses" which all monsters have. Hey, I never said it was elegant … but it does work well enough for those of us with tiny brains incapable of wrapping around regex concepts. Yes, I know enough about them to use the matches function in a rudimentary way but Get Field does everything I need it to without those silly dialogs mentioned earlier.

Again, my Import macros showcase all the different parameters that can be used so it's best to examine those. Hopefully you will be able to see how the StopAtColon, WordNum and StartAtEnd parameters are used. To actually see my importer in action without downloading the MPB, go to my videos page.

To prevent that strange regex related pop-up you can use Wiki: getFindCount(), this will return the number of matches, which can also be 0 in which case you should not try to retrieve getGroup (which renders those popups).

Thanks for the tip, Wolph! However, the regex stuff still confuses me even after going through the basic tutorials. I know "[A-Z]" means "match any capital letter" and you can therefore match capitalized words with "[A-Z][a-z].*" but anything more complicated than that is beyond me.

Has anyone gotten any further with a 5E statblock importer? I've been learning a lot just trying to figure out the code of other "Statblock Importers" and its helped immensely in other areas of my coding but I find this is just way over my head. My fingers are starting to bleed coding all these Monsters by hand!

I prefer pasting statblock into GM Text for two reason. 1. I preserve the statblock for reference or to rerun later 2. It preserves line breaks (vs pasting into an input box that does not) and makes some regexp easier (ie you can use ^ beginning of line and some regexp become easier)

If you can master the "Look ahead" and "Look behind", you can really get specific easier grabbing stuff. The hardest are damage blocks because SO much can be define there (like plus poison or touch or a lot of stuff other than xdx+x)

If you get stuck on a particular block, post the statblock and ask, if I (or others) have time we may be able to post at least the regexp that will work.

Take it in little chunks. Get one skill or stats, or hp, go for what you would need more often and leave complicated ie damage blocks) for last. If you can get AC/HP/Init, that will usually help at least to start.

If you can master the "Look ahead" and "Look behind", you can really get specific easier grabbing stuff. The hardest are damage blocks because SO much can be define there (like plus poison or touch or a lot of stuff other than xdx+x)

I used to use those a LOT and then I learned to use the Wiki: getGroup ()function properly and I've never used them since.... Its one of the reasons I heavily update that wiki article.

ive attached my smaller (and most recent created) regex parser for space ships in rogue trader with an example text, have a look.

its missing a couple of macros like listCleaner, findSimilar and , correctLearned. The first cleans up lists, the second, findSimilar, is one of the more cooler functions as e.g. if the parser can't find "Besterd Sword" in the Database, it will go through all the weapons in the database and shows the ones that look similar (like 'Bastard Sword'), this you can pick from a resulting list and it will substitute this. Optionally can 'learn' this substitution which than will be used in 'correctLearned', which is executed at the start of the parser. I can provide these functions as well if you want to have a look.

The big one for this release is the inclusion of 5e monster conversion. I did this just because I had some extra time over the past few days and decided to give it a shot. Just copy a monster from http://media.wizards.com/2014/downloads ... sv.0.3.pdf up to but not including the description block(s) at the end and paste into F4 as always. Yes, some concepts aren't compatible between the two versions but you can adjust as needed. This importer branch isn't perfect and just meant for experimental purposes. This has been done for those wishing to use v5 monsters for which there is no v4 equivalent. I have no plans for further 5e development as my group only plays 4e.

Enjoy ...

The imperfection I reference encompasses omissions such as the ignorance of the "Skills" line. I also don't know how resistances and vulnerabilities work in 5e so I ignore that stuff too but damage type immunities should work. Those interested are welcome to go to http://209.90.88.139/~macropolicebox , sign up for an account (bottom left) and download the code. Just follow the "How to import monsters" video (just above the "Running Encounters" section) on this page and you should be fine. Yes, I demo a 4e skeleton there but the process is the same.

Keep in mind this isn't just a 5e monster importer. The creature will be converted to 4e on-the-fly. Yes, I am well aware that isn't what you all want. You want a 5e monster to use in a 5e framework. As I explained earlier, my group has no interest in 5e as we don't see the appeal. I wrote this just in case we see an interesting 5e monster we want to use in our games. By all means adjust the Parse 5e Monster Stats macro you see on my library token for your own purposes. You can even copy/paste the player token into your 5e campaign file as long as your property names are compatible with mine. If not, just use getProperty() to extract mine into yours.

[H: status=input("junk|Statblock info from Creature Name through Treasure line of Ecology (if it exists). Don't include flavor text/background/descriptions.||LABEL|SPAN=TRUE","junk|If Ecology section comes before Special Abilities, be sure to include Special Abilities section as well. Still no flavor text.||LABEL|SPAN=TRUE","statblock|Insert 5E statblock here|Enter statblock|TEXT|WIDTH=40")][H: abort(if(status < 1, 0, 1))]

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum