From 7d24828dab073448cfe82e61247521647303a8d6 Mon Sep 17 00:00:00 2001 From: Brent Roose Date: Fri, 15 Mar 2024 11:38:24 +0100 Subject: [PATCH] wip --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9aa8bf6..34b8cad 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,13 @@ Note that each pattern must include a regex capture group that's named `match`. For example, this regex `namespace (?[\w\\\\]+)` says that every line starting with `namespace` should be taken into account, but only the part within the named group `(?…)` will actually be colored. In practice that means that the namespace name matching `[\w\\\\]+`, will be colored. -Yes, you'll need some basic knowledge of regex. +Yes, you'll need some basic knowledge of regex. Head over to [https://regexr.com/](https://regexr.com/) if you need help, or take a look at the existing patterns in this repository. + +In summary: + +- Patterns provide a regex that matches parts of your code +- Those regexes should contain a group named `match`, which is written like so `(?…)` +- Finally, a pattern provides a `TokenType`, which is used to determine the highlight style for the specific match **2. Injections**