[ET Trac] [Einstein Toolkit] #1595: Is *) allowed as upper boundary for a parameter range?

Einstein Toolkit trac-noreply at einsteintoolkit.org
Tue May 26 10:07:14 CDT 2015


#1595: Is *) allowed as upper boundary for a parameter range?
-----------------------+----------------------------------------------------
  Reporter:  eschnett  |       Owner:  sbrandt            
      Type:  defect    |      Status:  assigned           
  Priority:  minor     |   Milestone:  ET_2015_05         
 Component:  Cactus    |     Version:  development version
Resolution:            |    Keywords:  postrelease        
-----------------------+----------------------------------------------------

Comment (by sbrandt):

 So, apparently, the issue here is that we can allow three numbers in the
 parameter specification. Thus...

  1:10:2

 This third number, which I will call a "step", seems to mean that 1, 3, 5,
 7, and 9 are allowed, but not 2, 4, 6, 8, or 10.

 I would have imagined the combination of step and bracket to look like
 (1:10):2 or [1:10]:2, i.e. I would have expected the brackets to go around
 the low and high value, and for the step to come after. Experiments
 indicate that the brackets always come at the end. Thus, (1:10:2) or
 [1:10:2].

 Based on the above, I think this regex is the one we want:

  $new_ranges =~ /^("|)[(\[]?(\*|$real)?:(\*|$real)?(:$real)?[)\]]?\1$/))

 If a double quote is present at the beginning, it is required at the end.
 Brackets, if present, go at the start and end of the expression (but
 inside the quotes, obviously). A bare ":" is allowed, and it's the same as
 "*:*".

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1595#comment:16>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list