O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.5. Extracting Data from Text

The text data that we get our hands on is rarely in the format we need. As a contrived example, take the string in our test_numbers.txt file. How do we extract the numbers from a string that contains numbers separated by whitespace and other separators? How do we locate the correct position in the string and extract the digit portion only? The answer is regular expressions.

NOTE

For more information on regular expressions, you can visit the excellent online resource that is the http://www.regular-expressions.info site and go through its tutorials and references on the subject. The site covers regular expression usage in different programming languages and environments. While the syntax and support is more or less ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required