From ec43ae4c0e6fc5c07a913f50545b0032459cae95 Mon Sep 17 00:00:00 2001 From: yiw Date: Sat, 24 Nov 2018 14:34:19 +0800 Subject: [PATCH] complete exercise5 --- lib/anchor_end.js | 2 ++ lib/anchor_start.js | 1 + lib/char_class.js | 1 + lib/negated_char_class.js | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/anchor_end.js b/lib/anchor_end.js index 56e8b85..5c5aa01 100644 --- a/lib/anchor_end.js +++ b/lib/anchor_end.js @@ -1,3 +1,5 @@ module.exports = function (str) { // TOOD + const reg = /BANANAS$/; + return reg.test(str); } \ No newline at end of file diff --git a/lib/anchor_start.js b/lib/anchor_start.js index 56e8b85..73a6f5e 100644 --- a/lib/anchor_start.js +++ b/lib/anchor_start.js @@ -1,3 +1,4 @@ module.exports = function (str) { // TOOD + return /^(LITERALLY)/.test(str); } \ No newline at end of file diff --git a/lib/char_class.js b/lib/char_class.js index a08ee57..cc2e2e3 100644 --- a/lib/char_class.js +++ b/lib/char_class.js @@ -1,3 +1,4 @@ module.exports = function (str) { // TODO + return /^[auo0-9]/.test(str); } \ No newline at end of file diff --git a/lib/negated_char_class.js b/lib/negated_char_class.js index a08ee57..dabec25 100644 --- a/lib/negated_char_class.js +++ b/lib/negated_char_class.js @@ -1,3 +1,4 @@ module.exports = function (str) { - // TODO + // TODO + return /[^0-9][^A-Z]/.test(str); } \ No newline at end of file