In something to read clipboard data from a music notation program, I am not interested in a note if it has the Grace attribute, stem direction is missing, or spacing has already been applied. The following would fail
for three reasons, but is the basis for a regular expression:
    result = lineU[iU].match(/\|Note\|Dur:.*(Grace)?.*Pos:([x#nbv]?)(-?\d*).*Stem=(Up|Down).*(Space=)?/)      // Look for |Note| with Stem=Up specfied, not Grace, no Space=
    if ((result != null) && (result[1] == "") && (result[5] == "")) {
Something that SHOULD pass is
When I ran this in debugging mode, nothing was displayed for result[1] or [5] although result[2] was "" (No accidental). My question is how can I check for empty results in these two positions? TIA