Skip to content

Language Archiving Technology

Sections
Personal tools
You are here: Home » Tools » Annex/Trova » Annex Online Manual » 3.3.1. Regular expessions

3.3.1. Regular expessions

Document Actions

3.3.1. Regular expessions

Regular expressions allow users to create complicated quaries. Below follows a list of most commonly used regular expressions together with explanations and some potential uses.

  • [abc] means "a or b or c", e.g. query "[br]ang" will match both "adbarnirrang" and "bang"

  • [^abc] means "any character but a,b,c", e.g. query [^aeou]ang will match "rang" but not "baang"

  • [a-zA-Z] means "a charater from a/A through z/Z", e.g. b[a-zA-Z] will match "bang", "bLang" or "baang" but not "b8ng"

  • . means "any character", e.g. "b.ng" will match "bang", "b8ng", but not "baang"

  • X* means "X zero or more times", e.g. "ba*ng" will match "bng", "bang", "baang", "baaang" etc.

  • X+ means "X one or more time", e.g. "ba+ng" will match "bang", "baang" but not "bng"

  • ^ means "the beginning of the annotation", e.g. "^ng" will match "ngabi" but not "bukung"

  • $ means "the end of the annotation", e.g. "ung$" will match "bukung" but not "ngabi"

    Examples

    • ^[pbtd][^aeiou]

      You can use this expression to search for complex onsets. It will find words that start with one of the plosives ("p","b","t","d") followed by a character that is not a vowel ("a","e","i","o","u"). An example of a matching word is "tsakeha"

    • [^n]g$

      You can use this expression in case you want to search for annotations ending with a "g", but not with "ng". In Dutch, you will find "snelweg" and "maandag" as the results but not words as "bang".

    • ^k.+k$

      You can use this expression if you want to search for annotation starting and ending with "k" and with one or more character between them, e.g. "kitik" or "kanak-kanak"

    • ^(.+)\1$

      You can use this expression to search for words that are reduplicated. When you put something in bracketes, you create a variable (.+), which you can refer to as "\1". This expression then searches for an annotation that starts with one or more random characters followed by that same sequence of characters. This expression witll match for instance "kulukulu".

Created by latadmin
Last modified 2012-02-11 00:15
 

Powered by Plone

This site conforms to the following standards: