[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] example of regexp classad expression syntax



Hi Steve,

That's not a valid regexp, so the function evaluates to Error.

Did you want:

regexp("wnitb.{0,3}\.fnal\.gov", Machine)

?  Probably could tighten up the regexp with:

regexp("wnitb[0-9]{0,3}\.fnal\.gov", Machine)

Brian

PS - here's what I used to test:

>>> import classad
>>> ad = classad.ClassAd({"Machine": "wnitb123.fnal.gov"})
>>> expr = classad.ExprTree('regexp("wnitb.?.?.?\.fnal\.gov", Machine)')
>>> expr.eval(ad)
True
>>> expr = classad.ExprTree('regexp("wnitb???\.fnal\.gov", Machine)')
>>> expr.eval(ad)
classad.Value.Error

On Jul 28, 2014, at 1:37 PM, Steven Timm <timm@xxxxxxxx> wrote:

> 
> I am trying to create a classad expression which is TRUE
> when the Machine name matches wnitb???.fnal.gov
> and FALSE otherwise.
> 
> I thought
> regexp("wnitb???.fnal.gov",Machine)
> should do that--but in fact I can not construct any regexp
> that is turning out to be true.  What am I missing?
> Manual isn't much help on this.
> 
> Steve Timm
> 
> 
> ------------------------------------------------------------------
> Steven C. Timm, Ph.D  (630) 840-8525
> timm@xxxxxxxx  http://home.fnal.gov/~timm/
> Fermilab Scientific Computing Division, Scientific Computing Services Quad.
> Grid and Cloud Services Dept., Associate Dept. Head for Cloud Computing
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
> 
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/