5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy...

11
5/28/2002 (c) 2002 Orbonyx Corp. Al l Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. www.Orbonyx.com Downloads: www.Orbonyx.com/VS E-mail: Roy @ Orbonyx.com

Transcript of 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy...

Page 1: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

GotDotNet – Building Upon the Framework

Roy Ogborn, Lead ConsultantOrbonyx Corp.

www.Orbonyx.comDownloads: www.Orbonyx.com/VS

E-mail: Roy @ Orbonyx.com

Page 2: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

Regular Expressionsfor .NET Developers

GotDotNet – Building Upon the Framework

episode ten …

Page 3: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

At the end of episode 10, you will …• Gain enough confidence with regular

expressions that you start using them in .NET

• Understand why some of your trials did not produce the results that you predicted

• Know which classes in the .NET framework to use for pattern matching

• Know how to begin performing complex find/replace operations in VS IDE

Page 4: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

Regular Expressions; What are you talking about?

• Unix’s grep – “Global Regular Expression Print.

• Unix’s awk command – for pattern scanning and processing

• Also a large component of PERL.

Page 5: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

I still don’t know what you are talking about…

• Regular Expressions is a programmer’s way of saying “patterns”.

• Used for finding pattern matches in strings.

• Also used for find/replace operations.

Page 6: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

To Visual Studio Example

Page 7: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002

Scan web pages to find …

Links, e-mail addresses or content.

For example:

John West Salmon video

Page 8: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

Resources

• Daniel Appleman’s Regular Expressions with .NET (www.Desaware.com)

• http://regexlib.com/– Has loads of pre-built regular

expressions

Page 9: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

What we learned

•Regular Expressions go way beyond simple find and replace operations•They can be used for validating input, reformatting data, capturing information•Are fairly straight-forward to use in .NET … the trick is learning the RegEx language!

Page 10: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

Special Thanks to:

Daniel Applemanwww.Desaware.com

&

www.Apress.com

Joe Mayowww.csharp-station.com

Page 11: 5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved. GotDotNet – Building Upon the Framework Roy Ogborn, Lead Consultant Orbonyx Corp. .

5/28/2002 (c) 2002 Orbonyx Corp. All Rights Reserved.

Roy Ogborn, Lead ConsultantOrbonyx Corp.

www.Orbonyx.comDownloads: www.Orbonyx.com/VS

E-mail: Roy @ Orbonyx.com

Enjoy!