Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Nanod10
Forked from krlicmuhamed/regex.prg
Created May 8, 2019 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nanod10/6476434b63410e5dc8d6302f76d1b2b7 to your computer and use it in GitHub Desktop.
Save Nanod10/6476434b63410e5dc8d6302f76d1b2b7 to your computer and use it in GitHub Desktop.
Using regex in FoxPro
oRE = CreateObject("VBScript.RegExp")
oRE.Pattern = "regular expression here"
lcString = "string to search"
llResult = oRE.test(lcString)
lcMatches = oRE.Execute(lcString)
IF ALEN(lcMatches) > 0
llResult = lcMatches(0).Submatches(0) && First match and first submatch/group
ENDIF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment