relpipe-data/examples-rename-groups-backreferences.xml
branchv_0
changeset 329 5bc2bb8b7946
parent 244 d4f401b5f90c
equal deleted inserted replaced
328:cc60c8dd7924 329:5bc2bb8b7946
    10 	
    10 	
    11 		<p>
    11 		<p>
    12 			This tool also support regex groups and backreferences. Thus we can use parts of the matched string in our replacement string:
    12 			This tool also support regex groups and backreferences. Thus we can use parts of the matched string in our replacement string:
    13 		</p>
    13 		</p>
    14 		
    14 		
    15 		<m:pre jazyk="bash"><![CDATA[relpipe-in-cli generate r 1 a string "some string xxx_123 some zzz_456 other" \
    15 		<m:pre jazyk="bash"><![CDATA[relpipe-in-cli \
    16 	| relpipe-tr-sed 'r' 'a' '([a-z]{3})_([0-9]+)' '$2:$1' \
    16 	--relation 'r' \
       
    17 		--attribute 'a' string \
       
    18 		--record 'some string xxx_123 some zzz_456 other' \
       
    19 	| relpipe-tr-sed \
       
    20 		--relation 'r' \
       
    21 			--attribute 'a' \
       
    22 			--value '([a-z]{3})_([0-9]+)' \
       
    23 			--replacement '$2:$1' \
    17 	| relpipe-out-tabular]]></m:pre>
    24 	| relpipe-out-tabular]]></m:pre>
    18 		
    25 		
    19 		<p>Which would convert this:</p>
    26 		<p>Which would convert this:</p>
    20 		<pre><![CDATA[r:
    27 		<pre><![CDATA[r:
    21  ╭────────────────────────────────────────╮
    28  ╭────────────────────────────────────────╮