A .NET regular expression for tokenizing INI-style configuration files.
Supports:
[Section]key=value and key:value# comment and ; comment{ ... }| Group | Description |
|---|---|
text | Any meaningful text token |
comment | Comment line |
open | Opening symbol (#, ;, [) |
close | Closing symbol (]) |
section | Section declaration |
entry | Key-value entry |
key | Entry key |
delimiter | Key-value separator (= or :) |
value | Section name, comment text, or entry value |
undefined | Unknown text |
linebreaker | Line ending |
whitespace | Spaces and tabs |
Values wrapped in { } are treated as a single block:
Json =
{
"name": "example",
"items": [
1,
2
]
}
Inside blocks:
// comments are ignored;/* comments */ are ignored;{} are supported.This regex performs structural parsing only.
It does not validate:
Use a dedicated parser after tokenization if full validation is required.
Designed for:
System.Text.RegularExpressionsNot compatible with regex engines without balancing group support.