Wildcards¶
To start, open the Style Sheet Editor.
Find¶
The Wildcards tab works in a similar way to the Always Find tab:
Type the word or phrase that PerfectIt should look for in the box labelled PerfectIt should warn if it finds the phrase.
Type the preferred form in the If it finds the phrase, it should suggest: box.
The Wildcards tab is shown below:
The difference between this tab and the Always Find tab is that here wildcard characters are allowed. This makes it easier to check for a wide range of results without entering one item per line. For example, it makes it easy to search for patterns such as ranges or words that have variations (such as plurals).
The choice of wildcards is identical to the wildcards that Word uses. These are explained here. Some of the most important characters are:
To find
Type
Example
One character
?
b?d finds ‘bed’ and ‘bad’
Any number of characters
*
b*d finds ‘bad’ and ‘backed’
A match at the beginning of a word
<
<draw finds ‘draw’ on its own and as part of ‘drawer’, but not if it’s part of ‘redraw’
A match at the end of a word
>
ting> finds the ‘ting’ in ‘wanting’, but not in ‘tingle’
One of a specific group of characters
[ ]
s[ea]t finds ‘set’ and ‘sat’ but not ‘seat’ or ‘sit’
At least n matches of the previous expression
{n,}
bl(e){1,}d finds ‘bled’ and ‘bleed’
Between n and m matches of the previous expression
{n,m}
(XX){1,3} finds ‘XX’, ‘XXXX’ and ‘XXXXXX’
You can access these expressions in the Wildcards tab using the dropdown titled Special Character. You can also access a variety of other characters in that dropdown that may not be supported by your keyboard.
Preferred Term¶
It’s possible to enter specific Preferred terms in the same way that you would in the Always Find tab. However, there is one more option available in the Wildcards tab: for your Preferred term, you can use the \𝘯
wildcard to search for an expression and then replace it with the rearranged expression. For example, in the box next to PerfectIt should warn if it finds the phrase: type ([0-9]{1,2}) (December)
and in the box next to If it finds the phrase, it should suggest: type \2 \1
. The placeholders \1
and \2
refer to the terms in parentheses, with \1
being the first set of parentheses, \2
being the second and so forth, so this example will find ‘25 December’ and replace it with ‘December 25’.
Adding Instructions¶
Unlike the checks included in the Always Find tab, wildcard searches are looking for a pattern rather than a particular term. As a result, it may not be clear to the user what a particular wildcard check is actually doing, so you may wish to add a note that will appear when PerfectIt locates a possible issue. Simply type the text you want to appear into the Instructions column that is available in every row of the Style Sheet Editor.
The comment will appear as the Issue Description, as shown below:
PerfectIt Instructions also have an option to help PerfectIt avoid certain locations and therefore reduce the number of false positives displayed in the locations list. It works by adding a comment of this form:
Except for "[exception 1]", "[exception 2]", ...
You can also use the key phrases Except before
and Except after
in order to check either before or after a possible location. As the Wildcards check is matching a pattern rather than a specific term this allows you to eliminate false positives easily, without having to specify every possible phrase that PerfectIt should ignore. For example, rather than adding Except for "page 1's", "page 2's", "page 3's"...
, this comment could be added to the example shown above:
Except after "page", "chapter"
With that comment, PerfectIt will, for example, automatically ignore the phrases ‘chapter 5’s theme’ and ‘page 13’s opening paragraph’, but will still find other instances of a number followed by 's
.
See also
Wildcard Descriptions¶
In the same way that adding a description to the Instructions column helps the user to understand what the check is doing when PerfectIt locates a possible issue, including it in the Wildcard Descriptions column means that the description is also displayed in PerfectIt’s standard reports, making it easier for users who are not familiar with wildcard patterns to understand the results in reports.
Tip
You can search the items in this tab using the Search box. Details can be found in Finding Terms in a Style Sheet.