Ludeon Forums

Ludeon Forums

  • August 05, 2021, 07:25:00 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Usefull REGular EXPressions  (Read 1773 times)

Darker

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Usefull REGular EXPressions
« 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.
« Last Edit: January 06, 2014, 03:03:53 PM by Darker »
Logged
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Galileus

  • Guest
Re: Usefull REGular EXPressions
« Reply #1 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 ;)
Logged

Darker

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Re: Usefull REGular EXPressions
« Reply #2 on: January 06, 2014, 03:28:56 PM »

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