<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using DbUp.Engine;
using DbUp.Engine.Transactions;

namespace DbUp.Support.SqlServer.Scripting
{

    /// <summary>
    /// This script provider will collect all the scripts in the generated Definitions folder and attempt to order
    /// them in order of dependency, the dependency searching is quite basic, as it only looks for
    /// references of named entries, however this could be easily extended
    /// </summary>
    public class DefinitionScriptProvider : IScriptProvider
    {
        private readonly string _defintionFolderPath;
        private readonly Regex _contentReplaceRegex;
        public DefinitionScriptProvider(string defintionFolderPath = "..\\..\\Definitions", string contentReplaceRegex = "(SET ANSI_NULLS ON)|(SET QUOTED_IDENTIFIER ON)")
        {
            if (Directory.Exists(defintionFolderPath))
            {
                _defintionFolderPath = new DirectoryInfo(defintionFolderPath).FullName;
            }
            if (_defintionFolderPath == null)
            {<commit_msg>Expand regex for cleaning content<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using DbUp.Engine;
using DbUp.Engine.Transactions;

namespace DbUp.Support.SqlServer.Scripting
{

    /// <summary>
    /// This script provider will collect all the scripts in the generated Definitions folder and attempt to order
    /// them in order of dependency, the dependency searching is quite basic, as it only looks for
    /// references of named entries, however this could be easily extended
    /// </summary>
    public class DefinitionScriptProvider : IScriptProvider
    {
        private readonly string _defintionFolderPath;
        private readonly Regex _contentReplaceRegex;
        public DefinitionScriptProvider(string defintionFolderPath = "..\\..\\Definitions", 
            string contentReplaceRegex = "(SET ANSI_NULLS ON)|(SET ANSI_NULLS OFF)|(SET QUOTED_IDENTIFIER OFF)|(SET QUOTED_IDENTIFIER ON)")
        {
            if (Directory.Exists(defintionFolderPath))
            {
                _defintionFolderPath = new DirectoryInfo(defintionFolderPath).FullName;
            }
            if (_defintionFolderPath == null)
            {
{'fraction_non_alphanumeric': 0.0784313725490196, 'fraction_numerical': 0.0, 'mean_word_length': 3.122895622895623, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2012492', 'n_tokens_mistral': 632, 'n_tokens_neox': 612, 'n_words': 196}