summaryrefslogtreecommitdiff
path: root/BJC-Utils2/data
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2017-04-06 16:02:40 -0400
committerbjculkin <bjculkin@mix.wvu.edu>2017-04-06 16:02:40 -0400
commit0be891100df83544c89651c815105832e3e11eb9 (patch)
treed9ef2b10e6cf39c77911a54be5cb62f782054b50 /BJC-Utils2/data
parent0ff9ed78aadb32f85ee3e37f5574d7ca2e12cdf5 (diff)
Start moving things to properties
This cuts down on the amount of regex escapes
Diffstat (limited to 'BJC-Utils2/data')
-rw-r--r--BJC-Utils2/data/formats.sprop11
-rw-r--r--BJC-Utils2/data/regexes.sprop19
2 files changed, 30 insertions, 0 deletions
diff --git a/BJC-Utils2/data/formats.sprop b/BJC-Utils2/data/formats.sprop
new file mode 100644
index 0000000..bdd9286
--- /dev/null
+++ b/BJC-Utils2/data/formats.sprop
@@ -0,0 +1,11 @@
+# File storage for format strings
+
+####################################################
+# Format strings for handling double-quoted strings.
+####################################################
+
+## Format the three types of string escapes into a valid pattern.
+stringEscape \\(%1$s|%2$s|%3$s)
+
+## Format the parts of a regex into one that matches java-style double-quoted strings
+doubleQuotes ("(%1$s|%2$s)*") \ No newline at end of file
diff --git a/BJC-Utils2/data/regexes.sprop b/BJC-Utils2/data/regexes.sprop
new file mode 100644
index 0000000..bece4d3
--- /dev/null
+++ b/BJC-Utils2/data/regexes.sprop
@@ -0,0 +1,19 @@
+# File storage for static regular expressions.
+
+########################################################
+# Regular expressions for handling double-quoted strings
+########################################################
+
+## Match a possible single character escape
+possibleStringEscape \\.
+
+## Match valid string escapes
+shortFormStringEscape [btnfr"'\\]
+octalStringEscape [0-3]?[0-7]{1,2}
+unicodeStringEscape u[0-9a-fA-F]{4}
+
+## Match an unescaped quote in a string.
+unescapedQuote (?<!\\)\"
+
+## Match characters that aren't escapes.
+nonStringEscape [^\\\"]+ \ No newline at end of file