Regular Expressions Problem | SoloLearn: Learn to code for FREE!


Regular Expressions Problem Plz tell how ? is used for two different purposes First for lazy matching Second for the existence of letter How ? Behaves differently?

5/20/2020 11:33:31 PM

Saad Mughal

9 Answers

New Answer


This is a great question. Thanks for sharing. Even I got confused a little 😃 But going through this awesome article the purpose of '?' as lazy quantifier became crystal clear 👌 This article explains very clearly how the use '?' after other identifiers like '* 'or in your case '+' makes it lazy and hence able to find multiple matches. I am off to my favorite regex playground to play with this myself.


Morpheus 😄 thanks


Recently I found regex is something worthy to learn, and its universal, with some cave ats from language to language. I was amazed how big chunk of code could be replaced with few lines of code, using right functions with regex. Just awesome. Definitelly, will spend more time in near future learning this.


Burey Calviղ Morpheus BENOTMANE Schindlabua


Bartas Dausynas yes when I done solving algorithm problem with many If else, loops and many lines of code and then see other solutions they solve the same problem with just one line of regex.


Saad Mughal yaap, been there, done that 🙈


Please see:


What is the answer