Skip to content

Instantly share code, notes, and snippets.

@krlicmuhamed
Last active March 19, 2021 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save krlicmuhamed/9459d7b84011e29e2aef85e1a2951372 to your computer and use it in GitHub Desktop.
Save krlicmuhamed/9459d7b84011e29e2aef85e1a2951372 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