Re: sysctl with regex?
- From: Garrett Cooper <yanefbsd@xxxxxxxxx>
- Date: Tue, 9 Feb 2010 16:47:56 -0800
On Feb 9, 2010, at 4:19 PM, David Wolfskill wrote:
On Tue, Feb 09, 2010 at 04:14:12PM -0800, Garrett Cooper wrote:
I'll see if I can whip up a quick patch in the next day or so -- but before I do that, does it make more sense to do globs or regular expressions? There are pluses and minuses to each version and would require some degree of parsing (and potentially escaping).
I believe it's easier to be precise about exactly what is wanted with a
regex (vs. a glob).
On the other hand, globs tend to be "quick & dirty" (in my experience). ;-}
Your doppleganger's Andrew :o?
Regexps have a certain degree of ambiguity with them, as the following is a valid regexp:
Assuming the correct periods are escaped, this would be a minor bug-prone task to complete.
Whereas this form will return different results from what you want most likely (note the subtle difference with the extra period):
Globs in this case don't buy you that much difference for what you want, and (IMO) add unnecessary complexity to the problem as you can still apply basic character classes, et all.
freebsd-hackers@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"