Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0
Div
Classe2e-refDiv
Rp

The Bridge uses the ICU's Regular Expressions package to compute regular expressions.

This appendix is divided into three parts:

Children Display

Info
iconfalse

The character \ (backslash) has a special meaning for EAL (Bridge Action Language) strings and regular expressions (RE). In EAL strings, it is used to escape single quotes, double quotes and itself. In REs, it is used to escape special characters and also itself. This double function of backslashes leads to three exceptions from the intuitive usage of backslashes if EAL literals are used to define a RE pattern that contains the same escape sequences as used in EAL literals.

The exceptions are:

if RE =  \  \  then  EAL literal = \  \  \  \
if RE =  \ "  then  EAL literal = \  \  \  "
if RE =  \ '  then  EAL literal = \  \ \  '

In all other cases, the EAL literal equals the RE.

For example, the following EAL statement replaces all occurrences of  \ by x. To match a \ in a RE we need the expression \ \. If we use an EAL literal, we need to escape each backslash again, getting:

Code Block
languagenone
set changed = aString.replace("\\\\", "x");
Panel
titleRelated Documentation: