in reply to Re^2: How to modify my regex?
in thread How to modify my regex?

You're very welcome. It may seem a bit churlish to bring this up after your gracious thanks, but it dawned on me that the subject of the OP was familiar, and I was right: Re^3: Substitution don't work discusses a similar problem. Updates 2 & 3 there give contrasting examples of  .* versus  .*? (greedy versus lazy) behavior. (Also see the discussion there of the effect of the  /s regex modifier on the behavior of the  . (dot) metacharacter when matching against a multi-line string.)

These comments are not intended to give you a hard time, but to suggest that the advice of the humble Monks will be of more value to you the more attention you pay it.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: How to modify my regex?
by OldChamp (Acolyte) on Aug 27, 2015 at 16:50 UTC

    Thank you for your answer. I must confess, that at the time when reading your reply to 'Substitution don't work' I didn't understand this Updat 3, especially the meaning of the " ", and I had no clue what these [[ should mean. As I am just at the beginning with perl, I thought these characters are some special codes I just don't know yet, because there are so many characters with special meanings in perl. Now (that means today), after all the friendly posts of the humble Monks and after studying these posts and trying to understand what I read I finally have understood that between the " " that is the code and that the other stuff is meant to explain how the regex works. I eventually succeded in running this update 3 and I could see how it works. I agree, I should have tried harder the first time when I read this update 3. But for my defence I have to say that for experienced Monks like you all this is obvious, but for a newbie like me (72 years old :-) and as a German always fighting with my school English) even the obvious is sometimes not easy. I have learned a lot from you and the other monks since I have started here and I'm greatful to this community.

      Believe me, every experienced Monk started as a novice! And don't worry about your English: I find it quite clear — and it's a lot better than my German!


      Give a man a fish:  <%-{-{-{-<