Feature Request Transform - Replace Pattern to support substitution #11869
aprvital2000
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
transform/replace_pattern
transform/replace_all_patterns
support replacement string, but not substitution.
Ex:-
Input pattern :- testing credit card 1234-5678-9012-3456.
Input replacement :- x-x-x-$4
Expected Output :- testing credit card x-x-x-3456.
Actual Output :- testing credit card x-x-x-$4.
Following is the Golang test program
package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(
(?m)([0-9]{4})[-]*([0-9]{4})[-]*([0-9]{4})[-]*([0-9]{4})
)var str =
testing credit card 1234-5678-9012-3456.
var substitution = "--*-$4"
}
Beta Was this translation helpful? Give feedback.
All reactions