summaryrefslogtreecommitdiff
path: root/BJC-Utils2/data
diff options
context:
space:
mode:
Diffstat (limited to 'BJC-Utils2/data')
-rw-r--r--BJC-Utils2/data/formats.sprop24
-rw-r--r--BJC-Utils2/data/regexes.sprop16
2 files changed, 40 insertions, 0 deletions
diff --git a/BJC-Utils2/data/formats.sprop b/BJC-Utils2/data/formats.sprop
index 7d8fc94..73ebc29 100644
--- a/BJC-Utils2/data/formats.sprop
+++ b/BJC-Utils2/data/formats.sprop
@@ -1,5 +1,29 @@
# File storage for format strings
+#################################################
+# Generic format strings for regular expressions.
+#################################################
+
+## Format a regular expression for matching a delimiter separated list.
+## Takes two parameters
+## 1) The expression for each term
+## 2) The expression for the delimiter
+delimSeparatedList (?:%1$s(?:%2$s%1$s)*)
+
+######################################
+# CL format string regular expressions
+######################################
+
+## Format a regular expression for matching a potential CL format directive
+## Has two parts
+## 1) The optional set of prefix parameters
+## 2) The optional modifier
+## Captures three things
+## 1) The prefix parameters
+## 2) The modifiers
+## 3) The directive name
+clFormatDirective ~(?<params>%1$s)?(?<modifiers>%2$s?)(?<name>\S)
+
####################################################
# Format strings for handling double-quoted strings.
####################################################
diff --git a/BJC-Utils2/data/regexes.sprop b/BJC-Utils2/data/regexes.sprop
index cdacea0..dadc09c 100644
--- a/BJC-Utils2/data/regexes.sprop
+++ b/BJC-Utils2/data/regexes.sprop
@@ -34,6 +34,22 @@ fpExponent [eE][+-]?
## NOTE: The incomplete parts are finished by where it is inserted.
fpLeader [\x00-\x20]*[+-]?(?:NaN|Infinity|
+######################################
+# CL format string regular expressions
+######################################
+
+## Matches a format string prefix parameter
+## A prefix parameter is one of
+## * A signed decimal number
+## * A single character preceded by a single quote
+## * The letter V (or v)
+## * The character #
+clFormatPrefix (?:[-+]?\d+|'\S|[Vv]|#)
+
+## Match a format string modifier
+## A modifier is either : or @, or both in either order
+clFormatModifier (?:@|:|@:|:@)
+
##############################################
# Miscellaneous validation regular expressions
##############################################