Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
married

Vlad Patryshev vpatryshev

💭
married
View GitHub Profile
@vpatryshev
vpatryshev / RE.scala
Created Sep 24, 2012
regexp from Beautiful Code, in tongues
View RE.scala
case class Ch(c: Char) { def ~=(x: Char) = c == '.' || c == x }
class RE(val regexp: String) {
def skip(n: Int) = RE(regexp.substring(n))
implicit def token(c: Char) = Ch(c)
def c0 = Ch(regexp(0))
def c1 = regexp(1)
def ~=(text: String): Boolean = {
View gist:5b3ace3c48cbd25c7562
### Keybase proof
I hereby claim:
* I am vpatryshev on github.
* I am vpatryshev (https://keybase.io/vpatryshev) on keybase.
* I have a public key whose fingerprint is F7CC C6E9 59DF 55AF 2BE7 676B 31F4 2673 9622 4C88
To claim this, I am signing this object: