-
Notifications
You must be signed in to change notification settings - Fork 0
CFG: Validation
Robert Jordan edited this page Jun 20, 2021
·
1 revision
Regular expressions to find and/or replace malformed CFG properties (as lines).
[^ \t\r\n;]
[^ \t\r\n;]+
;
;.*$
[ \t]
[ \t\r\n]
Note: Two pattern choices are included for most sections below. The bottom pattern is available for Regex engines that do not support look-ahead or look-behind functionality.
^(?=[ \t]*(?:;[^\r\n]*)?$)
^[ \t]*(?:;[^\r\n]*)?$
(?<=[^ \t\r\n;])[{}]|[{}](?=[^ \t\r\n;])
(?:[^ \t\r\n;])[{}]|[{}](?:[^ \t\r\n;])
(?<!;.*|[^ \t\r\n;])\/\/.*
^([^\r\n;]*[ \t])\/\/.*
(?<!;.*|[^ \t\r\n;])\/\/
;
^([^\r\n;]*[ \t])\/\/
$1;
(?<=^[ \t]*)[^ \t\r\n;]+([ \t]+[^ \t\r\n;]+){2,}
^((?:^|[ \t]+)[^ \t\r\n;]+){3,}
(?<=^[ \t]*)(?!\/\/)[^ \t\r\n;]+([ \t]+(?!\/\/)[^ \t\r\n;]+){2,}
^((?:^|[ \t]+)(?:[^/ \t\r\n;]|/(?:[^/ \t\r\n;]|$))+){3,}
(?<=^[ \t]*(?:[^ \t\r\n;]+[ \t]+){2})(?=[^ \t\r\n;])(?:\/\/)?
;
^((?:(?:^|[ \t]+)[^ \t\r\n;]+){2}[ \t]+)(?:\/\/(.)|([^ \t\r\n;]))
$1;$2$3