Loading ...
Sorry, an error occurred while loading the content.

RE: [NTS] Re: NTB or RegEx Bug

Expand Messages
  • John Shotsky
    I agree, and use the star heavily in my clip libraries. Regards, John RecipeTools Web Site: http://recipetools.gotdns.com/
    Message 1 of 11 , Sep 30, 2012
    • 0 Attachment
      I agree, and use the star heavily in my clip libraries.

      Regards,
      John
      RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

      From: ntb-scripts@yahoogroups.com [mailto:ntb-scripts@yahoogroups.com] On Behalf Of flo.gehrke
      Sent: Sunday, September 30, 2012 05:39
      To: ntb-scripts@yahoogroups.com
      Subject: [NTS] Re: NTB or RegEx Bug


      --- In ntb-scripts@yahoogroups.com <mailto:ntb-scripts%40yahoogroups.com> , Axel Berger <Axel-Berger@...> wrote:
      >
      > "flo.gehrke" wrote:
      > > You could use 'a*a' instead of 'a*'.
      > I think in practice a star quantifier on its own is
      > meaningless, there must be at least one other thing in the
      > pattern...What can the possible use be for something that
      > matches anywhere in anything?

      In this context, I understood that 'a' is just an element that, "in practice", would primarily represent an element in a
      more complex pattern. In this respect, I agree with the objection you made.

      In order to match just a sequence of literal 'a', a pattern like 'a*a' wouldn't make much sense, indeed. And 'a{1,}' or
      'a+' would certainly be more appropriate solutions.

      But to prevent any misunderstanding among beginners, we should stress that something like 'a*' is not at all useless
      under ANY circumstances. Quite often, we have to define that an element 'a' is there or it is not there.

      For example: (?<=<xxx>)\d*(?=</xxx>) matching the position between '>' and '<' in strings like...

      <xxx>12</xxx>
      <xxx></xxx>
      <xxx>9</xxx>

      no matter if there is a number or no number.

      Regards,
      Flo



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.