Your SlideShare is downloading. ×
0
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Thinking Regular Expressions
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Thinking Regular Expressions

1,605

Published on

My point is that I think many developers see it as hard/complex to understand and use regular expressions, but by getting the basic thinking right I believe it is really easy to getting started to use …

My point is that I think many developers see it as hard/complex to understand and use regular expressions, but by getting the basic thinking right I believe it is really easy to getting started to use this powerful tool. The presentations was supposed to be a kick start.

Note! This presentations is not supposed to stand alone, it is done to support my talk.

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,605
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
42
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

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. (?:(?: )?[ ])*(?:(?:(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ] )+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:( ?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00- 31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)* ](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+ (?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?: (?: )?[ ])*))*|(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: ) ?[ ])*)*<(?:(?: )?[ ])*(?:@(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: r )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: ) ?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ] )*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])* )(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ] )+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*))*) *:(?:(?: )?[ ])*)?(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+ ||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31 ]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*]( ?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(? :(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(? : )?[ ])*))*>(?:(?: )?[ ])*)|(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(? :(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )? [ ]))*&quot;(?:(?: )?[ ])*)*:(?:(?: )?[ ])*(§?:(?:(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; | |(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<> @,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot; (?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ] )*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:&quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(? :[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[ ]]))|[([^[] |)*](?:(?: )?[ ])*))*|(?:[^()<>@,;:amp;quot;.[] 00- 31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||( ?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)*<(?:(?: )?[ ])*(?:@(?:[^()<>@,; :amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([ ^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot; .[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[ ] |)*](?:(?: )?[ ])*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;. [] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] r|)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*))*)*:(?:(?: )?[ ])*)?(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; |.|(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@, ;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|&quot;(? :[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])* (?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;. []]))|[([^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[ ^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[] ]))|[([^[] |)*](?:(?: )?[ ])*))*>(?:(?: )?[ ])*)(?:,s*( ?:(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:&quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:( ?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[ [&quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*))*@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(? :.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*))*|(?: [^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;.[ ]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)*<(?:(?: ) ?[ ])*(?:@(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot; ()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: ) ?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<> @,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*))*(?:,@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@, ;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(?:.(?:(?: )?[ ] )*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:&quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*))*)*:(?:(?: )?[ ])*)? (?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[&quot;()<>@,;:amp;quot;. []]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ])*)(?:.(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+||(?=[[ &quot;()<>@,;:amp;quot;.[]]))|&quot;(?:[^&quot; ||(?:(?: )?[ ]))*&quot;(?:(?: )?[ ]) *))*@(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ]) +||(?=[[&quot;()<>@,;:amp;quot;.[]]))|[([^[] |)*](?:(?: )?[ ])*)(?: .(?:(?: )?[ ])*(?:[^()<>@,;:amp;quot;.[] 00-31]+(?:(?:(?: )?[ ])+| |(?=[[&quot;()<>@,;:amp;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$
  • 20. <ul><li>^grey </li></ul><ul><li>beginning of line ^ </li></ul><ul><li>followed immediately by g </li></ul><ul><li>followed immediately by r </li></ul><ul><li>followed immediately by e </li></ul><ul><li>followed immediately by y </li></ul>
  • 21. / /Everybody get in front/ You know regular expressions
  • 22.  
  • 23. [ea] Character Classes
  • 24. [1234] Character Classes
  • 25. [1-4] Character Classes
  • 26. [^1-4] Character Classes
  • 27. . Any Character
  • 28. + Repetition
  • 29. * Repetition
  • 30. d Shortcut [0-9]
  • 31. D Shortcut [^0-9]
  • 32. () Backreference
  • 33. .+[?] Questions
  • 34.  
  • 35.  

×