SE Michigan PowerShell Users Group - Regex Part1

1,831
-1

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,831
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SE Michigan PowerShell Users Group - Regex Part1

  1. 1. Matt Johnson SE Michigan PowerShell Script Club [email_address]
  2. 2. <ul><li>Introduction </li></ul><ul><li>Simple Pattern Searches </li></ul><ul><li>Simple Pattern Examples </li></ul><ul><li>Introduction to Regular Expressions </li></ul><ul><li>Closing </li></ul>
  3. 5. <ul><li>Used with both operating system commands and PowerShell commands. </li></ul><ul><li>Using cmd.exe we used “*” and “?”. With PowerShell we get a few more options. </li></ul><ul><li>Also work with -like and –notlike </li></ul>
  4. 6. <ul><li>Simple Pattern Wildcards </li></ul><ul><li>Turns out this is a basic form of regular expressions </li></ul>Wildcard Description * Any number of characters ? Exactly one character [xyz] One of the specified characters [x-z] One of the characters in the specified area
  5. 8. <ul><li>Dir *.txt </li></ul><ul><li>Dir [li]* </li></ul><ul><li>$ip = 192.168.23.1 If ($ip –like “*.*.*.*”) {“Valid”} Else {“Invalid”} </li></ul>
  6. 10. <ul><li>From Wikipedia: “Regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters.” </li></ul><ul><li>Found in some programming / scripting languages, editors and utilities. </li></ul>
  7. 11. <ul><li>Programming Languages: PowerShell, Perl, .NET languages, C++ </li></ul><ul><li>Editors: Visual Studio, emacs </li></ul><ul><li>Utilities: grep, Power Grep </li></ul>
  8. 12. <ul><li>Websites: </li></ul><ul><ul><li>http://www.regular-expressions.info/ </li></ul></ul>
  9. 13. <ul><li>Websites: </li></ul><ul><ul><li>www.regexlib.com </li></ul></ul>
  10. 14. <ul><li>Websites: </li></ul><ul><ul><li>MSDN Regex Class </li></ul></ul>
  11. 15. <ul><li>Books </li></ul><ul><ul><li>Mastering Regular Expressions by Jeffrey Friedl </li></ul></ul><ul><ul><li>Regular Expressions Cookbook by Jan Goyvaerts, Steven Levithan </li></ul></ul>
  12. 16. <ul><li>Applications </li></ul><ul><ul><li>Rad Software Regular Expression Designer </li></ul></ul><ul><ul><li>http://www.radsoftware.com.au </li></ul></ul>
  13. 17. <ul><li>Applications </li></ul><ul><ul><li>Ultrapico Expresso 3.0 </li></ul></ul><ul><ul><li>http://www.ultrapico.com/expresso.htm </li></ul></ul>
  14. 18. <ul><li>Applications </li></ul><ul><ul><li>The Regex Coach </li></ul></ul><ul><ul><li>http://weitz.de/regex-coach </li></ul></ul>
  15. 20. <ul><li>PowerShell and Regular expressions </li></ul><ul><li>PowerShell and .NET’s Regex class </li></ul><ul><li>Regular Expression Examples </li></ul>
  16. 21. <ul><li>Contact Me: Matt Johnson, GSEC, MCSE Email: [email_address] Blog: http://www.packetcrazy.com/blog Social Sites: mwjcomputing - Twitter, Friendfeed, Facebook </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×