nhrt Q&A

This page contains frequently asked questions on nhrt utility and answers to them. If you could not find an answer to your question please post it using form below.

What kind of regular expressions used in nhrt?

nhreplace utility uses ECMAScript, described in TR1 Regular Expressions.

How to replace tab character with spaces?

Starting of nhreplace v2.7 nhreplace has an option to specify characters by their codes. The example shows how to replace every tab character (specified with set=search escape text, as it contains \xHH characters) with 4 spaces (replacing text specified as static plain text t=text):

nhrplc.exe -set:"\x09" -t:"    " *.cpp

How to get 100 different searches in one program session?

Starting of nhreplace v2.5 nhreplace has an option to specify a list of searches to be made. Batch mode option is -list argument pointing to a file with search list. Please see help topic Batch replace by list for more details.

Is it possible to replace text in the current folder and in its subfolders with only one command?

Starting of nhreplace v2.4 recurse directories option is available with -r argument.

How to delete (not replace) a found text sample?

Delete option specified with -d argument can be used to delete found text.

How to delete repeated new line characters?

When it is needed to delete repeated new line characters search for regular expression -sre:”[\r\n]{2,}” and  replace with single new line -et:”\r\n”.

Same way repeated whilte spaces can be remover from a text. Just use: -sre:\s -t:” “