src/taskForm.cs
/// <summary>
/// Extracts submissions IDs from text containing URLs and newline characters.
/// Returns false if any unexpected characters are found.
/// </summary>
Extracts submissions IDs from text containing URLs and newline characters.
Returns false if any unexpected characters are found.
Extracts submissions IDs from text containing URLs and newline characters . Returns false if any unexpected characters are found .
private static bool submUrlsListValidate(ref string text)
        {
            text = text.ToLower();
            string[] toremove = {
                "https://", "http://", "furaffinity.net/view/", "furaffinity.net/full/", "/", "www."
            };
            foreach (string r in toremove)
                text = text.Replace(r, "");
            var lines = text.Split("\r\n".ToCharArray());
            foreach (var line in lines)
            {
                if (!string.IsNullOrEmpty(line)
                    && !Regex.IsMatch(line, @"^(?<id>[0-9]+?)(#(?<fid>[0-9]+?)){0,1}(@(?<attr>.+?)){0,1}$"))
                {
                    return false;
                }
            }
            return true;
        }
private static bool submUrlsListValidate ( ref string text ) { text = text . ToLower ( ) ; string [ ] toremove = { " " , " " , " " , " " , " " , " " } ; foreach ( string r in toremove ) text = text . Replace ( r , " " ) ; var lines = text . Split ( " \r \n " . ToCharArray ( ) ) ; foreach ( var line in lines ) { if ( ! string . IsNullOrEmpty ( line ) && ! Regex . IsMatch ( line , @"^(?<id>[0-9]+?)(#(?<fid>[0-9]+?)){0,1}(@(?<attr>.+?)){0,1}$" ) ) { return false ; } } return true ; }
Extracts submissions IDs from text containing URLs and newline characters.
Extracts submissions IDs from text containing URLs and newline characters .
string
ref