Hey Chris,

I believe I’m getting closer and closer to appreciating the beauty and the 
simplicity of the concepts behind greedy and non-greedy. 

Patrick’s guidance yesterday worked perfectly and I customized his regex to 
suit my specific needs.

I’ll continue working on simplifying things. Simplicity is VERY powerful.

I hope everyone else in our group will benefit from these conversations.

Thanks for your great tutorial and example.

Alfredo


> On Oct 5, 2018, at 12:38 PM, Christopher Stone <listmeis...@suddenlink.net> 
> wrote:
> 
> On 10/04/2018, at 10:09, F. Alfredo Rego <f.alfredor...@gmail.com 
> <mailto:f.alfredor...@gmail.com>> wrote:
>> After doing lots of exercises using your example, this greedy vs. non-greedy 
>> challenge WILL be conquered. Once this concept is clear, everything becomes 
>> clear.
> 
> 
> Hey Alfredo,
> 
> Did you wrap your head around the Greedy vs Non-Greedy issue yet?
> 
> It's really very simple in concept.
> 
> First Possible Match vs. Last Possible Match.
> 
> Using this test data:
> 
> 
> 12345678901234567890123456789012345678901234567890
> 
> 
> Greedy:
> 
> 1.+0
> 
> Non-Greedy:
> 
> 1.+?0
> 
> 
> Using this test data:
> 
> 
> /sbin/md5 ~/'test_directory/01_movie_test_file.mov'     /sbin/md5 
> ~/'test_directory/02_movie_test_file.mov'
> 
> 
> /sbin/md5 ~/'test_directory/03_movie_test_file.mov'
> 
> 
> Non-Greedy:
> 
> ^\S.+?movie_test_file\.mov
> 
> Greedy:
> 
> ^\S.+movie_test_file\.mov
> 
> 
> Adding other modifiers changes the constraints of what can be found.
> 
> (?s) allows . to match EOL characters and therefore span lines.
> 
> Non-Greedy:
> 
> (?s)^\S.+?movie_test_file\.mov
> 
> Greedy:
> 
> (?s)^\S.+movie_test_file\.mov
> 
> 
> HTH.
> 
> --
> Take Care,
> Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <https://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to