I'm new to bash and I'm trying to do the following - using the select command to choose between options provided as arguments by the user. This is my code:

```
PS3="Select an option: "
select arg in $@; do
    if [[ "$REPLY" -le "$#" && "$REPLY" == ^[0-9]+$ ]]; then
        echo "You picked $arg ($REPLY)."
    else
        echo "Invalid option."
        break
    fi
done

```

I'm using the first condition to test if the input (integer) belongs to the range of options; the second condition is supposed to test if the input is a number. However, I must have an error on the second test, because it always goes into `else` when the input is a valid number.

I've been looking online and I can't find a solution. I've tried using `[` or `(` instead of `[[`, or `<=` instead of `-le`; tried several regular expressions... nothing works. Any help would be appreciated!

Thank you.