Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   . . .
   Commands by Topic
      Getting Help
      Moving Around
      Changing Text
      . . .
      Miscellaneous
   Command Reference
      . . .
      redo-movements
      refresh-files
      regex-replace
      regex-search
      release-notes
      . . .
   Variable Reference
      abort-file-io
      abort-file-matching
      abort-key
      . . .
      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. #U forces any following replacement text to uppercase, #L and #C to lowercase or capitalized. #E ends such case modifications; the remaining replacement text will be substituted as-is. #S substitutes the next alternative, when the search pattern consists of simple alternative bits of fixed text separated by |'s. Characters may be included by name in replacement text using the syntax #<Newline>, which substitutes a <Newline> character.

More info:

Replacing
Regular Expressions
Regular Expression Commands



Previous   Up    Next
refresh-files  Command Reference   regex-search


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.