Re: [fpc-pascal] Replacing parts of a string with TRegexpr

2018-02-22 Thread luciano de souza
I am blind and it's not so easy to read the source code with so many comments. Dispite this, I find the method "TRegexpr.replace", accepting as the first argument the input string and the second the template string. The return is what I want. In other words, the problem is solved and anything else

[fpc-pascal] Replacing parts of a string with TRegexpr

2018-02-22 Thread luciano de souza
Hello all, I'd like to replace some part of a string acording to a pattern. I know how to search and print the matches of a ER: program test; {$mode objfpc}{$H+} uses regexpr; var r: TRegexpr; BEGIN r := TRegexpr.create('(\d+)'); try if r.exec('01 Brazil, 02 USA, 03 China') then begin repeat wr