Skip to content

Instantly share code, notes, and snippets.

View mgadda's full-sized avatar

Matt Gadda mgadda

View GitHub Profile
def n5s(str)
first, num, last = str.match(/([a-zA-Z])(\d+)([a-zA-Z])/).captures
num = num.to_i
puts open("/usr/share/dict/words").grep(/\b#{first}[a-zA-Z]{#{num}}#{last}\b/)
end
> n5s("i18n")
institutionalization
intercrystallization
interdifferentiation
operator prefix ~ {}
@prefix func ~(pattern: String) -> NSRegularExpression! {
var error: NSError?
return NSRegularExpression.regularExpressionWithPattern(
pattern,
options: nil,
error: &error)
}