fnr.exe regex capture groups output -


i'm using batch script fnr.exe perform bulk search , replace operations on multiple files, i'm having trouble figuring out how use capture groups in fnr.exe. can use them fine in similar utility called far uses java regex's, far can't run command line, i'm unable automate it. fnr.exe says in it's documentation uses .net regular expressions, , documentation .net regular expressions great when comes how capture group, when comes outputting captured group, it's rather lacking , assumes i'm writing c# or vb code can call things like:

console.writeline("match: {0}", match.value) 

i have bunch of strings following, original string on left , desired replacement string on right:

include "fooprintdriver.h";    |    include "barprintdriver.h"; include "foosearchagent.h";    |    include "barsearchagent.h"; include "fooeventlistener.h";    |    include "bareventlistener.h"; 

in far, find strings on left

foo(.*?)\.h" 

and replace desired string using

bar\1.h" 

where '\1' printdriver or searchagent or eventlistener, when try same thing in fnr.exe, '\1' literally '\1', input , output be:

include "fooprintdriver.h";    |    include "bar\1.h"; include "foosearchagent.h";    |    include "bar\1.h"; include "fooeventlistener.h";    |    include "bar\1.h"; 

anyone know how working in fnr.exe?

i figured out. need use following:

bar$1.h" 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -