Re: [thredds] Regular expression help in featureCollections

  • To: Roy Mendelssohn - NOAA Federal <roy.mendelssohn@xxxxxxxx>
  • Subject: Re: [thredds] Regular expression help in featureCollections
  • From: Gerry Creager - NOAA Affiliate <gerry.creager@xxxxxxxx>
  • Date: Fri, 15 Feb 2013 23:35:56 -0600
Ethan

The problem he had, actually, was that he had not used the '.*' construct
but instead, tried what we've all done: "*". getting used to the '.*'
construct, which will work most everywhere, on the command line, that '*'
works.

Tom Yoksas is the one who beat me into submission on regex.

gerry


On Fri, Feb 15, 2013 at 11:26 PM, Roy Mendelssohn - NOAA Federal <
roy.mendelssohn@xxxxxxxx> wrote:

> :-)
>
> I think what these means is that I am possessed with reluctant greed.
>
> -Roy
> On Feb 15, 2013, at 9:17 PM, Ethan Davis <edavis@xxxxxxxxxxxxxxxx> wrote:
>
> > Hi Roy,
> >
> > Not much help here I'm afraid. But I can't pass up a chance to talk
> regular expressions.
> >
> > Roy wrote:
> >> Okay I am bad at regular expressions
> >
> > Everyone is bad at regular expressions, even those of us who "like"
> them. They have arcane rules (e.g., greedy vs reluctant quantifiers [1])
> which requires a lot of attention to detail and, to top it all off, they
> are pretty much impossible to debug.
> >
> > For those who read [1] for the details, here's my guess as to why your
> first attempt failed ...
> > In your case, the ".*" is greedy but I'm guessing the way the date stamp
> #yyyyMMddHH# is implemented breaks the backtracking mechanism.
> >
> > Ethan
> >
> > [1]
> http://stackoverflow.com/questions/5319840/greedy-vs-reluctant-vs-possessive-quantifiers
> >
> > This StackOverflow question is kind of humorous if you don't really care
> about the answer. If you do care (i.e., anyone who has to use regular
> expressions), then you have to read it for the details and not the humor
> (sorry):
> >
> >
> > On 2/15/2013 8:00 PM, Roy Mendelssohn - NOAA Federal wrote:
> >> that was a typo on my part in setting up the example..  I have pres$.
>  After testing a lot of things, I think junkF0..#yyyyMMddHH#pres$  works.
> >>
> >> -Roy
> >>
> >> On Feb 15, 2013, at 6:49 PM, Dennis Heimbigner <dmh@xxxxxxxxxxxxxxxx>
> wrote:
> >>
> >>> One problem is that you have at the end
> >>> pre$ rather than pres$
> >>> The premature $ would cause a failure.
> >>>
> >>> Roy Mendelssohn - NOAA Federal wrote:
> >>>> Hi All:
> >>>> Okay I am bad at regular expressions,  and I am having problems
> giving featureCollections the correct match to find the date for files that
>  have slightly different names.  To simplify we want to have file that match
> >>>> junkF0OF2013031206pres
> >>>> junkF0RL2013031212pres
> >>>> both included in the aggregation.  I have tried junk*#yyyyMMddHH#pre$
>   junk.*#yyyyMMddHH#pre$ and a few other combinations and both have failed.
>  Any suggetions appreciated.
> >>>> -Roy M.
> >>>> **********************
> >>>> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> >>>> **********************
> >>>> Roy Mendelssohn
> >>>> Supervisory Operations Research Analyst
> >>>> NOAA/NMFS
> >>>> Environmental Research Division
> >>>> Southwest Fisheries Science Center
> >>>> 1352 Lighthouse Avenue
> >>>> Pacific Grove, CA 93950-2097
> >>>> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
> >>>> voice: (831)-648-9029
> >>>> fax: (831)-648-8440
> >>>> www: http://www.pfeg.noaa.gov/
> >>>> "Old age and treachery will overcome youth and skill."
> >>>> "From those who have been given much, much will be expected" "the arc
> of the moral universe is long, but it bends toward justice" -MLK Jr.
> >>>> _______________________________________________
> >>>> thredds mailing list
> >>>> thredds@xxxxxxxxxxxxxxxx
> >>>> For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
> >> **********************
> >> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> >> **********************
> >> Roy Mendelssohn
> >> Supervisory Operations Research Analyst
> >> NOAA/NMFS
> >> Environmental Research Division
> >> Southwest Fisheries Science Center
> >> 1352 Lighthouse Avenue
> >> Pacific Grove, CA 93950-2097
> >>
> >> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
> >> voice: (831)-648-9029
> >> fax: (831)-648-8440
> >> www: http://www.pfeg.noaa.gov/
> >>
> >> "Old age and treachery will overcome youth and skill."
> >> "From those who have been given much, much will be expected"
> >> "the arc of the moral universe is long, but it bends toward justice"
> -MLK Jr.
> >>
> >> _______________________________________________
> >> thredds mailing list
> >> thredds@xxxxxxxxxxxxxxxx
> >> For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
> >
> > _______________________________________________
> > thredds mailing list
> > thredds@xxxxxxxxxxxxxxxx
> > For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
> **********************
> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> **********************
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> 1352 Lighthouse Avenue
> Pacific Grove, CA 93950-2097
>
> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
> voice: (831)-648-9029
> fax: (831)-648-8440
> www: http://www.pfeg.noaa.gov/
>
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK
> Jr.
>
> _______________________________________________
> thredds mailing list
> thredds@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
>



-- 
Gerry Creager
NSSL/CIMMS
405.325.6731
  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: