Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   . . .
   Commands by Topic
      Getting Help
      Moving Around
      Changing Text
      . . .
      Miscellaneous
   Command Reference
      . . .
      redo-changes
      refresh-files
      regex-replace
      regex-search
      release-notes
      . . .
   Variable Reference
      abort-file-matching
      abort-key
      abort-searching
      . . .
      yank-rectangle-to-corner
   . . .

Previous   Up    Next
refresh-files  Command Reference   regex-search


Epsilon User's Manual and Reference > Command Reference >

regex-replace

Substitute for replace expressions.  Alt-*

This command functions like query-replace, but starts in regular expression mode.

pat1|pat2
matches either pat1 or pat2.

pat*
matches zero or more matches of pat.

pat+
matches one or more matches of pat.

pat?
matches zero or one matches of pat.

[abx]
matches any of the characters a, b, or x.

[^abx]
matches any but a, b, or x.

[a-z3]
matches a, b, c, ... z, or 3.

.
matches any character except newline.

( )
group patterns for +, *, ?, and |.

^
only matches at the beginning of a line.

$
only matches at the end of a line.

<#50>
means the character with ASCII code 50.

%
removes the special meaning from the following character, so that %$ matches only $.

!
marks the end of the match. The command does not change any characters that match the pattern after the exclamation point.

In the replacement text, #1 means substitute the part of the text that matched the first parenthesized pattern piece. For example, using regex-replace to replace "([A-Z][a-z]+)([.!?])" with "#2 ends #1" changes the text "Howard!" to "! ends Howard". #0 means to substitute the whole match.

More info:

Replacing
Regular Expressions



Previous   Up    Next
refresh-files  Command Reference   regex-search


Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.