Fix: Match single quotes (#17539)

* Fix: Match single quotes

* Fix: slash direction

* Fix: Regex expression and refined tests
This commit is contained in:
Vimal Raghubir
2018-06-12 22:31:31 -04:00
committed by Kristofer Koishigawa
parent 4f729e861f
commit c0b47ae7a7

View File

@ -1253,11 +1253,11 @@
"tests": [ "tests": [
{ {
"text": "Your code should move the anchor <code>a</code> tags from around the words \"Click here\" to wrap around the words \"information about batteries\".", "text": "Your code should move the anchor <code>a</code> tags from around the words \"Click here\" to wrap around the words \"information about batteries\".",
"testString": "assert($('a').text().match(/information about batteries/g), 'Your code should move the anchor <code>a</code> tags from around the words \"Click here\" to wrap around the words \"information about batteries\".');" "testString": "assert($('a').text().match(/^(information about batteries)$/g), 'Your code should move the anchor <code>a</code> tags from around the words \"Click here\" to wrap around the words \"information about batteries\".');"
}, },
{ {
"text": "Make sure your <code>a</code> element has a closing tag.", "text": "Make sure your <code>a</code> element has a closing tag.",
"testString": "assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/<a href=\"\">/g).length, 'Make sure your <code>a</code> element has a closing tag.');" "testString": "assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/<a href=(''|\"\")>/g).length, 'Make sure your <code>a</code> element has a closing tag.');"
} }
], ],
"solutions": [], "solutions": [],