This page looks best with JavaScript enabled

Parsing Text With Regular Expressions - Unity Observer - Part 5

 ·   ·  ☕ 2 min read

    Let’s take a look at improving the usability of Unity Observer by reducing the number of text boxes we use to search. In this video we’ll reduce the three text boxes used for searching for Game Objects, Components and Properties/Fields into a single one that can accept all three. To accomplish this we’re going to take a look at creating an extremely simple syntax and implement it in C# Regular Expressions. This will give us a really quick sample of using Regular Expressions to identify groups of text from inside a larger set of text.

    This syntax isn’t the final one we’ll be using, but it is a simple and easy to write shorthand (though not very easy to remember or flexible).

    If you want to learn more about the syntax of regular expressions in C# MSDN has a great resource on it:

    If you prefer to keep your sanity and just want to test an existing regular expression you can try one of the online editors. I personally like but there are a number of great ones available.

    Want to try the Unity Observer for yourself or have a fix you think we should implement? You can contribute or download the project from GitHub here:

    We have a Discord channel! Come talk programming, game development and more:

    Sam Wronski
    Sam Wronski
    Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!