News for hackers. Stuff that matters.
Re:Stop avoiding regular expressions damn it by rcfox on Sunday May 12, 2013 @10:12AM (#5694284)
Just curious: how do the regexes compare when you use "^@(.*)@$" ? Semantically, it's closer to the string version.

Realistically, you'd expect them to behave exactly the same, but Go's pretty new, and you never know what is or isn't going to be optimized.

Re:Stop avoiding regular expressions damn it by Titanous on Sunday May 12, 2013 @10:14AM (#5694295)

    `\A@(.*)@\z`

    BenchmarkRegexp	  500000	      5181 ns/op
    BenchmarkStrings	10000000	       171 ns/op