SHRUGSE regex cheat sheet

722 views
649 views

Published on

What's new in Ruby 1.9 regex? Presentation in Swedish: http://http.tv4.se/live/

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
722
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SHRUGSE regex cheat sheet

  1. 1. Oniguruma – ny regex-motor i Ruby 1.9UnicodeCodepoint: • u00a4 u0020Property: • [[:alpha:]] • p{L} p{Ll} • p{S} p{Sc} "a^b¤c"Script: • p{Arabic}Negated: • P{L}Lookbehind • :(.*) $1 • (?<=:).* • (?<!:).*Possessive • p{L}*:.* • p{L}*+:.* • <b>.*</b> • <b>.*+</b>Named ref • /(?<day>dd):(?<mon>dd)/ =~ "24:12" hour • r = /(?<day>dd):(?<mon>dd)/ • "24.12".sub r, månad k<mon> och dag k<day>Recursive • ^(?<pal>|.|(?<prefix>.)g<pal>k<prefix+0>)$Du vet väl att det finns en heldagskurs I Regex? Mer info här: http://rekursiv.se/regexkurs

×