Closed SlMaker closed 4 years ago
yes - replace leave intact all parts of the input text that are not matched by re - see doc https://regex.sorokin.engineer/en/latest/tregexpr.html#replace-replaceex
But it doesn't make sense for
// valid regex set
expression: '([.-]Test[.-])';
inputText: 'This.Is.A.Test.1234_Test_abc';
substitutionText: '$1';
expectedResult: '.Test.';
matchStart: 0
Why does it fail then?
from docu:
Expression := '((?i)block|var)\s(\s([^ ])\s)\s*'; Replace ('BLOCK( test1)', 'def "$1" value "$2"', True); Returns def "BLOCK" value "test1"
it match .Test.
and replace it with whole match - the same text.
and leave all others intact.
so result should be the same as input string
may be better re would be [.-](Test)[.-]
and result will be
This.Is.ATest1234_Test_abc
1.
Originally posted by @Alexey-T in https://github.com/andgineer/TRegExpr/issues/155#issuecomment-632668019
2.
Testing it on https://regex101.com/r/HblhQF/1 gives also 4 matches: name, empty, ext, empty
\w*
matches any word character (equal to[a-zA-Z0-9_]
)*
Quantifier — Matches between zero and unlimited times, as many times as possiblename match: name.new empty match: .new ext match: ext.new empty match: .new but the dot between new and ext shouldn't be there?