View Single Post
Old 07-13-2016, 05:46 PM   #37
Psymon
Chief Bohemian Misfit
Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.Psymon ought to be getting tired of karma fortunes by now.
 
Psymon's Avatar
 
Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
Firstly (and briefly) to Turtle...

Quote:
Originally Posted by Turtle91 View Post
The Regex examples thread is definitely helpful!
What's the "Regex examples thread"? I did a search of the forums here for "regex examples" but didn't find anything.

Also, from Jellby...

Quote:
Originally Posted by Jellby View Post
For the record:

. : any character
+ : any number of times (but at least one)
? : but as few as as possible, as long as the rest of the expression still matches
( ) : and put it in a group, so it can be referred to as \1, \2, etc.
Oh, cool, thanks for breaking that down for me. I just interpreted the whole shebang together as "variable" -- which I guess is essentially what it means/does.

I'm not quite sure that I understand the "? : but as few as as possible, as long as the rest of the expression still matches" part, though -- in what sense as few as possible? Couldn't it go on (and on and on, ad infinitum) until it hits the next part of the matching string -- wouldn't it do that without the "?" in there anyway, just stop at that part (the next matching bit)?

Perhaps I'm overcomplicating this -- the simple answer, for my needs, is that "(.+?)" does the trick!
Psymon is offline   Reply With Quote