Solid Fluid System Solutions  
Home Software About Hardware Firmware
Folder Icon Worked Example
A simple example that shows how to import data into MS Excel. The demonstraton shows how regex removes the repetitive graft.

Document Icon Regex
Document Icon Characters
How to specify which characters should match at an arbitary position within a search text.
Document Icon Positioning
How to make matches position themselves in relation to non text entities in the search text.
Document Icon Repeat
How to repeat the preceeding token match.
Document Icon Groups
How to group tokens together for use in repetitions, references or alternatives.
Document Icon Special Groups
How to create metatoken, conditional and comment groups.
Current Document Icon Modes
How to control the overal mode of a regular expression.


This page describes how to control the overal mode of a regular expression.

N.B. - All of the modes operate relative to a specific group. For details of options see the page on Groups. The default scope for mode specifiers is the, entire regular expression. The mode change takes place at the beginning the group no matter where the mode specifier is placed within the group. This remains true for the root group, i.e. the group for which there is no parenthesis. Other options are available.

Character Description Example

Ways to specify the expression mode

(?i) Enable case insensitivity. te(?i)st matches test and TEST .
(?-i) Disable case insensitivity. te(?-i)st matches test but not TEST .
(?s) Enable "dot matches newline".  
(?-s) Disable "dot matches newline".  
(?m) Enable "dollar and caret on line ends".  
(?-m) Disabel "dollar and caret on line ends".  
(?i-sm) Mode specifiers can be concatenated, this enables "i" and disables "s" and "m".  
(?i-sm:expn-text) Modes can be localised, in this case the expression text is parsed with "i" enabled and "s" and "m" disabled. The parent of this group would operate in the default mode, or whichever mode had otherwis been specified for it previously. (?i:te)st matches TEst but not TEST .
Copyright © Solid Fluid 2007-2022
Last modified: SolFlu  Sat, 20 Jun 2009 23:36:31 GMT