Using Regular Expressions in SAS | Extracting a Value using Regular Expression | PRXSUBSTR | PRXPOSN

Sdílet
Vložit
  • čas přidán 23. 08. 2024
  • In this Green Numbers video I show you how to use regular expressions to make your code more flexible. In coding we often need to search for specific strings, and there are functions that help us to do this such as the FIND function. But what if you’re not looking for a specific string value but a string pattern. For example, rather than a specific phone number you’re looking for any phone number. For this kind of search we need a more powerful tool. This is where regular expressions really shine. With regular expressions we can search for a pattern, perform fuzzy matching, find and replace a value matching a pattern, and extract a value matching a pattern and save it to a variable.
    This is the third Green Number video on regular expressions. This one focuses on extracting a value using a pattern and saving it to a variable. In previous videos in this series I demonstrated matching using a pattern, and find and replace using a pattern.

Komentáře • 1