Solid Fluid System Solutions  
Home Software About Hardware Firmware

Document Icon VConsole (Library)
Document Icon Crypto
Document Icon Archive
Document Icon Container
Document Icon Pipe
Document Icon Compress
Document Icon Math
Document Icon Vector
Document Icon DateTime
Document Icon List/Array
Document Icon HashIntegerFloat
Document Icon Database
Document Icon Thread
Document Icon String
Document Icon Machine
Current Document Icon Regex
Document Icon SGMLParse
Document Icon HTTPHeader
Document Icon Comm
Document Icon Collab
Document Icon HierAgent
Document Icon Resource
Document Icon Colour
Document Icon Image

Regex

The VRegex group of classes provide the capability to search text data by PCRE (Perl Compatible Regular Expression).

A core class, that must be subclassed by the object to be searched, is used to define the search set. In addition a character pointer type must be subclassed for use with the search set. Using this scheme the VRegex object is able to control the stream of characters it reads from an arbitrary search data set.

The search set can be composed of multiple strings, and used with regex operators that associate with line ends. The regex also supports the standard dynamic replacement capability. The combination of subclassed search set and subclassed regex pointers are able to manipulate the content search data set.

Any standard regular expression may be used to find/replace complex patterns in text data. Typically one calls a function to specify the PCRE, and optionally to set the replace expression. The regex can be operated in the following modes;

  • Find from origin
  • Find from current - forward
  • Find from current - reverse
  • Find all - list
  • Replace single
  • Replace all
  • Replace selection

A system of virtual functions can be implemented in the subclassed regex class, which perform actions as a result of search finds, or replacements

A standard set of container and pointer subclasses is implemented to allow VRegex to be used with VString. Later in the GUI library it will be clear that there is user interface and a small engine to co-ordinate a GREP style find in files function. This capability uses the VRegexString class to implement find in files. Also in the GUI library there is a text buffer associated with a text view. Subclasses are implemented in that library to allow regex to be used with a graphically visible text document.

Copyright © Solid Fluid 2007-2022
Last modified: SolFlu  Mon, 08 Jun 2009 03:29:27 GMT