<commit_before>/*
 * regex-pill
 * https://github.com/lgoldstien/regex-pill
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var RegexLibraryContents = {
    "hostnames":{
        "databases": {
            "mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
        }
    }
};


var RegexLibrary = function () {

};

RegexLibrary.prototype.get = function (name) {
    this._selectedRegex = name;
};

module.exports = RegexLibrary;<commit_msg>Add some improvements to assigning regex, begin validate method<commit_after>/*
 * regex-pill
 * https://github.com/lgoldstien/regex-pill
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var RegexLibraryContents = {
    "hostnames/databases/mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
};


var RegexLibrary = function (value, name) {
    if (!value)
        throw new ReferenceError("A value should be passed to this constructor.");

    this._value = value;

    if (name)
        this.setRegex(name);

    return this;
};

RegexLibrary.prototype.isValid = function () {
    var regex;

    if (!this._selectedRegex.regex)
        throw new ReferenceError("Cannot validate against a non-existant regex.");

    regex = this._selectedRegex.regex;

    
};

RegexLibrary.prototype.setRegex = function (name) {
    this._selectedRegex = { name: name };

    (RegexLibraryContents[this._selectedRegex.name]) ?
        this._selectedRegex.regex = RegexLibraryContents[this._selectedRegex.name] :
        this._selectedRegex = {};


};

module.exports = RegexLibrary;
{'fraction_non_alphanumeric': 0.17980884109916367, 'fraction_numerical': 0.014336917562724014, 'mean_word_length': 3.125615763546798, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6496393', 'n_tokens_mistral': 596, 'n_tokens_neox': 559, 'n_words': 107}