NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

12.5.4 Like operator

The Like operator determines whether a string matches a given pattern. Both operands must be of type String. The first operand is the string being matched, the second operand is the pattern to match against. The pattern is made up of Unicode characters. The following character sequences have special meanings:

Two characters in a character list separated by a hyphen (-) specifiy a range of Unicode characters starting with the first character and ending with the second character. If the second character is not later in the sort order than the first character, a runtime error occurs. A hypen that appears at the beginning or end of a character list specifies itself.

Note that to match the special characters left bracket ([), question mark (?), number sign (#), and asterisk (*), they must be enclosed in brackets. The right bracket (]) can not be used within a group to match itself, but it can be used outside a group as an individual character. The character sequence [] is considered to be the string literal "".

Also note that character comparisons and ordering for character lists are dependent on the type of comparisons being used. If binary comparisons are being used, then character comparisons and ordering are based on the numeric Unicode values. If text comparisons are being used, then character comparisons and ordering are based on the current locale being used on the NGWS Frameworks and Runtime.

In some languages, there are special characters in the alphabet that represent two separate characters. For example, several languages use the character "æ" to represent the characters "a" and "e" when they appear together. When using text comparisons, the Like operator recognizes that the single special character and the two individual characters are equivalent. In that case, an occurrence of the single special character in either pattern or string matches the equivalent 2-character sequence in the other string. Similarly, a single special character in pattern enclosed in brackets (by itself, in a list, or in a range) matches the equivalent 2-character sequence in the string.

LikeOperatorExpression ::= Expression Like Expression