normally, the 'switch' use looks like this:
<function name="example_1_function">
msg ("Type in 'red', 'blue', or 'yellow', please.")
get input {
// for 'get input', the quest engine automatically (hidden from you) sets a built-in variable: result = your_typed_in_input
// for 'show menu' (if you were to use this instead of the 'get input' thingy), the quest engine automatically (hidden from you) sets a built-in variable: result = your_selected_choice_option
if (result = "red" or result = "blue" or result = "yellow") {
// switch (your_Variable_name: result)
// per case: case (your_individual_Values_for_your_Variable)
// double quotes for String Values
// no double quotes for Object and Integer Values)
// no double quotes on the special~reserved 'true' and 'false' for Boolean Values
switch (result) {
case ("red") {
msg ("You get an apple.")
}
case ("blue") {
msg ("You get a berry.")
}
case ("yellow") {
msg ("You get a banana.")
}
}
} else {
ClearScreen
example_1_function
}
}
</function>
---------------
I'm not sure if there is code to allow the 'switch' to handle dynamic or non-specified~defined Values (this is why I put in the 'if~else' check code lines), as I've still not dabbled in more complex code lines, such as your 'regex', and testing them in such Scripts~Commands~Functions~etc, like the 'switch' thingy.
but, there's always the 'if~if else~else' Scripts for that anyways.
(remember the 'switch' thingy is just a more limited {me assumingly} but more 'user-friendly' design~structure of using multiple 'if~if else~else' Scripts)
-----------
here's link:
http://docs.textadventures.co.uk/quest/ ... witch.html(ah, indeed there's a 'default' option, and I'm sure your 'regex' works too, as you said it does, that your 'switch' code, is functional)
now, I'm confused as to what are you asking about in your OP, lol.