Re: Expressions used in scoring

Yngvar Folling (yngvar.folling@login.eunet.no)
Sun, 6 Oct 1996 06:52:51 -0400

In article <rwoVycqUvBBY092yn@login.dknet.dk>,
rundal@login.dknet.dk (Kenn Rundal Soerensen) wrote:
> Is there a place, where you can read about the meaning of the signs used in
> expressions for scoring?
>
> For instance: \ : ; b ^ |

Score files use strings that are either taken literally with no
translation (i.e, no special meaning for any of those characters) or, if
you specify "pattern" as described under "score files" in the
documentation, the strings are taken as regular expressions, as
described under "regular expressions" in the documentation. The docs
also have some examples under the "score files" section.

However, to take those characters you wondered about:

\ is taken together with the next character to form an escape
sequence. \b is an escape sequence that matches anything that
marks the beginning or end of a word, like space, punctuation
marks, the beginning or end of a line. \\ matches a *single*
backslash. In other words, if you're searching for a backslash,
you have to write *two* backslashes in the score file, or else
it will interpret a single backslash as the beginning of an
escape sequence. Just as some examples:

\b in the score file matches a word boundary.
\\b matches the string "\b"
\\\b matches a backslash followed by a word boundary.

\ followed by any character with a special meaning will remove
that special meaning, and match the normal character. So \^
matches ^, and \| matches |.

:, ; and b by themselves (not after \) are taken literally,
matching themselves. As I said, b has a special meaning after
\.

^ matches the beginning of a line.

| takes the string before or after it and matches either one.
So

one|two matches either the string "one" or "two".

Exactly *where* Yarn searches for the string is specified by the keyword
in front of the string.

Yngvar