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 failfor three reasons, but is the basis for a regular expression:Code:|Note|Dur:8th,Grace,Slur|Pos:#-1|Opts:Stem=Down,XAccSpace=1,XNoteSpace=1Something that SHOULD pass isCode: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] == "")) {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? TIACode:|Note|Dur:4th|Pos:-2|Opts:Stem=Down


Reply With Quote

Bookmarks