Name

gensub

Synopsis

gensub( r,s,n,t )

Description

Substitute s for the nth match of regular expression r in the string t. Leave t unchanged, but return new string as the result. If n is “g” or “G” change all matches. If t is not supplied, it defaults to $0.

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.