<commit_before>'use strict';
const chalk = require('..');

const ignoreChars = /[^!-~]/;

function rainbow(str, offset) {
	if (!str || str.length === 0) {
		return str;
	}

	const hueStep = 360 / str.replace(ignoreChars, '').length;

	let hue = offset % 360;
	const chars = [];
	for (const c of str) {<commit_msg>Fix ignore chars regex flags in rainbow example (#306)<commit_after>'use strict';
const chalk = require('..');

const ignoreChars = /[^!-~]/g;

function rainbow(str, offset) {
	if (!str || str.length === 0) {
		return str;
	}

	const hueStep = 360 / str.replace(ignoreChars, '').length;

	let hue = offset % 360;
	const chars = [];
	for (const c of str) {
{'fraction_non_alphanumeric': 0.18413173652694612, 'fraction_numerical': 0.025449101796407185, 'mean_word_length': 3.6783216783216783, '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': '4968217', 'n_tokens_mistral': 267, 'n_tokens_neox': 224, 'n_words': 73}