Just a quick curious question. Before I knew regex I did some research on how I can pull information from the source of webpages and found that people would use:
Which was used to pull all information between two sets of strings.
Now that I'm learning regex I know that the "?" refers to a character being "optional". So if I have:
And I want to select both lines I'd use:
This leads me to my actual question... if I want to select everything between "abc" in this string:
What's wrong with
Why would I need "?" in the expression? This makes zero sense to me.
PHP Code
<?php
somestuff(.*?)somemorestuff
Which was used to pull all information between two sets of strings.
Now that I'm learning regex I know that the "?" refers to a character being "optional". So if I have:
PHP Code
<?php
abc
ac
And I want to select both lines I'd use:
PHP Code
<?php
ab?c
This leads me to my actual question... if I want to select everything between "abc" in this string:
PHP Code
<?php
abc dsfljkdslkfjdslfkj abc
What's wrong with
PHP Code
<?php
abc(.*)abc
Why would I need "?" in the expression? This makes zero sense to me.
![[Image: 5BgQiIm.gif]](https://i.imgur.com/5BgQiIm.gif)

