<commit_before>var normalize = require('./normalize')
var re = /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?github.com[:\/]([^\/]+)\/([^\/]+?)(?:.git)?(?:#(.*))?$/

module.exports = github
function github(url) {
  try {
    url = normalize(url)
    var m = re.exec(url.replace(/\.git$/, ''))
    var user = m[1]
    var repo = m[2]
    var hash = m[3] || 'master'
    return [user, repo, hash]
  } catch (err) {
    return null
  }
}<commit_msg>Use node's url parser for github parsing<commit_after>var url = require('url')
var normalize = require('./normalize')
var re = /^\/([^\/]+?)\/([^\/]+?)$/

module.exports = github
function github(u) {
  try {
    u = normalize(u)
    var p = url.parse(u)
    if (p.hostname !== 'github.com') return null
    var m = re.exec(p.path.replace(/\.git$/, ''))
    var user = m[1]
    var repo = m[2]
    var hash = (p.hash || '#master').substring(1)
    return [user, repo, hash]
  } catch (err) {
    return null
  }
}
{'fraction_non_alphanumeric': 0.25263157894736843, 'fraction_numerical': 0.00631578947368421, 'mean_word_length': 2.7738095238095237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4573750', 'n_tokens_mistral': 375, 'n_tokens_neox': 360, 'n_words': 84}