Skip to main content

Search and Replace Filter

What is it?

The search and replace filter is designed to be able to replace text either in a standard plain text mode or by using PCRE Regex.

How is it used?

Add Filter Crop From Start & End Search & Replace

Add Filter interface in Docparser highlighting 'Search & Replace' option

The search and replace filter is similar to any search and replace field in a text editor. Include a word or string of text you would like to change, then leave the replace field blank if removing, or insert a new word or text string if you would like to replace it.

Search and Replace text fields showing example of replacing text in Docparser

The search and replace filter also has the option to search using a Regular Expression pattern. When creating a pattern to use in Search and Replace groupings can be used to replace back the pattern with different formatting, in a different order, excluding portions etc.

Here is an example where the value is a 10 digit number in the example this will be broken down into 3 groups and replaced back with phone number formatting
Regex pattern example in Docparser highlighting groups for phone number formatting

With the following pattern there are 3 groupings of numbers within brackets, 3 digits, 3 digits, and 4 digits.
/^(\d{3})(\d{3})(\d{4}$)/
Docparser Regex configuration with group pattern for phone number formatting

When using that pattern it can then be replaced back separating the groups, each group would be represented in the replacement pattern as $1, $2, $3. Here is what that would look like:

Replacement field in Docparser showing how to use $1, $2, $3 for formatted output



How to Use the Search and Replace Filter

Was this article helpful?
0 out of 0 found this helpful

Still stuck?

Send us your parser name and a sample document.

Submit a request