Let's say there is a file with two lines:
xxx123yyy
xxx333yyy
I want to use gensub function, when regexp pattern and replacement are kept in variables. Lets say script looks like this:
BEGIN{
pattern="/^xxx(.+)yyy$/";
output="\\1";
}
{
print gensub(pattern,output,"g",$0);
}
I'd expect...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.