Abacre Limited We will free your brain by making our smart software

Free newsletter

Subscribe to RSS feeds Abacre Limited News (RSS Feeds)


Affiliate with us and get 30% from reselling by making a simple link to our site!

 

5 cows at Tucows.com!
5 cows at Tucows.com!
5 smileys at Rocket Download!
at Rocket Download!
5 stars at Paul's Picks!
5 stars at Paul's Picks!
View all awards

Advanced Find and Replace
Manual

Search documents with smart queries and batch replace lines of text in multiple files!

AFR works on Windows XP/2003/Vista/2008/Windows 7/8/10 + Install/Uninstall  download itDownload it! (632 KB)

Search multiple documents with queries as with Google and replace entire paragraphs of text!

Advanced Find and Replace allows you to search local documents with queries like in Google and replace entire paragraphs of text. You may specify a mask to  search files with different extensions and then make a query like in Google. For instance, you may search all text, html and RTF files with query:
+"John Smith" resume -salary

Furthermore, you may insert, replace and remove entire fragments of text consisting of more than on line in multiple files. For example, it is very easy to insert JavaScript right after <BODY> tag and then easy update it, insert new or remove from all pages of your site!

This utility also offers a lot of additional functionalities, for instance, using of Perl-style regular expressions, command line parameters, save results in XML, conversion of Perl scripts before porting to Unix platforms and much more.

It works on Windows 95/98/NT/Me/2000.

Table of contents

One page review

What's new

Operations

Find operation

Masks

Search queries

Replace operation

Batch replace operation

Command line parameters

Options

General options

Find options

Replace options

More about deleting of trailing CRLFs

Batch replace options

Regular expressions

Introduction to regular expressions

Regular expression builder

Purchasing and Registration

Purchasing and Registration

Ordering by fax, phone call, wire transfer

Registration instructions

Multi-user licenses

For people using AFR illegally

FAQ

 

One page review

Amount of your documents grows everyday. It becomes most common when you just forget where you place your document, in which folder. Then you usually begin to search your files, sometimes it may take several minutes and you waste your expensive time.

With Advanced Find and Replace you are able to find your documents in seconds. You may specify normal Google's search queries to find the documents. For instance,

+"John Smith" resume -salary (Look at screenshot)

It searches all documents containing the phrase John Smith, not containing word salary, and possibly having word resume. Results are displayed in a nice and usual for Windows file list.

What else designer or programmer is usually doing? Of course, inserting new texts, replacing them by others and even removing. Sometimes you need to change entire paragraphs of text consisting of more than one line.

For instance, it could be a left column menu of your site. In few seconds with Advanced Find and Replace you may change design or colors of this menu for all site. (Look at screenshot). In the same manner your may insert you JavaScript right after <BODY> tag.

An alternative way is to use Styles or Server Side Includes (SSI) technique, but they are not fully and in the same way supported in all platforms and by all browsers.

Finally Advanced Find and Replace represents nice replacement of your standard Find application in Windows. It significantly saves you time, and therefore, you money in mining information from you local machine!

 

What's new

AFR v1.4.2

·        Bug fixed: Confirm before replace option was not recovered with command line params.

·        Bug fixed: Using of char escaping in regular expressions. Now it's possible to use \ escaping in replace part.

·        Bug fixed: long loading of program with enabled Norton Antivirus.

·        Feature: Improved algorithm for file iterations.

·        Feature: Delete several files at one in Search results by pressing Delete button, Shft+Delete and Select+A is also supported.

·        Feature: possibility to search for files that don't include specified keywords.

·        Attention: feature of processing of large files by one line does not work yet.

·        Feature: displaying search information in xml results.

·        Feature: saving state of Search For and Replace With Widths in Batch Replace.

AFR v1.4.1

·        Feature: possibility to specify masks to exclude from search.

·        Bug fixed: confirm before replace did not work properly with regular expressions.

·        Small interface changes for batch replace with RE.

AFR v1.4.0

·        Feature: Perl and Unix style regular expressions were added.

·        Feature: New panel for most common command: search in subfolders, case sensitive and confirm before replace.

·        Bug fixed: AFR did not understand uppercase parameters.

·        Note: in this version we changed registration keys, so if you are registered user and did not receive a new key, please contact us.

AFR v1.3.5

·        Feature: Yes To All and Not To All for replace and batch replace operations.

·        Bug fixed: OR operation did not work correctly.

·        Tiny improvements of interface and documentation.

AFR v1.3.4

  • Feature: Insert text BETWEEN fragments of text. Ex. you can delete code of banners that slightly differs on the pages.
  • Feature: When user deletes file from system by using context menu of AFR, the program also deletes  it from Result list.
  • Feature: Resize batch replace grid when resizing main window.
  • Feature: “Save configuration” command and displaying name of configuration file in title of the program.
  • Bug fixed: AFR v1.3.3 could not work in evaluation mode due to some problems with new protection mechanism.

AFR v1.3.3

  • Feature: Minimize to system tray.
  • Bug fixed: AFR could not search Read-Only files (for instance, files on CDs). This bug was in v1.3.2 only.
  • Bug fixed: in v1.3.2 Replace operation wrote Text to Find in lower case when using not case sensitive mode.

AFR v1.3.2

  • Feature: Work with command line parameters. It allows automating of your business process.
  • Feature: Saving results in XML file with detailed information.
  • Feature: Optimized work with large files. For example, for processing file with size of 100MB, speed is increased in 3.5 times!

AFR v1.3.1

  • Feature: Right clip popup menu as in normal windows explorer.
  • Feature: Import values for Batch replace table from Excel files.
  • Feature: Delete trailing CRLFs.
  • Bug fixed: In batch replace if “Confirm before replace” was checked, AFR could not find files.
  • Bug fixed: In replace operation if “case sensitive” was checked, AFR could not sometimes to find files for replacements.
  • Bug fixed: Sometimes when AFR could not open file it stopped to search rest of the files.

AFR v1.3.0

  • Big feature was added: Batch replace. Now AFR can make batch replacements of several strings in the files. It's very useful when you want to update several hyperlinks in one time or, for instance, translate, C++ files into Pascal files.
  • Feature: Open/Save configuration of the program.
  • Bug fixed: AFR could not search string length of one char.
  • Bug fixed: during file search without query, AFR displayed list of files in Results, but it wrote that found 0 files.

AFR v1.2.4

  • Bug fixed: during replace operations AFR sometimes could not find the strings to replace.
  • Some corrections in documentation and programs interface were made.

 AFR v1.2.3

  • New feature: saving results of find/replace in a file. Just right click on results list and then choose "Save Results". You can save results in the file of different formats: html, txt, csv.
  • Bug fixed: when performing Find operation sometimes there were duplicating files in search results. I was when user specified "duplicating" search mask like *.htm* *.html.

AFR v1.2.2

  • Sorting results by any parameters (date, size, found).
  • Program's interface was corrected for using with large system fonts.

AFR v1.2

  • Drag and Drop files from results window.
  • Small bug in displaying of results was fixed.
  • Small bug on Replace panel were fixed. Now AFR don't raise exception, if it can't open a file.

AFR v1.1:

A lot of bugs were fixed. Now AFR became more stable, robust and fast.

  • Now AFR can search not only documents (html, txt, cpp, java, etc), but also any files, for instance search information inside big *.log files or even executables.
  • Due to word warping, it was not possible to replace WIDE fragments of text. Now this option is switched off and any fragments of text can be replaced.
  • New algorithms of text searching were applied, they are also optimized by assembler code. So AFR 1.1 became in 2.5 times faster!
  • Some problems with searching masks were fixed. With new techniques of searching its even possible just to set *.* mask.
  • AFR 1.0 displayed search results in sorted view only when search was finished. Now it can display results on fly and, after completion of the search, show sorted results.

Find operation

What can you do in normal Find program in Windows? Just find one string in files. But with Advanced Find and Replace you can make normal search queries to gather information. If you are familiar with search queries of Google, Google or Infoseek, you don't need to read this topic. AFR uses language of this search engines.

For instance you may easy make the following query:

+"John Smith" resume -salary (Read more about queries)

Use advanced options to limit your search by file size or changing time.

You may also specify several masks to search your files.

Types of queries:

Native

Native means here that you may use native queries of search engines above. I.e. use search with +,- and double quotes.

AND

All listed words and phrases in the queries MUST present in document.

i.e. if use following query with AND

“Hello world” download program

AFR will transform it into

+“Hello world” +download +program

Note: you can't use AND or OR operators directly in the query. I.e. following query will not work as you want:

“Hello world” AND download AND program

The AND operator here will be used just as a normal word.

For the same reasons you don't need to use + and – . If you use query +hello +world, it finds words +hello and +world, but not hello and world.

OR

AFR will try to find any word contained in query.

So, if you use query

Hello world download program

AFR will try to find at least one of the words Hello, world, download, program.

Phrase

If you need to find long phrase that contains several words, use this type of search.

Sample query:

Hello world download program

In terms of native search it will be transformed internally into one phrase:

“Hello world download program”

Therefore AFR will not try to find words Hello, world, download, program as separate words.

 

See also: Masks | Search queries | Replace operation

Masks

In AFR your may use a combination of normal Windows mask separated by spaces or/and columns.

For instance, the following masks are correct:

*.html *.htm *.asp

*.html;product??.txt

*.txt; index.htm manual*

In other words you may freely use * and ? characters in the masks.

Note, if you need to exclude some masks, you have to put “-“ ahead of it.

*.*; -*.css; -*.exe

This search all files, except *.css and *.exe files.

 

See also: Search queries | Find operation

Search queries

If you use Google or Infoseek for long time, you can use Advanced Find and Replace right now to search your documents. For instance, you may put the following query:

+"John Smith" resume -salary

For those who does not know Google query language we just shortly mentions about it.

In AFR you may use words or phrases. To specify a phrase use quotes. A phrase may consist of several words or just has one word. And you may put any combinations of + or - chars in a phrase.

Examples of phrases:

"Hello World"

"2+2=4!"

Examples of words:

Hello World 2 4

Note: this query consists of 4 words.

If you are sure that document you are searching MUST have a word or a phrase, put the + before it.

If you a words MUST NOT be in the document, use -. Anyway, if you are not sure, use query without - or + it will mean these words are POSSIBLE for files.

Note: don't put common used words, for instance, OR, NOT, A in a query.

It is better specify the query: "Advanced Find and Replace" than just Advances Find and Replace. Because AND maybe found in many documents and distort results of your search.

If you just want to search files with given masks, don't put any query (put empty query). It will be equivalent to you normal Find procedure in Windows.

See also: Masks | Find operation

Replace operation

With Advanced Find and Replace you are still able to make normal one-string replacements. But it also offers a possibility to replace entire paragraphs of text.

You may insert you Java script right after the </BODY> or any other text.

For instance, you have the document:

<HTML><BODY>

<P>Hello World</P>

</BODY></HTML>

Note: please, use Ctrl-C, Ctrl-V for clipboard operations for copying text from source file and inserting text in Text to Find and Replace by Text fields from clipboard. If you type several lines of text manually, you have big chance make an error and AFR may not find text for replacements.

You may perform the following actions with this document:

Replace

For instance, replace text Hello World by Good morning World!

Insert before

For instance, insert two strings right before <P>Hello:

<H1>Advanced Find and Replace</H1>

<H2>A Test</H2>

Then you will get the document:

<HTML><BODY>

<H1>Advanced Find and Replace</H1>

<H2>A Test</H2>

<P>Hello World</P>

</BODY></HTML>

Insert after

For instance insert the same text after <P>Hello World</P>, then you will get:

<HTML><BODY>

<P>Hello World</P>

<H1>Advanced Find and Replace</H1>

<H2>A Test</H2>

</BODY></HTML>

Insert between

This can be very useful when you need to replace some fragment of text between other fragments.

For instance you have banners on your pages. The code in the banners is slightly different in the pages.

<!-- banner begin -->

banner's code

<!-- banner end -->

So put <!-- banner begin --> in Text to Find, new banner's code into Replace/Insert by Text and <!-- banner begin --> into Ending With.

AFR will replace your old banner's code by new one.

Tip: if you need to delete all your banners, make two steps:

1.      Insert between with empty Replace/Insert by Text field.

2.      Delete operation, where you put result of the operation in first step.

 

Delete

Use it to delete the text specified in Text to Find field.

Just Find

This maybe used to find several lines of text in the document. It just finds it and shows in search results. It does not make any changes in the source documents.

It's very useful perform Just Find operation before Replace/Insert/Delete operations. Only when Just Find shows correct list of files where you want to make changes, then you are sure and you may perform Replace/Insert/Delete.

Note: You may use Case sensitive option. For instance, use may uncheck this option and specify just hello world text in previous examples.

See also: Replace options | Find operation

Operation Batch Replace

This advanced feature allows to make several replacements in the file at one time.

For instance, it's possible to make a simple pre-convector from C++ to Delphi.

For that we may specify:

Search for

Replace with

{

Begin

}

End

 ||

Or

 &&

And

 Return

Result:=

And then by pressing Execute button, AFR will find files with strings Search for and will replace all these strings with Replace with strings.

According to this example it will find all { chars in current file and replace it by begin string, then it will find all } and replace it by end string. It will be continued with all strings in the table. After completion of all replacement AFR will save modified file and it will start to make batch replacement in next matching file.

This feature is extremely useful for batch updating of hyperlinks of the pages of your site. Due to super optimized replacement operations, AFR make it very quickly.

Note: you may save table of replacements in configuration file. Use Save Configuration As option and then reload it by Open Configuration.

Import values from file

Sometimes when you enter a lot of strings for replacements it is very easy to create it by Excel or another editor and then import it to the table.

Before importing AFR will ask you for confirmation to delete all rows from the table and then create new table with values from the file.

AFR supports following file formats for importing:

·        CSV (Comma delimited) (*.csv) This is standard comma separated format, strings in this file look like: “hello world”,test.

·        CSV (Semicolon delimited) (*.csv) Some versions of Excel save CSV files with semicolon separator, although Excel call them “Comma delimited”.

·        Text (Tab delimited) (*.txt) If you have any troubles with first two formats, use Tab delimited format, it will always work. Here colons of the table are separated by tab char.

See also: batch replace options, replace operation

 

Command line parameters

 

AFR allows working with command line parameters. It could be helpful if you use AFR inside of one automation process.

 

Format:

afr.exe –min –execute:find|replace|batch config  file_name -result  file_name -format:tab|comma|space|html -exit

All parameters in the format are optional. Use lower case only to for parameter' names and values except of file names. I.e. –min and –Min are different.

If you need more functionality for work with command line parameters, please, contact us: support@abacre.com

 

 

Example:

afr –execute:find –config c:\afr\mybatch.cfg –result c:\afr\results.csv –format:comma

 

This will start AFR and perform find operations with parameters from mybatch.cfg file and save result list of files into results.csv as comma separated file.

 

 

List of parameters:

 

-min

Program will start in minimized state.

Default: off.

 

-execute:find | replace | batch

Execute one of basis operations of AFR. Please, type operation type right after column (:) without any spaces. You can specify only one operation here.

Example: -execute:find

Default: if this option is not specified, when the program will start, it will not perform any operation.

 

-config  file_name

Specify name of the configuration file that will be loaded.

 

Example: -config “c:\Program Files\AFR\CppToPascal.cfg”

 

Note: that it should be the full path to the configuration file. If the file name has spaces as in the example above, use double quotes.

Default: the program will load its settings from registry as it is normally started without command line commands.

 

-result  file_name

Specify name of the file, where results of replacements will be stored.

Default: if you don't specify this parameter, AFR will not save search results.

Note: that directory, where you save the results, must already exist.

 

-format:tab | comma | space | html

Specify format of the file for results.

  • xml – xml file.
  • html – html file with results as a table.
  • tab – tab delimited file.
  • comma delimited file.
  • space – space delimited file.

Default: tab

 

-exit

The program will terminate its work, when the execute command will be processed.

Default: off.

 

 

General options

Search in subfolders

By checking this options the AFR will search also in subfolder. By default it is checked, it is common used variant and therefore it is placed quite far from the main window, into the options dialog.

Show file description

By default this options is also checked. But often you don't need to see that txt is a Text File and so on. So you can easily uncheck this option.

When you press Clear button, you may tune the program in such way that it will clear Search Query (in Find operation) or/and text fields (in Replace operation). Check correspondingly Clear Search Query and Clear text fields (Find and Replace) options.

If you would like don't show Help button in main window, uncheck Show Help button in main window option. This Help button is primary used to stimulate new users read the help. For advanced users the button might looks overloading main window.

Minimize to tray is simple, but quite useful feature if you use AFR very often.

See also: Find options | Replace options | FAQ

Find options

Case sensitive – make search engine sensitive both for words and phrases. By default search in AFR is not case sensitive. For instance, it could be useful don't consider case both for words and phrases.

You may also limit you search results with Show not more than option, or use Show all results options to show all files matching your query.

Sort by number of found words option allows to sort results by frequencies of search words in the query. If you switch off this option, results will display files in the order how they found.

See also: General options | Replace options | FAQ

Replace options

Confirm before action (replace/insert/delete)

Check it to show alert before an action with file.

Save as Unix files

You might know that Unix files use just 0x10 char as a separator for new line operation. But in MS DOS and Windows they use a pair 0x13 0x10. So when porting you files, for instance, Perl scripts, you may have difficulties with understanding your scripts by Unix platform.

When you check this options, AFR will save changed files with just 0x10 char as the new line separator and your scripts will be understandable for Unix!

Delete trailing CRLFs

One of the most often problems why AFR can't find text that you specify is trailing CRLFs at the end of  “Text to Find” and “Replace by Text”.

When this option is checked, AFR will delete trailing spaces at the end of the texts for replacements. If it is unchecked, it AFR will use exactly the same text as you typed.

We understand importance of this feature, therefore we wrote even special chapter for that. Read more about deleting of trailing CRLFs.

See also: General options | Find options | FAQ

 

More about deleting of trailing CRLFs

One of the most often problems why AFR can't find text that you specify is trailing CRLFs at the end of  “Text to Find” and “Replace by Text”.

Lets make a little vocabulary:

[CRLF] – caret + line feed, normally these two chars are inserted when you press Return (Enter) button.

[Cursor] Position of cursor in text.

[Space] – space char.

Suppose, you would like to find paragraph of text consisting of just two lines:

Variant 1:

Sentence #1 here[CRLF]

Sentence #2 here[Cursor]

In fact you represent this paragraph like this, but indeed you may enter it in this way, if you will press Return at the end of last line:

Variant 2:

Sentence #1 here[CRLF]

Sentence #2 here[CRLF]

[Cursor]

or even if you press Return twice it will be like this:

Variant 3:

Sentence #1 here[CRLF]

Sentence #2 here[CRLF]

[CRLF]

[Cursor]

So when you supposed first variant, AFR will search for second or third and will not find the text that you want. Therefore we have added “Delete trailing CRLFs” option. When this option is checked event if you typed as in Variant 3, AFR will delete trailing CRLFs and transform it to Variant 1.

Another often problem is when you place unwanted spaces at the end of your text. Suppose that you want to replace text as in Variant 1. If you occasionally entered spaces at the end or the lines it might look like this:

Variant 4:

Sentence #1 here[Space] [Space] [CRLF]

Sentence #2 here[Space] [Cursor]

Therefore be careful and delete these spaces.

 

See also: General options | Find options | FAQ

Batch Replace options

Confirm before batch replace

Check it to show alert before an action with file.

Save as Unix files

You might know that Unix files use just 0x10 char as a separator for new line operation. But in MS DOS and Windows they use a pair 0x13 0x10. So when porting you files, for instance, Perl scripts, you may have difficulties with understanding your scripts by Unix platform.

When you check this options, AFR will save changed files with just 0x10 char as the new line separator and your scripts will be understandable for Unix!

For regular expressions modifiers, please see regular expressions syntax.

Note, when Use regular expressions is checked, case sensitive flag is defined by modifier I and not by case sensitive checkbox on front panel.

 

See also: regular expressions

Regular expressions

 

Introduction to regular expressions

Regular expressions are the most powerful feature of AFR. Our program supports Perl-style regular expressions.

With regular expressions you can make any complex replacements of text. Work with RE is easy and it is an art. But it can not be fully described in scope of this tutorial. Therefore we recommend you to buy some good books about RE.

When it's better to use regular expressions?

Use RE when :

-         Need to perform complex replacements.

-         Make replacements with special characters.

When it's better to NOT use regular expressions?

Replacements with RE is a very time expensive process. So, when it's possible it is better not to use it. In AFR we have a very optimized literal replacement algorithm. For that reason if you need to replace one string of text by another, use normal literal replacements (uncheck Use regular expressions).

Note: be very careful with regular expressions and make test replacement using RE Builder and than try it on backup versions of your files. Only it you are sure that it works perfectly on backup versions, use it with real files.

 

See also: syntax of regular expressions, regular expression builder

 

Syntax of regular expressions

 

As RE engine we use open source engine of Andrew Sorokin (http://anso.virtualave.net). It is very well done and tested engine. In this topic we reproduce some parts of his documentation with slight corrections.

Simple matches

Any single character matches itself, unless it is a metacharacter with a special meaning described below. A series of characters matches that series of characters in the target string, so the pattern "test" would match "test'' in the target string.

Beside that you can use metacharacters or escape sequences to be interpreted literally by 'escaping' them by preceding them with a backslash "\", for instance: metacharacter "^" match beginning of string, but "\^" match character "^", "\\" match "\" and so on.

Examples:

  foobar          matchs string 'foobar'

  \^FooBarPtr     matchs '^FooBarPtr'

Escape sequences

Characters may be specified using a escape sequences syntax much like that used in C and Perl: "\n'' matches a newline, "\t'' a tab, etc. More generally, \xnn, where nn is a string of hexadecimal digits, matches the character whose ASCII value is nn. If you need wide (Unicode) character code, you can use '\x{nnnn}', where 'nnnn' - one or more hexadecimal digits.

  \xnn     char with hex code nn

  \x{nnnn} char with hex code nnnn (one byte for plain text and two bytes for Unicode)

  \t       tab (HT/TAB), same as \x09

  \n       newline (NL), same as \x0a

  \r       car.return (CR), same as \x0d

  \f       form feed (FF), same as \x0c

  \a       alarm (bell) (BEL), same as \x07

  \e       escape (ESC), same as \x1b

Examples:

  foo\x20bar   matchs 'foo bar' (note space in the middle)

  \tfoobar     matchs 'foobar' predefined by tab

Character classes

You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list.

If the first character after the "['' is "^'', the class matches any character not in the list.

Examples:

  foob[aeiou]r   finds strings 'foobar', 'foober' etc. but not 'foobbr', 'foobcr' etc.

  foob[^aeiou]r  find strings 'foobbr', 'foobcr' etc. but not 'foobar', 'foober' etc.

Within a list, the "-'' character is used to specify a range, so that a-z represents all characters between "a'' and "z'', inclusive.

To use  "-'' itself to as a member of a class, put it at the start or end of the list, or escape it with a backslash. If you want ']' you may place it at the start of list or escape it with a backslash.

Examples:

  [-az]      matchs 'a', 'z' and '-'

  [az-]      matchs 'a', 'z' and '-'

  [a\-z]     matchs 'a', 'z' and '-'

  [a-z]      matchs all twenty six small characters from 'a' to 'z'

  [\n-\x0D]  matchs any of #10,#11,#12,#13.

  [\d-t]     matchs any digit, '-' or 't'.

  []-a]      matchs any char from ']'..'a'.

Metacharacters

Metacharacters are special characters which are the essence of Regular Expressions. There are different types of metacharacters, described below.

Metacharacters - line separators

  ^      start of line

  $      end of line

  \A     start of text

  \Z     end of text

  .      any character in line

Examples:

  ^foobar     matchs string 'foobar' only if it's at the beginning of line

  foobar$     matchs string 'foobar' only if it's at the end of line

  ^foobar$    matchs string 'foobar' only if it's the only string in line

  foob.r      matchs strings like 'foobar', 'foobbr', 'foob1r' and so on

 

The "^" metacharacter by default is only guaranteed to match at the beginning of the input string/text, the "$" metacharacter only at the end. Embedded line separators will not be matched by "^'' or "$''.

You may, however, wish to treat a string as a multi-line buffer, such that the "^'' will match after any line separator within the string, and "$'' will match before any line separator. You can do this by switching On the modifier /m.

The \A and \Z are just like "^'' and "$'', except that they won't match multiple times when the modifier /m is used, while "^'' and "$'' will match at every internal line separator.

The ".'' metacharacter by default matches any character, but if you switch Off the modifier /s, then '.' won't match embedded line separators.

Our RE engine works with line separators as recommended at www.unicode.org ( http://www.unicode.org/unicode/reports/tr18/ ):

 "^" is at the beginning of a input string, and, if modifier /m is On, also immediately following any occurrence of \x0D\x0A or \x0A or \x0D (if you use Unicode version of RE engine, then also \x2028 or  \x2029 or \x0B or \x0C or \x85). Note that there is no empty line within the sequence \x0D\x0A.

"$" is at the end of a input string, and, if modifier /m is On, also immediately preceding any occurrence of  \x0D\x0A or \x0A or \x0D (if you use Unicode version of RE engine, then also \x2028 or  \x2029 or \x0B or \x0C or \x85). Note that there is no empty line within the sequence \x0D\x0A.

"." matchs any character, but if you switch Off modifier /s then "." doesn't match \x0D\x0A and \x0A and \x0D (if you use Unicode version of RE engine, then also \x2028 and  \x2029 and \x0B and \x0C and \x85).

 Note that "^.*$" (an empty line pattern) does not match the empty string within the sequence \x0D\x0A, but matchs the empty string within the sequence \x0A\x0D.

Metacharacters - predefined classes

  \w     an alphanumeric character (including "_")

  \W     a nonalphanumeric

  \d     a numeric character

  \D     a non-numeric

  \s     any space (same as [ \t\n\r\f])

  \S     a non space

You may use \w, \d and \s within custom character classes.

Examples:

  foob\dr     matchs strings like 'foob1r', ''foob6r' and so on but not 'foobar', 'foobbr' and so on

  foob[\w\s]r matchs strings like 'foobar', 'foob r', 'foobbr' and so on but not 'foob1r', 'foob=r' and so on

RE engine uses properties SpaceChars and WordChars to define character classes \w, \W, \s, \S, so you can easely redefine it.

Metacharacters - iterators

Any item of a regular expression may be followed by another type of metacharacters - iterators. With this metacharacters you can specify number of occurences of previous character, metacharacter or subexpression.

  *      zero or more ("greedy"), similar to {0,}

  +      one or more ("greedy"), similar to {1,}

  ?      zero or one ("greedy"), similar to {0,1}

  {n}    exactly n times ("greedy")

  {n,}   at least n times ("greedy")

  {n,m}  at least n but not more than m times ("greedy")

  *?     zero or more ("non-greedy"), similar to {0,}?

  +?     one or more ("non-greedy"), similar to {1,}?

  ??     zero or one ("non-greedy"), similar to {0,1}?

  {n}?   exactly n times ("non-greedy")

  {n,}?  at least n times ("non-greedy")

  {n,m}? at least n but not more than m times ("non-greedy")

So, digits in curly brackets of the form {n,m}, specify the minimum number of times to match the item n and the maximum m. The form {n} is equivalent to {n,n} and matches exactly n times. The form {n,} matches n or more times. There is no limit to the size of n or m, but large numbers will chew up more memory and slow down r.e. execution.

If a curly bracket occurs in any other context, it is treated as a regular character.

Examples:

  foob.*r     matchs strings like 'foobar',  'foobalkjdflkj9r' and 'foobr'

  foob.+r     matchs strings like 'foobar', 'foobalkjdflkj9r' but not 'foobr'

  foob.?r     matchs strings like 'foobar', 'foobbr' and 'foobr' but not 'foobalkj9r'

  fooba{2}r   matchs the string 'foobaar'

  fooba{2,}r  matchs strings like 'foobaar', 'foobaaar', 'foobaaaar' etc.

  fooba{2,3}r matchs strings like 'foobaar', or 'foobaaar'  but not 'foobaaaar'

A little explanation about "greediness". "Greedy" takes as many as possible, "non-greedy" takes as few as possible. For example, 'b+' and 'b*' applied to string 'abbbbc' return 'bbbb', 'b+?' returns 'b', 'b*?' returns empty string, 'b{2,3}?' returns 'bb', 'b{2,3}' returns 'bbb'.

You can switch all iterators into "non-greedy" mode (see the modifier /g).

Metacharacters - alternatives

You can specify a series of alternatives for a pattern using "|'' to separate them, so that fee|fie|foe will match any of "fee'', "fie'', or "foe'' in the target string (as would f(e|i|o)e). The first alternative includes everything from the last pattern delimiter ("('', "['', or the beginning of the pattern) up to the first "|'', and the last alternative contains everything from the last "|'' to the next pattern delimiter. For this reason, it's common practice to include alternatives in parentheses, to minimize confusion about where they start and end.

Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foo|foot against "barefoot'', only the "foo'' part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.)

Also remember that "|'' is interpreted as a literal within square brackets, so if you write [fee|fie|foe] you're really only matching [feio|].

Examples:

  foo(bar|foo)  matchs strings 'foobar' or 'foofoo'.

Metacharacters - subexpressions

The bracketing construct ( ... ) may also be used for define r.e. subexpressions (after parsing you can find subexpression positions, lengths and actual values in MatchPos, MatchLen and Match properties of RE engine, and substitute it in template strings by RE engine.Substitute).

Subexpressions are numbered based on the left to right order of their opening parenthesis.

First subexpression has number '1' (whole r.e. match has number '0' - You can replace it as '$0' or '$&').

You may use this subexpresions in replace by text of our program.

Examples:

  (foobar){8,10}  matchs strings which contain 8, 9 or 10 instances of the 'foobar'

  foob([0-9]|a+)r matchs 'foob0r', 'foob1r' , 'foobar', 'foobaar', 'foobaar' etc.

Metacharacters - backreferences

Metacharacters \1 through \9 are interpreted as backreferences. \<n> matches previously matched subexpression #<n>.

Examples:

  (.)\1+         matchs 'aaaa' and 'cc'.

  (.+)\1+        also match 'abab' and '123123'

  (['"]?)(\d+)\1 matchs '"13" (in double quotes), or '4' (in single quotes) or 77 (without quotes) etc

Modifiers

Modifiers are for changing behaviour of RE engine.

There are many ways to set up modifiers.

Any of these modifiers may be embedded within the regular expression itself using the (?...) construct.

Also, you can assign to appropriate RE engine properties (ModifierX for example to change /x).

i

Do case-insensitive pattern matching (using installed in you system locale settings), see also InvertCase.

m

Treat string as multiple lines. That is, change "^'' and "$'' from matching at only the very start or end of the string to the start or end of any line anywhere within the string, see also Line separators.

s

Treat string as single line. That is, change ".'' to match any character whatsoever, even a line separators (see also Line separators), which it normally would not match.

g

Non standard modifier. Switching it Off you'll switch all following operators into non-greedy mode (by default this modifier is On). So, if modifier /g is Off then '+' works as '+?', '*' as '*?' and so on

x

Extend your pattern's legibility by permitting whitespace and comments (see explanation below).

The modifier /x itself needs a little more explanation. It tells the RE engine to ignore whitespace that is neither backslashed nor within a character class. You can use this to break up your regular expression into (slightly) more readable parts. The # character is also treated as a metacharacter introducing a comment, for example:

(

(abc) # comment 1

  |   # You can use spaces to format r.e. - RE engine ignores it

(efg) # comment 2

)

This also means that if you want real whitespace or # characters in the pattern (outside a character class, where they are unaffected by /x), that you'll either have to escape them or encode them using octal or hex escapes. Taken together, these features go a long way towards making regular expressions text more readable.

 

See also: regular expression builder, introduction to regular expressions

Regular expression builder

Regular expression builder allows to easy create and test regular expressions for batch replace operation.

With Replace All button you it replaces all strings given by regular expression with text specified Replace by text.

Result will be displayed in Result text after transformation.

 

See also: syntax of regular expressions, introduction to regular expressions

Purchasing and Registration

Evaluation period for Advanced Find and Replace is 21 days, after that time you should purchase it from one of our resellers or remove the program.

The registration fee is only $29.00 US dollars or equivalent about in EURO. PayPro Global uses secure web server for credit cards operations. It accepts almost all kind of cards. It is really fast, safe and reliable method of registration. Besides that you may use other traditional registration ways (credit card, fax , phone call, wire transfer etc).

Furthermore, with PayPro Global you may walk through registration procedure with 4 languages, just choose your native!

Please, purchase Advanced Find and Replace with PayPro Global:

For personal use: Advanced Find and Replace Personal, $29.99 (English, German, French, Spanish, Italian, Portuguese)

For use at work: Advanced Find and Replace Professional, $39.99 (English, German, French, Spanish, Italian, Portuguese)

Are you corporate user? Look at the price table with great discounts for multiple licenses!

Not sure about quality of the program? Look at our awards, what other users are talking and read our company policy.

You can also find latest information about registration at our home site.

When you will register our program, please read registration instructions about entering reg key.

Enjoy using our software!

Ordering by fax, phone call, wire transfer

You can register for a program online, by email, fax or telephone. We need your postal and email address, the program name or program order number and your chosen payment option.

Payment is accepted by credit card (Visa, Diner s Club, American Express, Mastercard/Eurocard), by wire transfer to our German bank, by check or in cash. Postal money orders are accepted only in the US office and only if they are made out in US$. Please don't effect any payment before you have sent us your program order! You will receive an order confirmation after your order has been accepted. This confirmation includes all the necessary payment information.

Delivery will be effected after receipt of payment. Via email you will receive either the full version of the program, a download link or a registration key which will unlock the version you can download from the internet.

Please find below our addresses:

US OFFICE (for customers from the USA or Canada):
PayPro Global Inc.
Po Box 844
Greensburg PA 15601
Phone: (724) 850-8186
Fax:   (724) 850-8187

German Office (for customers from all other countries):
PayPro Global
element 5 AG
Barthonia Forum
Vogelsanger Strasse 78
50823 Cologne
Germany
Phone: +49-(0) 221-31088-20
Fax:   +49-(0) 221-31088-29

 

 

Registration instructions

 

After purchasing of Advanced Find and Replace at our registration services you will receive registration key by e-mail in the same business day.

 

Normally reg key looks like:

 

JKJjjkjHHh444JJJkkkkdsdsdsd

Kkkqsds66sdsdsdqsqsdqsdfqsd

Eezezezdsdsdsd6655LjkdsjjJjjds

SSQSsqsqsqeeeddrggfsfdqsq

 

(This is NOT an actual key, sorry)

 

Make following actions:

    1. Copy this paragraph of text from your mail to clipboard (Normally use Crtl-C)
    2. Go to menu Help->Register
    3. Use “Paste” button to paste reg key from clipboard.
    4. Press “Register” button.
    5. Small window will appear with congratulations of your registration. Press “OK” button.
    6. Close and start again AFR.

 

When you will restart the program information about trial period will disappear and in About window you will see that AFR is registered for your name.

 

If it does not work, make sure that you correctly copied the key to clipboard and then pasted it.

 

 

Multi-user licenses

More than 50% of users of Advanced Find and Replace are corporate users. AFR became very popular search tool among small and middle size companies. We are glad to offer the great discounts for our corporate customers.

Number of licenses

Price for each license

Buy link

1

29$

Buy now!

2 - 9

26$

Buy now!

10 - 24

23$

Buy now!

25 - 49

21$

Buy now!

50 - 99

19$

Buy now!

100+

16$

Buy now!

site license

1699$

Buy now!

For instance, if you would like to buy 15 licenses, this will cost only 15*23=345$ and you safe 15*(29-23)=90$!

Note: you may order the program not only by credit card, but also by any convenient way for you: phone call, fax, check etc. Please, click buy now link and read information how to order the program by your favorite way.

 

For people using AFR illegally

 

During more than one year of existence, Advanced Find and Replace became very popular among webmasters and programmers. Hundreds of people use registered versions of AFR, but still thousands use illegal, corrupted by cracks versions of the program.

 

This is a short message for people who still use unregistered version of AFR. Since v1.3.1 our program uses strongest protection algorithm, during more than one year the programs using the same protection mechanism still were not cracked. It means that you have just possibility to use old versions of AFR or register your own version and become registered user.

 

Registration of one license costs only 29$, believe me, it costs one good dinner at a good restaurant, but once purchased version of our program will save your enormous amount of time and will give your hundreds of free hours.

 

With registered version you will get:

  • Fast support and answers of your technical questions. Normally we answer on all customers' questions during one business day.
  • Realization of additional features that still don't present in current version. Our customers supposed about 40% of all features in current version of AFR. So, if you think that you need some feature that does not exist in AFR let us know and we will implement it.
  • Newsletter with information about new versions of the program and tips and tics about using it.
  • You will support further developments of the program and let us know that AFR is really useful for you.
  • Note, that you register AFR only once and you will never pay for upgrades of this program!

 

 

We hope that you will become our new customer and will continue to use Advanced Find and Replace.

 

 

FAQ

Can I use AFR for searching of MS Word files?

Can I use wildcards (regular expressions) in AFR?

I have difficulties with displaying my national chars in Query of Replace text. What should I do?

Why I don't see the standard context menu when I right click in results?

Why do you use 2 resellers?

What does it mean the Found field in search results?

 

Can I use AFR for searching of MS Word files?

The answer is yes, you can use AFR to search (not replace) MS Office 97/2000 documents, if your documents contain Latin only chars. So if you are in US/UK you can easily use AFR to search all MS Office docs of all versions.

Why? If you use some non-Latin chars in your document, this document will be saved in Unicode format that is represented by 2 bytes. Furthermore in MS Word 6 docs they sometimes of use RTF format and for non-Latin chars it is quite tricky.

Note: in current version of AFR you cannot replace text inside of MS Word documents, it will damage makeup structure of the docs.

Probably in next version of AFR we will make support of search of MS Office docs and possibility to make replacement operations.

Can I use wildcards (regular expressions) in AFR?

Yes, definitely. Since version 1.4.0 you can use standard Perl-style regular expressions.

I have difficulties with displaying my national chars in Query of Replace text. What should I do?

Go to Options window and change font's charset into your national.

Why do you use 2 resellers?

We use it for reliability reasons. Sometimes due to servers malfunctions they can be unreachable for customers. They you may just tray another reseller. For the same reasons, we use 2 mirrors of our site:

https://www.abacre.com and http://abacre.net

 

What does it mean the Found field in search results?

It depends on the operation you perform. So, if you make Find operation, in the Found field will be displayed sum of numebr of search words and phrases found in a file. While in Replace operation it will contain number of Text to Find fragments found in a file, and therefore replace/insert/delete operations with these fragments.

See also:
Awards
About us
Buy it
Downloads

What people are saying:
"Advanced Find and Replace is an incredible web admin tool. Both me and my database admin guy use it all the time. It has saved us many hours of work when it comes to making numerous changes to many .asp pages on our internal intranet site. Thank you for a really super product."

Terry Babin
Web Administrator
xwave ICSC Moncton New Brunswick, Canada

Read more

Major clients:
NASA,
PHILIPS,
Siemens,
Yahoo! Inc.,
ZDNet

Read more