Thinking Regular Expressions

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Thinking Regular Expressions - Presentation Transcript

    1. Thinking regular expression is your way to get started to use regular expressions
    2. Mönster sökning vad är regex.
    3. Validering
    4. NOTIS: 12345 , the bugg x
    5. 2008-02-21 2008 /03 / 22 20080423 2008 05 24
    6. 21-02-2008 22-03-2008 23-04-2008 24-05-2008
    7. (?:(?: )?[ ])*(?:(?:(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ] )+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:( ?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00- 31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)* ](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+ (?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?: (?: )?[ ])*))*|(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: ) ?[ ])*)*<(?:(?: )?[ ])*(?:@(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: r )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: ) ?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ] )*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])* )(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ] )+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*) *:(?:(?: )?[ ])*)?(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+ ||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31 ]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*]( ?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(? :(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(? : )?[ ])*))*>(?:(?: )?[ ])*)|(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(? :(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )? [ ]))*&quot;(?:(?: )?[ ])*)*:(?:(?: )?[ ])*(§?:(?:(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]| \.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<> @,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot; (?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ] )*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\ &quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(? :[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[ ]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*|(?:[^()<>@,;:\&quot;.[] 00- 31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|( ?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)*<(?:(?: )?[ ])*(?:@(?:[^()<>@,; :\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([ ^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot; .[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[ ] \]|\.)*](?:(?: )?[ ])*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;. [] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] r\]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \] |\.)*](?:(?: )?[ ])*))*)*:(?:(?: )?[ ])*)?(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\ .|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@, ;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|&quot;(? :[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])* (?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;. []]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[ ^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[] ]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*>(?:(?: )?[ ])*)(?:,s*( ?:(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\ &quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:( ?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[ [&quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(? :.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*|(?: [^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;.[ ]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)*<(?:(?: ) ?[ ])*(?:@(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot; ()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: ) ?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<> @,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@, ;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ] )*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\ &quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*)*:(?:(?: )?[ ])*)? (?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:\&quot;. []]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[ &quot;()<>@,;:\&quot;.[]]))|&quot;(?:[^&quot; \]|\.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ]) *))*@(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ]) +||(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*)(?: .(?:(?: )?[ ])*(?:[^()<>@,;:\&quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:\&quot;.[]]))|[([^[] \]|\.)*](?:(?: )?[ ])*))*>(?:( ?: )?[ ])*))*)?;s*)
    8.  
    9.  
    10.  
    11. ^
    12. $
    13. ^grey
    14. ^ grey
    15. ^ g rey
    16. ^g r ey
    17. ^gr e y
    18. ^gre y
    19. ^grey$
      • ^grey
      • beginning of line ^
      • followed immediately by g
      • followed immediately by r
      • followed immediately by e
      • followed immediately by y
    20. / /Everybody get in front/ You know regular expressions
    21.  
    22. [ea] Character Classes
    23. [1234] Character Classes
    24. [1-4] Character Classes
    25. [^1-4] Character Classes
    26. . Any Character
    27. + Repetition
    28. * Repetition
    29. d Shortcut [0-9]
    30. D Shortcut [^0-9]
    31. () Backreference
    32. .+[?] Questions
    33.  
    34.  

    + Michael NilssonMichael Nilsson, 6 months ago

    custom

    594 views, 0 favs, 0 embeds more stats

    My point is that I think many developers see it as more

    More info about this presentation

    CC Attribution-NonCommercial LicenseCC Attribution-NonCommercial License

    • Total Views 594
      • 594 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 11
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories