NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
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
archives: