next up previous contents index
Next: Other selections Up: Selection Methods Previous: Comparison selections   Contents   Index

Comparison Operators

There are two types of comparison operators -- numeric and string -- which allow the user to specify the appropriate comparison function. Suppose the segment name, which takes on a string value, contains the names `11', and `8'. VMD cannot figure out if `8' should be less than `11' (in the numeric sense) or greater than `11' (in the lexographical sense). Instead of trying to resolve this problem through some sort of internal heuristics, VMD leaves it up to the user so that 8 < 11 but 11 lt 8. (Perl users should recognize this solution.)

The numeric comparisons are the standard ones: <, <=, = or ==, >=, >, and !=. The corresponding string comparisons are: lt, le, eq, ge, gt, and ne. As in perl there is a ``match'' operator, =~, so that

        'CA' =~ "C.*"
        segname =~ "VP[1-4]" (matches VP1, VP2, VP3, and VP4, present in some
                              virus structures)

are valid. No distinction is made between single and double quotes.