User Tools

Site Tools


19.6.2 Regular Expression

If you translate “regular expression” with elegant panache into “regular expression”, then this, in my opinion, erroneous translation does not bring you forward, whereas you could already imagine something concrete under “(search) pattern built from rules”.

According toärer_Ausdruck … “A regular expression (abbreviated RegExp or Regex) is … in computer science, a string of characters used to describe sets of strings using certain syntactic rules.” Good to know when it comes to checking character strings (strings) or searching for something in them or editing them.

If one extends the placeholder principle, then one can design patterns with which one can describe the structure of strings that fit a whole class of strings. These patterns are called “regular expressions”. A regular expression matches a string if the string is contained in the class of strings characterised by the regular expression. If a given string is contained in a class of strings described by the regular expression, then the regular expression is said to match the string or to have a match. The English match often used in the context of regular expressions obviously characterises exactly this state of affairs.

Regular expressions in Gambas can be used in conjunction with the LIKE operator for ASCII strings. However, if you are testing against UTF-8 strings, you must use the gb.pcre component. Gambas uses regular expressions in the component 'gb.pcre' as Perl Compatible Regular Expressions (PCRE) and with the PCRE a program library for evaluating regular expressions.

According to, the name refers to the fact that the syntax of the expressions was borrowed from the Perl programming language.

See the link for a reference to the syntax of patterns you can use in regular expressions.


The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k19/k19.6/k19.6.2/start.txt · Last modified: 14.10.2023 by emma

Page Tools