summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-09-28 17:29:06 +0200
committerMatti Lehtimäki <matti.lehtimaki@gmail.com>2013-09-28 17:29:06 +0200
commit81de9f8c2e2c3223789ad1bed1f00d58c773d7b8 (patch)
tree64ea1ee1be68c425e26a800823e32e63f756b71a
parent6e954ad800a4696b3818df08bf132a9535a5f03b (diff)
downloadvdr-plugin-epgfixer-81de9f8c2e2c3223789ad1bed1f00d58c773d7b8.tar.gz
vdr-plugin-epgfixer-81de9f8c2e2c3223789ad1bed1f00d58c773d7b8.tar.bz2
Update README and example regexp.conf for conditional regular expressions.
-rw-r--r--README10
-rw-r--r--epgfixer/regexp.conf4
2 files changed, 12 insertions, 2 deletions
diff --git a/README b/README
index 7bc80da..8d83db8 100644
--- a/README
+++ b/README
@@ -60,9 +60,15 @@ General syntax of configuration files:
numbers but not both.
- Channel intervals (e.g. 1-10) can be used for channel numbers.
-Syntax of regexp.conf line is "Channel_list:Parsed_epg_field=Regexp" with:
-- Parsed_epg_field is the EPG field for which the regular expression is applied
+Syntax of regexp.conf line is
+"Channel_list:Parsed_field?Conditional_field~Conditional_Regexp=Regexp" with:
+- Parsed_field is the EPG field for which the regular expression is applied
with available field names title, shorttext and description.
+- Conditional_field and Conditional_Regexp are optional parameters to control
+ when Regexp is applied.
+- Conditional_field is identical to Parsed_field.
+- Conditional_Regexp has to be a Perl-style 'm/PATTERN/' as described below
+ except it is only used for matching (i.e. backreferences are ignored).
- Regular expressions can be used in different ways: Perl-style
's/PATTERN/REPLACEMENT/' and 'm/PATTERN/' operators or simply using 'PATTERN'
of which the latter two use named backreferences.
diff --git a/epgfixer/regexp.conf b/epgfixer/regexp.conf
index a7ef68c..5886428 100644
--- a/epgfixer/regexp.conf
+++ b/epgfixer/regexp.conf
@@ -19,5 +19,9 @@
# Matches 'foo' case-insensitively
#description=m/foo/i
+# Example of a conditional regexp
+# regexp "s/foo/bar/" is applied to description only if title matches "foo"
+#description?title~m/foo/=s/foo/bar/
+
# Example of disabled regexp:
#!title=m/^(?:Movie: |Document: )(?<title>.*)$/