~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to test/gensub.awk

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 09:41:09 UTC
  • Revision ID: git-v1:8c042f99cc7465c86351d21331a129111b75345d
Tags: gawk-3.0.0
Move to gawk-3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BEGIN { a = "this is a test of gawk"
 
2
        b = gensub(/(this).*(test).*(gawk)/, "3 = <\\3>, 2 = <\\2>, 1 = <\\1>", 1, a)
 
3
        print b
 
4
}
 
5
NR == 1 { print gensub(/b/, "BB", 2) }
 
6
NR == 2 { print gensub(/c/, "CC", "global") }