I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using
regexp_replace("zone_nr", '+', ', ')
but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.
Answer
A +
is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a \
in front of it. So you need:
regexp_replace("zone_nr", '\\+', ', ')
No comments:
Post a Comment