Regular Expressions 101

Community Patterns

Help

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(Descrição:.{8})
/
gm

Description

please help

I'm trying to capture some text parts of a PDF. I have a problem and can't solve it.

I need to use a regexReplace, and for that, I need to find the desired item (match), and everything else will be replaced by the match. Using regex101 and the "substitution" function on the left side, I need the result to be "(Descrição:.{8}) ". and all the rest replaced.

I trying to create a group and call it $1 in the substitution tab, but the result has to be only the group.

I am not able to create the rule that selects all the lines and items before and after the match so that all these items (which are in blue) are replaced by what is in green.

Submitted by anonymous - 2 days ago