Merge "Add a test proving escaped back references work"

This commit is contained in:
Jenkins 2016-10-05 21:02:58 +00:00 committed by Gerrit Code Review
commit 3c16c1870e
1 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,12 @@ class TestRegex(yaql.tests.TestCase):
'axxb23',
self.eval(r"regex(`\d+`).replace(a12b23, xx, 1)"))
def test_replace_backref(self):
self.assertEqual(
'Foo_Bar_Foo',
self.eval(r"regex(`([a-z0-9])([A-Z])`).replace("
"FooBarFoo, `\\1_\\2`)"))
def test_replace_on_string(self):
self.assertEqual(
'axxbxx',