Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the difference between regex patterns?

What is the difference between "[abc]+" and "[abc]" regex patterns?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I know what + means. But what does it mean without quantifier?

If you do not put a quantifier next to a regex token, then (by default) this means "match one".

This means "match the word hello":

/hello/

i.e. it does not match anything else, such as: helo, heello or heeelllooooo.

This means "match one h, one or more e, one or more l and one o:

/he+l+o/

i.e. matches any of the following:

helo
hello
heeeelo
heellllo
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading