Ludeon Forums

RimWorld => Mods => Help => Topic started by: Darker on January 06, 2014, 02:51:25 PM

Title: Usefull REGular EXPressions
Post by: Darker on January 06, 2014, 02:51:25 PM
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.
Title: Re: Usefull REGular EXPressions
Post by: Galileus on January 06, 2014, 03:14:55 PM
Well, it's easy enough to write your own when you need it. RegEx ain't that hard once you grasp it ;)
Title: Re: Usefull REGular EXPressions
Post by: Darker on January 06, 2014, 03:28:56 PM
But it's pretty tough before, that's why I started this topic.