aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/document_matchers.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mammoth/document_matchers.py b/mammoth/document_matchers.py
index af1fd47..d1f8e74 100644
--- a/mammoth/document_matchers.py
+++ b/mammoth/document_matchers.py
@@ -45,6 +45,14 @@ def equal_to(value):
def _operator_equal_to(first, second):
return first.upper() == second.upper()
+
+
+def starts_with(value):
+ return StringMatcher(_operator_starts_with, value)
+
+
+def _operator_starts_with(first, second):
+ return second.upper().startswith(first.upper())
@cobble.data
@@ -54,5 +62,3 @@ class StringMatcher(object):
def matches(self, other):
return self.operator(self.value, other)
-
-