Ignite-UX Custom Configuration files

You can te
st regular expressions against expected data outside of Ignite-UX using grep with the
E
70
option:
# cat data
u1
u12
u123
u1234
U1a
U123456
# cat data | grep -E "^[[:alpha:]][[:digit:]]+[[:digit:]]$"
u12
u123
u1234
U123456
This allows you to have some level of confidence that your regular expression will do what you
want it to.
Another example:
(
_my_command_c_option ! ~ "^[[:alpha:]][[:digit:]]+[[:digit:]]$|root" ) {
error+=”The user name must start with letter followed by only digits”
} else {
note+=”The user name chosen was “ + ${_my_command_c_option}
}
The regular expression above adds
“|root” to one of the previous expressions we’ve looked at,
which matches the user root as well as the other users allowed by the expression. Remember that
the
“|” operator means or and allows you to give multiple regular expressions to match against.
Testing this with grep you can see that this does work:
# cat data
u1
root
u12
u123
u1234
U1a
U123456
# cat data | grep -E "^[[:alpha:]][[:digit:]]+[[:digit:]]$|root"
root
u12
u123
u1234
U123456
70
This option is required as it enables extended regular exrepssions in grep so we can test in exactly the same way that Ignite-UX will
perform its regular expression matching. Without the –E option grep will only use basic regular expression matching. As an alternative to
grep –E you can just use the egrep command.
146