Created
August 31, 2010 01:46
-
-
Save jpr5/558388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
s = "I really think this regexp engine sucks, why don't they just use PCRE?" | |
re = /((\w+\s*)+ regexp)$/ | |
re.match(s) | |
puts "NIH, muthafuckaz, NIH!!!!!!!!" # p.s you'll never see this line |
import re
s = "I really think this regexp engine sucks, why don't they just use PCRE?"
m = re.search("((\w+\s*)+ regexp)$",s)
(Hint: that's not ruby code and it runs just as slowly :))
:mod +Text.Regex.Posix
let s = "I really think this regexp engine sucks, why don't they just use PCRE?"
let r = "((\\w+\\s*)+ regexp)$"
s =~ r :: Bool
(Definitely not Ruby code, but they seem to get it right.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
["i love this regexp","this regexp sucks","this regexp sucks hard","this regexp sucks so hard","this regexp sucks so fucking bad","this regexp sucks so hard it hurts","this regexp is so fucking retarded it will shut your system down","you really dont want to run this regexp ever"].each{|s| puts s; /((\w+\s*)+ regexp)$/.match(s)}