Reply To: regexp and null

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf regexp and null Reply To: regexp and null

#58633
Jamin Gray
Participant

    If by null you mean an empty string, you don’t need a regular expression to test this.  You could use the string equal command:

    Code:


    string equal $iam_18 “”

    will return 1 if $iam_18 is “” otherwise it’ll return 0

    If you really want to use a regular expression:

    Code:


    regexp {^$} $iam_18

    I think what your code is doing is checking if the string matches the null character (octal 0 on the ASCII chart), not checking to see if the string is empty.