Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code references tool
Message
From
13/08/2003 11:02:06
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00819764
Message ID:
00819778
Views:
11
>Hello,
>Can anyone help me with a regular expression search? I've inherited some old code, and am trying to refactor it, and every table that gets used is used in a specific area:
>
>
>use table in 81
>use table in 82
>
>some may also have tabs at the beginning of the lines.
>
>What regular expression search should I use to find these lines? Thanks a lot,
>
>jfh

John,

for a specific work area, ie not 0 (note that use ... in 09 would fail)
function do_it()
	
	local RegExp, Match, s, i
	RegExp=  CreateObject('VBScript.RegExp')
	RegExp.IgnoreCase = TRUE
	RegExp.Global = TRUE
	
	RegExp.Pattern = "use\s+.+\s+in\s+[1-9]\d*"
	
	s = [use  ('ppp') in 24]
	
	Match = RegExp.Execute(s)
	
	do case
	case empty(Match.Count)
		&& nothing
	
	otherwise
		for i = 0 to Match.Count-1
			? Match.Item[i].Value
		endfor
	endcase

endfunc
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform