Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Downloads
Search: 

RegexPatternBuilder class (C#)
Gregory Adam
Complex patterns are hard to build. This class allows to build the pieces in a hierarchical way.
Created on
14 years ago
Downloads
968
File type
Freeware
General information
Description
Uncommenting the line, adds a static void Main(). Hit F5 to run
#define LOGIC_TEST	// comment for production, uncomment for test sample
Needs the Topological sort (C#) Consider the following definition ( a la BNF) You see that all the reusable parts are defined Some parts are defined using other parts Empty lines are skipped as well as lines starting with * or # which are considered comment
# global definitions
				(0[1-9]|1[0-9]|2[0-9])
				(0[1-9]|1[0-9]|2[0-9]|3[0])
				(0[1-9]|1[0-9]|2[0-9]|3[01])

			02
			(0[469])|(11)
			(0[13578])|(1[02])

# EUR
# with /
		\b(\/\d{4})\b
		\b(\/\d{2})\b

		||
		\/
		\/
		\/
If the previous definition were in string, say, dateDefinition
p = RegexPatternBuilder.Construct(dateDefinition, "")
will return in p
(\b(((((0[1-9]|1[0-9]|2[0-9]))\/(02))|(((0[1-9]|1[0-9]|2[0-9]|3[0]))\/((0[469])|(11)))
|(((0[1-9]|1[0-9]|2[0-9]|3[01]))\/((0[13578])|(1[02]))))\/\d{4})\b)
If any error in the definition, the method returns null The order in which the parts are defined is not important The mechanics (1) A dictionary is built (key = left part of the line, value = right part of the line) (2) for each line the <...> parts are extracted from the content and fed to a Topological Sort (3) in the order of the Topological sort, each <..> part in the right part of the line is substituted by its definition Note that the right part is put between ( and ) in step (1)
2009/05/28 Fix to accept single line patterns as the target
	\d{2}-\d{2}-\d{4}
Created by

Comments
Fix to accept single line patterns as the target Gregory Adam, May 28, 2009

Add a comment
More downloads created from this member
Gregory Adam
MD5 hash algorithm implementation : http://www.faqs.org/rfcs/rfc1321.html
Created on
14 years ago
Downloads
1967
File type
Freeware
Gregory Adam
RC4 encryption class .......................................................
Created on
14 years ago
Downloads
1610
File type
Freeware
Gregory Adam
A topological sort sorts out dependencies and returns an order in which each predecessor is processed before any of its successors.
Created on
14 years ago
Downloads
1844
File type
Freeware
Gregory Adam
Allows to detect MouseEnter (see Thread#1398534 ) in grid columns The cells do not need to have the focus It's an object that has to be added to the form. Once added to the form you can tell it to 'watch' one or more columns. To add a 'watched' column you call a method passing - the Control...
Created on
14 years ago
Downloads
1520
File type
Freeware
Rating
5.00/5.00
Gregory Adam
Collection of 4 VFP functions in an FLL: (1) at_bm() - Tuned Boyer-Moore string search (2) AddProperty() - add Property to any object (3) Callback_Set() - returns a function address that can be used for callbacks (4) Callback_Release() - releases a previously allocated function address. Includes...
Created on
20 years ago
Downloads
1786
File type
Gregory Adam
SafeArray class. Up to 13 dimensions, lower and upper bounds per dimension, number of elements limited by available space in pagefile. Supports mixed type arrays, as well as arrays of a same type like String, Char, Short, Integer, Float and Double
Created on
20 years ago
Downloads
904
File type
Gregory Adam
It just goes through the file and invokes the function supplied for each variable. This means that you can use MemFileShow() without any modification and customize your needs by writing a function and supplying its name. See Mem_defined() in the program.
Created on
21 years ago
Downloads
1211
File type
Rating
5.00/5.00
Gregory Adam
A few Folder-and-File related functions based on API, such as an extended adir_(), FolderCopy(), FolderRemove(), FolderMove(), FileExists(), etc. They were developed on Win98SE, VFP6 SP3. Tested on Win98 SE and Win2K as far. Should work on Win95. Be careful with the FolderRemove(). It does not ask ...
Created on
22 years ago
Downloads
1603
File type
Rating
4.50/5.00