LLL
LLL

Reputation: 1353

How to replace substring in string using pcre library?

for example:

(test)rrr(/test) -> (ll)rrr(/ll)
regexp: ( (test)(.*?)(test) )

Upvotes: 1

Views: 1936

Answers (1)

VGE
VGE

Reputation: 4191

Pcre does not provide a replace out of the shelf for the c API. but the C++ header provide one. You can either use C++ or use this code as an inspiration.

You can also look at some source code using pcre such as the Python source code or Php to implements this missing feature

Upvotes: 1

Related Questions