<commit_before>import { REGEXP_LITERAL } from 'config/types';

// as far as I can tell, this only falls over if modifiers are repeated erroneously
var regexpPattern = /^\/(?:(?=\\)..|[^\/])+\/[gimy]{0,4}(?=[\s\.\),])/;

export default function readNumberLiteral ( parser ) {
	var result;

	if ( result = parser.matchPattern( regexpPattern ) ) {
		return {
			t: REGEXP_LITERAL,
			v: result
		};
	}

	return null;
}<commit_msg>use @MartinKolarik's regexp regexp for great justice<commit_after>import { REGEXP_LITERAL } from 'config/types';

var regexpPattern = /^(\/(?:[^\n\r\u2028\u2029/\\[]|\\.|\[(?:[^\n\r\u2028\u2029\]\\]|\\.)*])+\/(?:([gimuy])(?![a-z]*\2))*(?![-a-zA-Z_$0-9]))/;

export default function readNumberLiteral ( parser ) {
	var result;

	if ( result = parser.matchPattern( regexpPattern ) ) {
		return {
			t: REGEXP_LITERAL,
			v: result
		};
	}

	return null;
}
{'fraction_non_alphanumeric': 0.21818181818181817, 'fraction_numerical': 0.023863636363636365, 'mean_word_length': 3.5885416666666665, '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': '7661260', 'n_tokens_mistral': 374, 'n_tokens_neox': 341, 'n_words': 71}