Fix the substitution problem for find-strings that start with 's'.
author |
Steve Losh <steve@stevelosh.com> |
date |
Wed, 16 Sep 2009 20:14:06 -0400 |
parents |
0c75cfe0a6a4
|
children |
651f8f37228b
|
branches/tags |
(none) |
files |
t.py |
Changes
--- a/t.py Fri Sep 11 19:08:21 2009 -0400
+++ b/t.py Wed Sep 16 20:14:06 2009 -0400
@@ -139,7 +139,7 @@
"""
task = self[prefix]
if text.startswith('s/') or text.startswith('/'):
- text = text.lstrip('s/').strip('/')
+ text = re.sub('^s?/', '', text).rstrip('/')
find, _, repl = text.partition('/')
text = re.sub(find, repl, task['text'])