Created
November 7, 2013 15:38
-
-
Save gsherman/7356646 to your computer and use it in GitHub Desktop.
example of using regular expressions in ClearBasic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub main() | |
Dim txt as String | |
Dim newTxt as String | |
Dim regex As Object | |
txt="Clarify is cool" | |
Set regex=CreateObject("vbscript.regexp") | |
regex.Pattern="Clarify" | |
newTxt = regex.Replace(txt,"Dovetail") | |
regex.Pattern="$" | |
newTxt = regex.Replace(newTxt,"er") | |
Debug.Print txt | |
Debug.Print newTxt | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment