Regex và 6 nhóm kí hiệu hay được sử dụng
Regex và 6 nhóm kí hiệu hay được sử dụng

You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.

Describe your problem and how to reproduce it:
The challenges prior to this method use the match() method to determine regex tests, in this there is a sudden use of the test method.
There should be a small description to be provided to the user so that he/she can understand the difference between the two, also the challenge requires the use of the test method in place of match, so a beginner might be replacing the test with match only to be thrown with an error.
Alternatively, the guide can provide the description necessary.
I can open a PR and do the modifications.

On checking through some stack overflow, i have observed that test() method will return a boolean true or false on whether a regex matches a string or not, whereas a match() method will return the matching strings or a null.
So it would be worthwhile to add a note to explain the use of test in contrast to match in this particular challenge.

The first challenge in the Regular Expressions section introduces the test method, so they’ve definitely had a chance to learn about it. That said, the instructions do talk about match while the tests require you to use test, so it is a little muddled.

It wouldn’t hurt to remind someone that test exists, so I think using it as part of the challenge is perfectly fine. In light of that, all I would change is the description.

@co16353sidak If you’re still interested in working on this, I’d recommend modifying the description (the examples in particular) to use test.

You are watching: Regular Expressions: Match Anything with Wildcard Period: no prior explanation for test method · Issue #35089 · freeCodeCamp/freeCodeCamp. Info created by Bút Chì Xanh selection and synthesis along with other related topics.