Search and replace with Regular Expressions

In addition to using Search and Replace to find and replace simple strings of text, you can run a more precise search using Regular Expressions (RegEx). RegEx enables you to precisely match a certain pattern in your search.

To use a regular expression when searching, select Regular expression on the Search and Replace dialog box:

Figure: Search and Replace with a regular expression

Instead of string of text, enter a regular expression in the Containing text field.

When using a regular expression, the Case sensitive and Whole word options do not apply as they should be specified using a regular expression.

Attention: Always test regular expressions before using them to search and replace text. Once a Replace operation has taken place, there is no Undo or Rollback function. MadCap Software recommends exporting some test content from IXIA CCMS Desktop to use with testing. (You can download a number of free Find and Replace desktop utilities to use for testing regular expressions.) !

Examples

The following are a few useful RegEx examples.

\b(ixia_locid)( |=)=? ?"\d+\b"
This expression finds all occurrences of the ixia_locid attribute in content, along with values of any number of digits. You can use it to remove these attributes and clean up your content if you have decided not to use autotranslate.
\b(scalefit)(|=)=? ?("yes"|"no")
This expression finds all occurrences of the scalefit attribute on content, along with both "yes" and "no" values. You can use it to remove @scalefit attributes if you want to allow an OT plugin to autoscale large images.
\b(scale)(|=)=? ?"\d+\b"
This expression finds all occurrences of the scale attribute in content, along with values of any number of digits. You can use it to remove @scale attributes if you want to allow an OT plugin to autoscale large images.
/^(https?:\/\/)?([\da-z\.-]+)\.
¶([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
This expression matches all URLs in content.
Note: The paragraph symbol (¶) in the expression is not part of the expression. It is used so that the expression fits in this table. The expression should be entered as a single line with no space.

If you need help writing a regular expression, contact IXIA CCMS Customer Support.

Additional Resources

Here are some good online resources for understanding regular expressions:

Note: These external websites and tools are not affiliated with MadCap Software. MadCap Software is not responsible for the content of these websites or the performance of these tools.

Here are a few useful Find and Replace utilities: