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
Code:
|Note|Dur:8th,Grace,Slur|Pos:#-1|Opts:Stem=Down,XAccSpace=1,XNoteSpace=1
for three reasons, but is the basis for a regular expression:
Code:
    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
Code:
|Note|Dur:4th|Pos:-2|Opts:Stem=Down
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