Inline Code Rules
This dialog box allows you to define a set of regular expressions for inline codes. The expression is applied to the content of the text items and all parts of the text that is matching one of the rules is set as inline code.
Add -- Click this button to add a new rule.
Remove -- Click this button to remove the current rule.
Move Up -- Click this button to move the current rule upward.
Move down -- Click this button to move the current rule downward.
Regular expression -- Enter the regular expression for the current rule. Use the Modify button to enter the edit mode. The expression must be a valid regular expression according the syntax described in the Regular Expression section. You can check the syntax (and the effect of the rule) by clicking the Test button.
Modify -- Click this button to edit the expression of the current rule. This button is labeled Apply Changes when you are in edit mode.
Apply Changes -- Click this button to save any changes you have made to the expression and leave the edit mode. This button is labeled Modify when you are not in edit mode.
Cancel Changes -- Click this button to leave the edit mode and revert the current rule to the expression it had before you started the edit mode.
Insert Pattern -- Click this button to insert a regular expression pattern in the edit box. The inserted text replaces whatever text is currently selected.
Test -- Click this button to check the syntax of the current rule, and to watch the effect it has on the sample text. The result of the test are displayed in the Result box. The parts of the text that are matches of the expressions are displayed according the Format currently selected. If the All rules option is set, the test takes all rules of the set in account, if it is not set only the current rule is tested.
All rules -- Set this option to test all the rules at the same time.
Sample text -- Enter a sample text on which to test the rules.
Result -- This box contains the result of the latest test, or, if the test failed, an error message.
Format -- Select the format in which to display the result of the test. the format available are:
Nis the index of the inline code.
Regular Expression Help -- Click this button to get detailed help on the syntax and the usage of regular expressions. The button opens the Regular Expression help section.
Ignore case -- Set this option to ignore the cases in the matches. for example "bear" matches "Bearcat", "BEARCAT", and "bearcat".
Multiline -- Set this option to changes the meaning of ^ and $ so that they match at the beginning and end of any line, not just the beginning and end of the whole string.
ECMAScript-compliant behavior -- Set this option to enable ECMAScript-compliant behavior for the expression.
Dot also matches line-feed -- Set this option to changes the
meaning of the period character '.' so that it matches every character instead
of every character except
Here are a few examples of regular expressions for patterns often set as inline codes:
Basic HTML tags (does not have provisions for translatable attributes):
Expression: <\w+.*?((?<q>"|')(.*?)\k<q>.*?)?>|</\w+.*?> Options: Ignore case: set, Dot matches also linefeed: set. Matches: <P id="1">This is<br> a<a attr="<test>" href='#abc'>link</a>.</P>
Special C-style escaped characters:
Expression: \\a|\\b|\\f|\\n|\\r|\\t|\\v Options: None Matches: Row name\tValue\n
C-style printf variables:
Expression: %(([-0+ #]?)[-0+ #]?)(([\d\*]*)(\.[\d\*]*)?)[dioxXucsfeEgGpn] Options: None Matches: There is %*.*d file%s missing in %s. Process done at %d%%.
You can find more examples in the the Regular Expression page of the help.