Usefull REGular EXPressions

Started by Darker, January 06, 2014, 02:51:25 PM

Previous topic - Next topic

Darker

Not sure if I'm not the only one, so here I'm asking:

Do you have any usefull regular expressuins to change things on map quickly?
An example:

<Thing Class="Filth">([\S\s]*?)</Thing>
Matches (and replaces) all the filth - replacing with nothing will clear the map...

<Level_([A-Z][a-z]+)>\s*([0-9]+)\s*</Level_[A-Z][a-z]+>
Matches all level stats. Replace with <Level_$1>19</Level_$1> to get level 19 to everything.





For those who have no idea what's going on: Regular Expressions are rules to match a text. Many of you may know how to use * wildcard. RegExps are a little bit more complicated than that and allow to match absolutelly anything provided you're smart enough.
I'm not aware of any online tool that performs regular expressions on a text file. I can do this in PsPad editor that I use. You'll need multiline search extension for this one however.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Galileus

Well, it's easy enough to write your own when you need it. RegEx ain't that hard once you grasp it ;)

Darker

But it's pretty tough before, that's why I started this topic.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT