This is from an online quiz I am taking. Makes no sense to me though, because abbb:
- Starts with mandatory a - check!
- Has one or more b's after a - check!
- Has 0 occurance of c - check!
Thoughts? Am I missing something here?
This is from an online quiz I am taking. Makes no sense to me though, because abbb:
Thoughts? Am I missing something here?
There are multiple online regex tools you can use to test that out.
https://regex101.com/ is an ad-free site with multiple regex implementations (php, javascript, python, and golang). Here's a link with your test case: https://regex101.com/r/9uI9Uw/1.
Your reasoning is correct and abbb
is a match for the regex /ab+c?/
.
Javascript snippet:
const s = 'abbb'
console.log(s.match(/ab+c?/))