[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, orherwise if you use a Variable it will be TRUE / FALSE as an integer.
<Var/String> = The regular expression you wish to check for as a variable / string. This can be a variable containing a 'string' or a directly inputed 'string'.
<Var/String> = The variable / string you wish to check if it contains the required regular expression. This can be a variable containing a 'string' or a directly inputed 'string'.
The SE-command itself checks, if the pattern of the regular expression fits to the string:
Look at this to help understand regular expressions.
Example:
$regular.expression = '.ast'
$text = 'fast'
gosub check
$text = 'last'
gosub check
$text = 'nono'
gosub check
return null
check:
if match regular expression: $regular.expression to string $text
| $out = sprintf: fmt='%s matches.', $text, null, null, null, null
| write to player logbook $out
else
| $out = sprintf: fmt='%s doesn't match.', $text, null, null, null, null
| write to player logbook $out
end
endsub
Result:
The first two texts match, while the third doesn't.
Note:
When using this command in languages other than english, you may have problems with using the brackets [] or some of the other special characters. Unfortunatly the only possibility seems to be to either edit the xml-code directly or to use an external script editor, as the internal one can't handle these characters with the wrong keyboard-layout.
Command Location:
- »» General Commands
- »» Strings
<RetVar/IF> = match regular expression: <Var/String> to string <Var/String>
- »» Strings