alias hehtest {
var %r = /^[0-9]{1,3}(?:\.\d{1,3}){3}$/
var %t = 17.17.17.17
; Using variables, the first test functions as expected, echoing a 1.
echo -a First test: $regex(%t,%r)
; No variable useage, the exact same plain text as the variables, but fails
; and echos a 0.
; Also, you can not specify a <name> parameter when you do this..
echo -a Second test: $regex(17.17.17.17,/^[0-9]{1,3}(?:\.\d{1,3}){3}$/)
; Almost the split image of above, but we encompas it in (),
; and doing so will echo a 1.
echo -a Third test: $regex(17.17.17.17,/^([0-9]{1,3}(?:\.\d{1,3}){3})$/)
; Now, just going off of assumptions here. I'm assuming it's the "," in {1,3}
; That is causing it to not work. As this fails the test too:
echo -a Alternative: $regex(17.17.17.17,/^[0-9.]{1,}$/)
; And this one passes:
echo -a Next Alternative: $regex(17.17.17.17,/^[0-9.]{11}$/)
}