Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # from the KNOWN_REGEXPS constant (by default)
- def get_meta_value(path, regexp, kregexp = KNOWN_REGEXPS)
- result = nil
- txt = retrieve_content(path)
- if txt
- kregexp[regexp].each do |rp|
- mvalue = txt.scan(rp).flatten[0]
- if mvalue
- result = { :str => mvalue, :buf => txt }
- end
- end
- end
- return result
- end
Add Comment
Please, Sign In to add comment