Hi i want to know if it is possible to replace text with regex and do some math operation.
x10 y10 -> xy20
I would search this with
x(…) y(…)
and replace it with ?
xy($1+$2) ? (don’t know what operation to use)
Hi i want to know if it is possible to replace text with regex and do some math operation.
x10 y10 -> xy20
I would search this with
x(…) y(…)
and replace it with ?
xy($1+$2) ? (don’t know what operation to use)
Regular expressions can’t do this. However, many languages’ regex libraries (such as Python’s) have the ability to pipe the replacement through a function. You could write a plugin.