You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a couple of simple examples to give an idea of how VerbalExpressions works:
Testing if we have a valid URL
-- Create an example of how to test for correctly formed URLslet expr = searchGlobal >>>
startOfLine >>>
find "http">>>
possibly "s">>>
find "://">>>
possibly "www">>>
anythingBut "">>>
endOfLine
$ verEx
-- Use VerEx's test() function to find if it matchesprint$ test "https://www.google.com" expr
-- Outputs the actual expression used: ^(?:http)(?:s)?(?:://)(?:www.)?(?:[^ ]*)$print$ expr
Replacing strings
-- Create a test stringlet replaceMe ="Replace bird with a duck"-- Create an expression that seeks for word "bird"let expr2 = find "bird"$ verEx;
-- Execute the expressionprint$ replace replaceMe "duck" expr2
Shorthand for string replace:
print$ replace "We have a red house""blue". find "red"$ verEx
Here you can find the API documentation for Verbal Expressions
Basic usage
Basic usage of Verbal Expressions is through a singleton, called verEx, that creates a new expression for you: