From d16a531dfe3118bfff39bc3c84795e49a80d048c Mon Sep 17 00:00:00 2001 From: alisa <2227642711@qq.com> Date: Thu, 4 Apr 2019 10:19:39 +0800 Subject: [PATCH] ex5 --- lib/anchor_end.js | 5 +++++ lib/anchor_start.js | 6 +++++- lib/char_class.js | 5 +++++ lib/negated_char_class.js | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/anchor_end.js b/lib/anchor_end.js index 56e8b85..088918b 100644 --- a/lib/anchor_end.js +++ b/lib/anchor_end.js @@ -1,3 +1,8 @@ module.exports = function (str) { // TOOD + const partten=/BANANAS$/; + let match=str.match(partten); + if(match!==null){ + return true; + } } \ No newline at end of file diff --git a/lib/anchor_start.js b/lib/anchor_start.js index 56e8b85..d60a2f3 100644 --- a/lib/anchor_start.js +++ b/lib/anchor_start.js @@ -1,3 +1,7 @@ module.exports = function (str) { - // TOOD + const partten=/^LITERALLY/; + let match=str.match(partten); + if(match!==null){ + return true; + } } \ No newline at end of file diff --git a/lib/char_class.js b/lib/char_class.js index a08ee57..937abc2 100644 --- a/lib/char_class.js +++ b/lib/char_class.js @@ -1,3 +1,8 @@ module.exports = function (str) { // TODO + const partten=/^[a14uo]/; + let match=str.match(partten); + if(match!==null){ + return true; + } } \ No newline at end of file diff --git a/lib/negated_char_class.js b/lib/negated_char_class.js index a08ee57..50fc684 100644 --- a/lib/negated_char_class.js +++ b/lib/negated_char_class.js @@ -1,3 +1,8 @@ module.exports = function (str) { // TODO + const partten=/([^0-9]{1})([^A-Z])/; + let match=str.match(partten); + if(match!==null){ + return true; + } } \ No newline at end of file