Michael Olivero Microsoft Student Ambassador for FIU Special Guest: FIU Graduate Student Miguel Gonzalez.

Slides:



Advertisements
Similar presentations
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Advertisements

1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Lexical Analysis The Scanner Scanner 1. Introduction A scanner, sometimes called a lexical analyzer A scanner : – gets a stream of characters (source.
1 Scanning Aaron Bloomfield CS 415 Fall Parsing & Scanning In real compilers the recognizer is split into two phases –Scanner: translate input.
Regex Wildcards on steroids. Regular Expressions You’ve likely used the wildcard in windows search or coding (*), regular expressions take this to the.
Regular Expressions. String Matching The problem of finding a string that “looks kind of like …” is common  e.g. finding useful delimiters in a file,
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
Lesson 3 – Regular Expressions Sandeepa Harshanganie Kannangara MBCS | B.Sc. (special) in MIT.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Regular Expression Darby Tien-Hao Chang (a.k.a. dirty) Department of Electrical Engineering, National Cheng Kung University.
Pattern matching with regular expressions A common file processing requirement is to match strings within the file to a standard form, e.g. address.
 Text Manipulation and Data Collection. General Programming Practice Find a string within a text Find a string ‘man’ from a ‘A successful man’
Regular Expressions in.NET Ashraya R. Mathur CS NET Security.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
ASP.NET Programming with C# and SQL Server First Edition Chapter 5 Manipulating Strings with C#
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
CIS 451: Regular Expressions Dr. Ralph D. Westfall January, 2009.
Regular Expression (continue) and Cookies. Quick Review What letter values would be included for the following variable, which will be used for validation.
CIS 451: ASP.NET Concepts Dr. Ralph D. Westfall January, 2009.
1 CSC 594 Topics in AI – Text Mining and Analytics Fall 2015/16 4. Document Search and Regular Expressions.
Regular Expression in Java 101 COMP204 Source: Sun tutorial, …
Regular Expressions.
CS412/413 Introduction to Compilers Radu Rugina Lecture 4: Lexical Analyzers 28 Jan 02.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
BY Sandeep Kumar Gampa.. What is Regular Expression? Regex in.NET Regex Language Elements Examples Regular Expression API How to Test regex in.NET Conclusion.
Lexical Analysis: Finite Automata CS 471 September 5, 2007.
Overview A regular expression defines a search pattern for strings. Regular expressions can be used to search, edit and manipulate text. The pattern defined.
When you read a sentence, your mind breaks it into tokens—individual words and punctuation marks that convey meaning. Compilers also perform tokenization.
Module 6 – Generics Module 7 – Regular Expressions.
Satisfy Your Technical Curiosity Regular Expressions Roy Osherove Methodology & Team System Expert Sela Group The.
12. Regular Expressions. 2 Motto: I don't play accurately-any one can play accurately- but I play with wonderful expression. As far as the piano is concerned,
2. Regular Expressions and Automata 2007 년 3 월 31 일 인공지능 연구실 이경택 Text: Speech and Language Processing Page.33 ~ 56.
GREP. Whats Grep? Grep is a popular unix program that supports a special programming language for doing regular expressions The grammar in use for software.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Extending Finite Automata to Efficiently Match Perl-Compatible Regular Expressions Publisher : Conference on emerging Networking EXperiments and Technologies.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Fall 2000C.Watters1 World Wide Web and E-Commerce Clients & Client Side Processing.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
CSE 425: Syntax I Syntax and Semantics Syntax gives the structure of statements in a language –Allowed ordering, nesting, repetition, omission of symbols.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
7 Copyright © 2009, Oracle. All rights reserved. Regular Expression Support.
Regular Expressions /^Hel{2}o\s*World\n$/ SoftUni Team Technical Trainers Software University
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 2: Lexical Analysis.
Chapter 2 Scanning. Dr.Manal AbdulazizCS463 Ch22 The Scanning Process Lexical analysis or scanning has the task of reading the source program as a file.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
using Deterministic Finite Automata & Nondeterministic Finite Automata
Regular Expressions /^Hel{2}o\s*World\n$/ SoftUni Team Technical Trainers Software University
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
Selecting Relevant Documents Assume: –we already have a corpus of documents defined. –goal is to return a subset of those documents. –Individual documents.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
Presented by : A best website designer company. Chapter 1 Introduction Prof Chung. 1.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Deterministic Finite Automata Nondeterministic Finite Automata.
CS412/413 Introduction to Compilers Radu Rugina Lecture 3: Finite Automata 25 Jan 02.
CS 330 Class 7 Comments on Exam Programming plan for today:
Finite-State Machines (FSMs)
Finite-State Machines (FSMs)
Web Development Using ASP .NET
Advanced Find and Replace with Regular Expressions
Instructor: Aaron Roth
Lecture 25: Regular Expressions
ADVANCE FIND & REPLACE WITH REGULAR EXPRESSIONS
Presentation transcript:

Michael Olivero Microsoft Student Ambassador for FIU Special Guest: FIU Graduate Student Miguel Gonzalez

Topics Covered Today  Intro to ASP.NET  Regular Expressions (Regex)  Web Services

Brief Intro  Client Server Model (State)

Brief Intro  Client Server Model (State Less)

What happens when you request a web page My Picture My picture is: Each resource is requested with a separate connection.

The need for dynamic data - CGI

Issues with CGI  Multiple Processes  Integration with Content creates cluttered code  Ex: C++ code to write HTML code

Come Active Server Pages  Why not mix the code within the HTML page?

code ASP Processing

Issues with ASP  Parsing overhead  Interpretation overhead  Mixing of presentation & code  All the issues of a non-OOP language  No encasulation  No inheritance  Etc.

Come ASPX  Why not create a model from the ground up to resolve all of these issues…  Every page is a OOP class  Content is separate from code  Compiled code not interpreted  Inheritance  Reuse  …and the list goes on Coming Spring 2004

Quick Demo ASPX

Topics Covered Today Intro to ASP.NET Intro to ASP.NET  Regular Expressions (Regex)  Web Services

Intro to parsing…  How many times have you parsed a string?  What did you use?  Substring()  IndexOf()

Parsing using String class methods  Example  Given an like you want to pull out the first part of the domain name “mike95”  Sample code using string class methods: String = String domain = .substring( .lastIndexOf(‘.’) – );

Parsing using Regex  Example  Given an like you want to pull out the first part of the domain name “mike95”  Sample code using string class methods: String = Match m = Regex.Match( , );

Regular Expressions Miguel Gonzalez  What are they? (5-6 min)  Regex vs Linear String searches (5-6min)  Regex in.NET (10 min)  Classes  Basic Options  In-Depth Regex (15 min)  Advanced Regex in.NET (5 min)

Regex Foundation  What are regular expressions?  A powerful technique to process textual data  Description of machine that “eats” strings  How do they work internally?  DFA  NFA .NET implementation is NFA-based  Examples:  ^from:.* .*\b.NET\b.*  [0-9]+

DFA: Deterministic Finite Automata  The machine is deterministic:  One line of execution  Greedy Little Machine  Always finds the longest match.  Tracks all possible matches simultaneously  Cannot backtrack  Cannot remember captured subexpressions  Cannot “look ahead” or “look behind”  Cannot be “lazy”  Example:  Find a price in different coins:  ((US|CAN)$|EU)[0-9]+\.[0-9][0-9]

NFA: Non-Deterministic Finite Automata  Warning for the Purists: Not a “real” NFA  The machine is non-deterministic:  Multiple possible lines of execution  Has to run through every choice.  Can save points of execution and “backtrack”  Capture sub-expressions  Greedy, but can be Lazy when it wants to  Example:  Find a price:  ((US|CAN)$|EU)[0-9]+\.[0-9][0-9]

Regular Expressions vs Traditional String Matching  Efficiency  Conciseness  Simplicity  Demo

Regex Syntax  Character matching  Literals:  John Smith  Character classes  Pre-Defined  Word Character: \w  Whitespace: \s  Digits: \d  Anything:.  Negation: \W, \S, \D  User defined  [mnopq]  Negation: [^mnopq]  Ranges  [a-z], [0-9]  [0-9a-f]  Demo

Regex Syntax  Position  Start of line: ^  End of line: $  Match a word: \b  Match a substring: \B  Demo

Regex Syntax  Quantifiers  Zero or more: *  One or more: +  Optional (zero or one) : ?  Being exact: {n}, {n,} {n,m}  Lazy Quantifiers: Add an extra ? Symbol  Example: a*?  Demo

Regex Syntax  Grouping expressions  Unnamed:.*year.*(\d\d\d\d)  Named:.*year.*(? \d\d\d\d)  ORing expressions: ab | cd  Backreference  By index: \n  By name \k  By name \k  Demo

Regex in.NET .NET Regex implementation  NFA-based  Regex Cache  Classes  System.Text.RegularExpressions  Basic.NET Options  Regex Compilation in.NET

Regex Object  Creating Regexes  new Regex( regex)  new Regex( regex, options)  Matching  Regex.isMatch(target)  Regex.isMatch(target, offset)  For more complex behavior: Obtain and use Match object

String Manipulation with Regex  String replacement  Methods  Regex.Replace(target, replacement)  Regex.Replace(target, replacement, count)  Regex.Replace(target, replacement, count, offset)  Can refer to matches in the regex through escape codes:  Matched text: $& or $0  Matched text for Groups: $1 … $N or ${name}  Text before the match: $`  Text after the match: $’  Original text: $_  Example:  Generate a reply To header from the From header of the original  new Regex(“^From”).Replace(“To:$’”)  String splitting  Methods  Regex.split(target)  Regex.split(target, count)  Regex.split(target, count, offset)

Match Object  Represent the result of applying the Regex  Get a Match Object from Regex  Regex.Match(target)  Regex.Match(target, offset)  Regex.Match(target, offset, maxlength)  Get all the matches  Regex.Matches(target)  Regex.Matches(target, offset)  Properties  Match.Success  Match.Length  Match.Index  Match.Groups  Match.Captures  Methods  Match.Result(string)  Match.NextMatch()  Match.Synchronized()

Groups  Represent groupings in the Regex .NET Regex Groups can be named  Properties  Group.Success  Group.Value  Group.Length  Group.Index  Group.Captures Captures  Represent intermediary matchings in the working process of the regex/group  Properties  Group.Success  Group.Value  Group.Length  Group.Index  Group.Captures

.NET Shortcuts  Regex Convenience Methods  Matching  Regex.Match(pattern, target)  Regex.Match(pattern, target, options)  Regex.IsMatch(pattern, target)  Regex.IsMatch(pattern, target, options)  Regex.Matches(pattern, target)  Regex.Matches(pattern, target, options)  String Replacement  Regex.Replace(pattern, target, replacement)  Regex.Replace(pattern, target, replacement, options)  String Splitting  Regex.Split(pattern, target)  Regex.Split(pattern, target, options)  String Escaping  Regex.Escape(string)  Regex.Unescape(string)

Regex Options in.NET  Regex.IgnoreCase  Regex.IgnorePatternWhitespace  Regex.Multiline  Regex.Singleline  Regex.ExplicitCapture  Regex.ECMAScript  Regex.Compiled  Regex.RightToLeft

Regex Compilation in.NET .NET Compilation  Optimizes the NFA for speed  Overhead at object creation  Increased memory cost .NET Compilation to Assembly  Compiles Regex as an MSIL object  Optimizes speed and memory  Demo

Topics Covered Today Intro to ASP.NET Intro to ASP.NET Regular Expressions (Regex) Regular Expressions (Regex)  Web Services