I have a pretty complicated regex that matches multiple lines. As part of this requirement, I need to replace part of the corresponding text with a truncated version. Using the backlink, I get the text, but how to use "string" .replace () to truncate it, for example. only the first 10 characters? Since there can be several matches in a string, I don’t want to manually extract and truncate the text.
source
share