![]() In the first example, we’re looking for the pattern “a letter between f and q, followed by the end of the line”. That might mean a range of characters or an array of characters that we’re interested in. What about square brackets? In regex, we use square brackets to denote a set. Sounds like an IP address, right? This would match, also, something like 999.830.60.450, which is not a valid IP address. So, we have “three occurrences of ‘one to three digits followed by a period’ and then one to three more digits”. If you see something like ‘(\d – looking for three occurrences of “one to three digits followed by a period” Many people are intimidated by regular expressions, or “regex”. This isn’t meant to be a comprehensive series but rather, just as the name says: a crash course. ![]() Regular expressions are extremely useful to extract information from text such as log files or documents. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. ![]() This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. You can find me on Twitter ( or posting on my blog,. Hello! I’m Thomas Rayner, a proud Cloud
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |