From 328f7224214485d5d21b27345fe90414d347a111 Mon Sep 17 00:00:00 2001 From: Nikunj Taneja <32366458+underscoreorcus@users.noreply.github.com> Date: Tue, 2 Oct 2018 12:03:24 +0800 Subject: [PATCH 001/285] Create coin_change.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = { S1, S2, .. , Sm} valued coins, how many ways can we make the change? The order of coins doesn’t matter. --- dynamic-programming/coin_change.cpp | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 dynamic-programming/coin_change.cpp diff --git a/dynamic-programming/coin_change.cpp b/dynamic-programming/coin_change.cpp new file mode 100644 index 00000000..39a45f73 --- /dev/null +++ b/dynamic-programming/coin_change.cpp @@ -0,0 +1,41 @@ +#include + +using namespace std; + +int count( int S[], int m, int n ) +{ + int i, j, x, y; + + // We need n+1 rows as the table is constructed + // in bottom up manner using the base case 0 + // value case (n = 0) + int table[n+1][m]; + + // Fill the enteries for 0 value case (n = 0) + for (i=0; i= 0)? table[i - S[j]][j]: 0; + // Count of solutions excluding S[j] + y = (j >= 1)? table[i][j-1]: 0; + table[i][j] = x + y; + } + } + return table[n][m-1]; +} + +int main() +{ + int coins[] = {1, 2, 3}; + int m = sizeof(coins)/sizeof(int); + int n = 5; + cout << count(coins, m, n); + return 0; +} From 15f30344be86b83bd8c028e24cea61013ff59e85 Mon Sep 17 00:00:00 2001 From: Rituparno Biswas Date: Tue, 2 Oct 2018 09:36:15 +0530 Subject: [PATCH 002/285] added selection_sort.cpp --- sorting/selection_sort.cpp | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sorting/selection_sort.cpp diff --git a/sorting/selection_sort.cpp b/sorting/selection_sort.cpp new file mode 100644 index 00000000..0ba110d0 --- /dev/null +++ b/sorting/selection_sort.cpp @@ -0,0 +1,49 @@ +// C++ implementation of selection sort +// +// Author: Rituparno Biswas + +#include + +// Swap elements +void swap(int *x, int *y) +{ + int temp = *x; + *x = *y; + *y = temp; +} + +// Implement selection sort +void selectionSort(int arr[], int n) +{ + int i, j, min_id; + for (i = 0; i < n-1; i++) + { + min_id=i; + for (j = i+1; j < n; j++) + if (arr[min_id] > arr[j]) + min_id=j; + swap(&arr[i], &arr[min_id]); + } +} + +// Function to print elements +void printArray(int arr[], int size) +{ + int i; + for (i=0; i < size; i++) + printf("%d ", arr[i]); + printf("\n"); +} + +// test +int main() +{ + int arr[] = {46, 24, 33, 10, 2, 81, 50}; + int n = sizeof(arr)/sizeof(arr[0]); + printf("Unsorted array: \n"); + printArray(arr, n); + selectionSort(arr, n); + printf("Sorted array: \n"); + printArray(arr, n); + return 0; +} From 35d2cecc72e16545008eaeb1bfb208e12758b2e1 Mon Sep 17 00:00:00 2001 From: Tushar Kanakagiri Date: Tue, 2 Oct 2018 09:38:28 +0530 Subject: [PATCH 003/285] Adding strings related algorithms --- strings/naive-search.cpp | 43 ++++++++++++++++ strings/rabin-karp.cpp | 77 +++++++++++++++++++++++++++++ strings/remove-duplicate-string.cpp | 37 ++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 strings/naive-search.cpp create mode 100644 strings/rabin-karp.cpp create mode 100644 strings/remove-duplicate-string.cpp diff --git a/strings/naive-search.cpp b/strings/naive-search.cpp new file mode 100644 index 00000000..0f00e1fe --- /dev/null +++ b/strings/naive-search.cpp @@ -0,0 +1,43 @@ +/* C program for A modified Naive Pattern Searching + algorithm that is optimized for the cases when all + characters of pattern are different */ +#include +#include + +/* A modified Naive Pettern Searching algorithn that is optimized + for the cases when all characters of pattern are different */ +void search(char pat[], char txt[]) +{ + int M = strlen(pat); + int N = strlen(txt); + int i = 0; + + while (i <= N - M) + { + int j; + + /* For current index i, check for pattern match */ + for (j = 0; j < M; j++) + if (txt[i+j] != pat[j]) + break; + + if (j == M) // if pat[0...M-1] = txt[i, i+1, ...i+M-1] + { + printf("Pattern found at index %d \n", i); + i = i + M; + } + else if (j == 0) + i = i + 1; + else + i = i + j; // slide the pattern by j + } +} + +/* Driver program to test above function */ +int main() +{ + char txt[] = ""; //Enter the entire string here + char pat[] = ""; //Enter the string to be searched here + search(pat, txt); + return 0; +} \ No newline at end of file diff --git a/strings/rabin-karp.cpp b/strings/rabin-karp.cpp new file mode 100644 index 00000000..e0c36ef6 --- /dev/null +++ b/strings/rabin-karp.cpp @@ -0,0 +1,77 @@ +/* Following program is a C implementation of Rabin Karp +Algorithm given in the CLRS book */ +#include +#include + +// d is the number of characters in the input alphabet +#define d 256 + +/* pat -> pattern + txt -> text + q -> A prime number +*/ +void search(char pat[], char txt[], int q) +{ + int M = strlen(pat); + int N = strlen(txt); + int i, j; + int p = 0; // hash value for pattern + int t = 0; // hash value for txt + int h = 1; + + // The value of h would be "pow(d, M-1)%q" + for (i = 0; i < M-1; i++) + h = (h*d)%q; + + // Calculate the hash value of pattern and first + // window of text + for (i = 0; i < M; i++) + { + p = (d*p + pat[i])%q; + t = (d*t + txt[i])%q; + } + + // Slide the pattern over text one by one + for (i = 0; i <= N - M; i++) + { + + // Check the hash values of current window of text + // and pattern. If the hash values match then only + // check for characters on by one + if ( p == t ) + { + /* Check for characters one by one */ + for (j = 0; j < M; j++) + { + if (txt[i+j] != pat[j]) + break; + } + + // if p == t and pat[0...M-1] = txt[i, i+1, ...i+M-1] + if (j == M) + printf("Pattern found at index %d \n", i); + } + + // Calculate hash value for next window of text: Remove + // leading digit, add trailing digit + if ( i < N-M ) + { + t = (d*(t - txt[i]*h) + txt[i+M])%q; + + // We might get negative value of t, converting it + // to positive + if (t < 0) + t = (t + q); + } + } +} + +/* Driver program to test above function */ +int main() +{ + char txt[] = ""; //Enter the entire text here + char pat[] = ""; //Enter the string to be searched here + int q = 101; // A prime number + search(pat, txt, q); + return 0; +} \ No newline at end of file diff --git a/strings/remove-duplicate-string.cpp b/strings/remove-duplicate-string.cpp new file mode 100644 index 00000000..8c218f59 --- /dev/null +++ b/strings/remove-duplicate-string.cpp @@ -0,0 +1,37 @@ +// C++ program to count all duplicates from string using hashing +# include +# include +# define NO_OF_CHARS 256 + +/* Fills count array with frequency of characters */ +void fillCharCounts(char *str, int *count) +{ + int i; + for (i = 0; *(str+i); i++) + count[*(str+i)]++; +} + +/* Print duplicates present in the passed string */ +void printDups(char *str) +{ + // Create an array of size 256 and fill count of every character in it + int *count = (int *)calloc(NO_OF_CHARS, sizeof(int)); + fillCharCounts(str, count); + + // Print characters having count more than 0 + int i; + for (i = 0; i < NO_OF_CHARS; i++) + if(count[i] > 1) + printf("%c, count = %d \n", i, count[i]); + + free(count); +} + +/* Driver program to test to pront printDups*/ +int main() +{ + char str[] = ""; //Enter string here + printDups(str); + getchar(); + return 0; +} \ No newline at end of file From 7fabf04805417a80986c808bcb7bdda3bf2e79e3 Mon Sep 17 00:00:00 2001 From: Tushar Kanakagiri Date: Tue, 2 Oct 2018 09:48:58 +0530 Subject: [PATCH 004/285] Permutations, Remove Duplicates(2 ways), String reversal --- strings/permutations-of-string.cpp | 71 +++++++++++++++++++ ...-string.cpp => print-duplicate-string.cpp} | 0 strings/remove-duplicates-O(n2).cpp | 37 ++++++++++ strings/remove-duplicates-O(nLogN).cpp | 29 ++++++++ strings/reverse-string.cpp | 51 +++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 strings/permutations-of-string.cpp rename strings/{remove-duplicate-string.cpp => print-duplicate-string.cpp} (100%) create mode 100644 strings/remove-duplicates-O(n2).cpp create mode 100644 strings/remove-duplicates-O(nLogN).cpp create mode 100644 strings/reverse-string.cpp diff --git a/strings/permutations-of-string.cpp b/strings/permutations-of-string.cpp new file mode 100644 index 00000000..b49aa044 --- /dev/null +++ b/strings/permutations-of-string.cpp @@ -0,0 +1,71 @@ +# C program to print all permutations with repetition +# of characters +#include +#include +#include + +/* Following function is used by the library qsort() function + to sort an array of chars */ +int compare (const void * a, const void * b); + +/* The main function that recursively prints all repeated + permutations of the given string. It uses data[] to store all + permutations one by one */ +void allLexicographicRecur (char *str, char* data, int last, int index) +{ + int i, len = strlen(str); + + // One by one fix all characters at the given index and recur for + // the/ subsequent indexes + for ( i=0; i +using namespace std; + +char *removeDuplicate(char str[], int n) +{ + // Used as index in the modified string + int index = 0; + + // Traverse through all characters + for (int i=0; i +using namespace std; + +char *removeDuplicate(char str[], int n) +{ + // create a set using string characters + // excluding '\0' + sets (str, str+n-1); + + // print content of the set + int i = 0; + for (auto x : s) + str[i++] = x; + str[i] = '\0'; + + return str; +} + +// Driver code +int main() +{ + char str[]= ""; //Enter string here + int n = sizeof(str) / sizeof(str[0]); + cout << removeDuplicate(str, n); + return 0; +} \ No newline at end of file diff --git a/strings/reverse-string.cpp b/strings/reverse-string.cpp new file mode 100644 index 00000000..fc1f725f --- /dev/null +++ b/strings/reverse-string.cpp @@ -0,0 +1,51 @@ +#include + +/* function prototype for utility function to + reverse a string from begin to end */ +void reverse(char* begin, char* end); + +/*Function to reverse words*/ +void reverseWords(char* s) +{ + char* word_begin = s; + char* temp = s; /* temp is for word boundry */ + + /*STEP 1 of the above algorithm */ + while (*temp) { + temp++; + if (*temp == '\0') { + reverse(word_begin, temp - 1); + } + else if (*temp == ' ') { + reverse(word_begin, temp - 1); + word_begin = temp + 1; + } + } /* End of while */ + + /*STEP 2 of the above algorithm */ + reverse(s, temp - 1); +} + +/* UTILITY FUNCTIONS */ +/*Function to reverse any sequence starting with pointer + begin and ending with pointer end */ +void reverse(char* begin, char* end) +{ + char temp; + while (begin < end) { + temp = *begin; + *begin++ = *end; + *end-- = temp; + } +} + +/* Driver function to test above functions */ +int main() +{ + char s[] = ""; //Enter string here + char* temp = s; + reverseWords(s); + printf("%s", s); + getchar(); + return 0; +} \ No newline at end of file From 2f81da25a79ab258316bdaf0b75937e8c63262ba Mon Sep 17 00:00:00 2001 From: Tushar Kanakagiri Date: Tue, 2 Oct 2018 09:52:28 +0530 Subject: [PATCH 005/285] Lexicographic ranking, Anagram Check --- strings/anagram-check.cpp | 90 +++++++++++++++++++++++++++++++ strings/lexicographic-ranking.cpp | 53 ++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 strings/anagram-check.cpp create mode 100644 strings/lexicographic-ranking.cpp diff --git a/strings/anagram-check.cpp b/strings/anagram-check.cpp new file mode 100644 index 00000000..4fbe529d --- /dev/null +++ b/strings/anagram-check.cpp @@ -0,0 +1,90 @@ +// C/C++ program to check whether two strings are anagrams +// of each other +#include +#include + +/* Function prototype for string a given string using + quick sort */ +void quickSort(char *arr, int si, int ei); + +/* function to check whether two strings are anagram of + each other */ +bool areAnagram(char *str1, char *str2) +{ + // Get lenghts of both strings + int n1 = strlen(str1); + int n2 = strlen(str2); + + // If length of both strings is not same, then they + // cannot be anagram + if (n1 != n2) + return false; + + // Sort both strings + quickSort(str1, 0, n1 - 1); + quickSort(str2, 0, n2 - 1); + + // Compare sorted strings + for (int i = 0; i < n1; i++) + if (str1[i] != str2[i]) + return false; + + return true; +} + +// Following functions (exchange and partition are needed +// for quickSort) +void exchange(char *a, char *b) +{ + char temp; + temp = *a; + *a = *b; + *b = temp; +} + +int partition(char A[], int si, int ei) +{ + char x = A[ei]; + int i = (si - 1); + int j; + + for (j = si; j <= ei - 1; j++) + { + if(A[j] <= x) + { + i++; + exchange(&A[i], &A[j]); + } + } + exchange (&A[i + 1], &A[ei]); + return (i + 1); +} + +/* Implementation of Quick Sort +A[] --> Array to be sorted +si --> Starting index +ei --> Ending index +*/ +void quickSort(char A[], int si, int ei) +{ + int pi; /* Partitioning index */ + if(si < ei) + { + pi = partition(A, si, ei); + quickSort(A, si, pi - 1); + quickSort(A, pi + 1, ei); + } +} + +/* Driver program to test to print printDups*/ +int main() +{ + char str1[] = ""; //String 1 + char str2[] = ""; //String 2 + if (areAnagram(str1, str2)) + printf("The two strings are anagram of each other"); + else + printf("The two strings are not anagram of each other"); + + return 0; +} \ No newline at end of file diff --git a/strings/lexicographic-ranking.cpp b/strings/lexicographic-ranking.cpp new file mode 100644 index 00000000..125a2c59 --- /dev/null +++ b/strings/lexicographic-ranking.cpp @@ -0,0 +1,53 @@ +#include +#include + +// A utility function to find factorial of n +int fact(int n) +{ + return (n <= 1)? 1 :n * fact(n-1); +} + +// A utility function to count smaller characters on right +// of arr[low] +int findSmallerInRight(char* str, int low, int high) +{ + int countRight = 0, i; + + for (i = low+1; i <= high; ++i) + if (str[i] < str[low]) + ++countRight; + + return countRight; +} + +// A function to find rank of a string in all permutations +// of characters +int findRank (char* str) +{ + int len = strlen(str); + int mul = fact(len); + int rank = 1; + int countRight; + + int i; + for (i = 0; i < len; ++i) + { + mul /= len - i; + + // count number of chars smaller than str[i] + // fron str[i+1] to str[len-1] + countRight = findSmallerInRight(str, i, len-1); + + rank += countRight * mul ; + } + + return rank; +} + +// Driver program to test above function +int main() +{ + char str[] = ""; //Enter string here + printf ("%d", findRank(str)); + return 0; +} \ No newline at end of file From dca7a2ea29fffd61b465bcbed8ef63f5b5060a0e Mon Sep 17 00:00:00 2001 From: Tushar Kanakagiri Date: Tue, 2 Oct 2018 09:55:46 +0530 Subject: [PATCH 006/285] Longest palindrom subset, remove adjacent duplicates --- strings/longest-palindrome-subset.cpp | 84 ++++++++++++++++++++++++++ strings/remove-adjacent-duplicates.cpp | 65 ++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 strings/longest-palindrome-subset.cpp create mode 100644 strings/remove-adjacent-duplicates.cpp diff --git a/strings/longest-palindrome-subset.cpp b/strings/longest-palindrome-subset.cpp new file mode 100644 index 00000000..78777e1c --- /dev/null +++ b/strings/longest-palindrome-subset.cpp @@ -0,0 +1,84 @@ +// A dynamic programming solution for longest palindr. +// This code is adopted from following link +// http://www.leetcode.com/2011/11/longest-palindromic-substring-part-i.html + +#include +#include + +// A utility function to print a substring str[low..high] +void printSubStr( char* str, int low, int high ) +{ + for( int i = low; i <= high; ++i ) + printf("%c", str[i]); +} + +// This function prints the longest palindrome substring +// of str[]. +// It also returns the length of the longest palindrome +int longestPalSubstr( char *str ) +{ + int n = strlen( str ); // get length of input string + + // table[i][j] will be false if substring str[i..j] + // is not palindrome. + // Else table[i][j] will be true + bool table[n][n]; + memset(table, 0, sizeof(table)); + + // All substrings of length 1 are palindromes + int maxLength = 1; + for (int i = 0; i < n; ++i) + table[i][i] = true; + + // check for sub-string of length 2. + int start = 0; + for (int i = 0; i < n-1; ++i) + { + if (str[i] == str[i+1]) + { + table[i][i+1] = true; + start = i; + maxLength = 2; + } + } + + // Check for lengths greater than 2. k is length + // of substring + for (int k = 3; k <= n; ++k) + { + // Fix the starting index + for (int i = 0; i < n-k+1 ; ++i) + { + // Get the ending index of substring from + // starting index i and length k + int j = i + k - 1; + + // checking for sub-string from ith index to + // jth index iff str[i+1] to str[j-1] is a + // palindrome + if (table[i+1][j-1] && str[i] == str[j]) + { + table[i][j] = true; + + if (k > maxLength) + { + start = i; + maxLength = k; + } + } + } + } + + printf("Longest palindrome substring is: "); + printSubStr( str, start, start + maxLength - 1 ); + + return maxLength; // return length of LPS +} + +// Driver program to test above functions +int main() +{ + char str[] = ""; //Enter string here + printf("\nLength is: %d\n", longestPalSubstr( str ) ); + return 0; +} \ No newline at end of file diff --git a/strings/remove-adjacent-duplicates.cpp b/strings/remove-adjacent-duplicates.cpp new file mode 100644 index 00000000..766e5568 --- /dev/null +++ b/strings/remove-adjacent-duplicates.cpp @@ -0,0 +1,65 @@ +// C/C++ program to remove all adjacent duplicates from a string +#include +#include +using namespace std; + +// Recursively removes adjacent duplicates from str and returns +// new string. las_removed is a pointer to last_removed character +char* removeUtil(char *str, char *last_removed) +{ + // If length of string is 1 or 0 + if (str[0] == '\0' || str[1] == '\0') + return str; + + // Remove leftmost same characters and recur for remaining + // string + if (str[0] == str[1]) + { + *last_removed = str[0]; + while (str[1] && str[0] == str[1]) + str++; + str++; + return removeUtil(str, last_removed); + } + + // At this point, the first character is definiotely different + // from its adjacent. Ignore first character and recursively + // remove characters from remaining string + char* rem_str = removeUtil(str+1, last_removed); + + // Check if the first character of the rem_string matches with + // the first character of the original string + if (rem_str[0] && rem_str[0] == str[0]) + { + *last_removed = str[0]; + return (rem_str+1); // Remove first character + } + + // If remaining string becomes empty and last removed character + // is same as first character of original string. This is needed + // for a string like "acbbcddc" + if (rem_str[0] == '\0' && *last_removed == str[0]) + return rem_str; + + // If the two first characters of str and rem_str don't match, + // append first character of str before the first character of + // rem_str. + rem_str--; + rem_str[0] = str[0]; + return rem_str; +} + +char *remove(char *str) +{ + char last_removed = '\0'; + return removeUtil(str, &last_removed); +} + +// Driver program to test above functions +int main() +{ + char str1[] = ""; //Enter string + cout << remove(str1) << endl; + + return 0; +} \ No newline at end of file From 41597ae94fe84ba7b5cd5d5ca8f22eb2eeb22397 Mon Sep 17 00:00:00 2001 From: Pablo Trinidad Date: Mon, 1 Oct 2018 23:36:04 -0500 Subject: [PATCH 007/285] Add factorial with docs --- math/Factorial/README.md | 5 +++++ math/Factorial/factorial.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 math/Factorial/README.md create mode 100644 math/Factorial/factorial.cpp diff --git a/math/Factorial/README.md b/math/Factorial/README.md new file mode 100644 index 00000000..5ed2ca8f --- /dev/null +++ b/math/Factorial/README.md @@ -0,0 +1,5 @@ +# Factorial + +The factorial of a non-negative integer *n*, denoted by *n!*, is +the product of all positive integers less than or equal to *n*. +For example: `5! = 5 x 4 x 3 x 2 x 1 = 120`. diff --git a/math/Factorial/factorial.cpp b/math/Factorial/factorial.cpp new file mode 100644 index 00000000..1fd5ea07 --- /dev/null +++ b/math/Factorial/factorial.cpp @@ -0,0 +1,24 @@ +/* Factorial + +Author: Pablo Trinidad +*/ + +#include +using namespace std; + +int factorial(int n) { + if (n <= 0) { + return 1; + } else { + return n * factorial(n - 1); + } +} + +int main() { + int n; + cout << "Enter an integer n to compute its factorial: "; + cin >> n; + int r = factorial(n); + cout << n << "! = " << r << endl; + return 0; +} From bc6b112f9deb76f4a56f0e57beba874526eff1cb Mon Sep 17 00:00:00 2001 From: Rituparno Biswas Date: Tue, 2 Oct 2018 10:14:34 +0530 Subject: [PATCH 008/285] Create count_disconnected_components.cpp --- graphs/count_diconnected_components.cpp | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 graphs/count_diconnected_components.cpp diff --git a/graphs/count_diconnected_components.cpp b/graphs/count_diconnected_components.cpp new file mode 100644 index 00000000..0ee61601 --- /dev/null +++ b/graphs/count_diconnected_components.cpp @@ -0,0 +1,69 @@ +#include +#include +using namespace std; + +int count=1; +// Graph class represents a directed graph +// using adjacency list representation +class Graph +{ + int V; + list *adj; + void DFSUtil(int v, bool visited[]); +public: + Graph(int V); + void addEdge(int v, int w); + void DFS(int v); +}; + +Graph::Graph(int V) +{ + this->V = V; + adj = new list[V]; +} + +void Graph::addEdge(int v, int w) +{ + adj[v].push_back(w); // Add w to v’s list. +} + +void Graph::DFSUtil(int v, bool visited[]) +{ + visited[v] = true; + list::iterator i; + for (i = adj[v].begin(); i != adj[v].end(); ++i) + if (!visited[*i]) + DFSUtil(*i, visited); +} +void Graph::DFS(int v) +{ + bool *visited = new bool[V]; + for (int i = 0; i < V; i++) + visited[i] = false; + DFSUtil(v, visited); + for (int i = 0; i < V; i++) + if(visited[i] == false) + { + count++; + DFSUtil(i, visited); + } +} + +int main() +{ + Graph g(9); + g.addEdge(0, 1); + g.addEdge(0, 2); + g.addEdge(1, 2); + g.addEdge(2, 0); + g.addEdge(2, 3); + g.addEdge(3, 3); + g.addEdge(4, 5); + g.addEdge(6, 7); + g.addEdge(6, 8); + + g.DFS(2); + cout << "Number of disconnected components in the given graph is : " < Date: Tue, 2 Oct 2018 00:15:06 -0500 Subject: [PATCH 009/285] Add collatz sequence --- math/Collatz Sequence/README.md | 9 +++++++++ math/Collatz Sequence/collatz.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 math/Collatz Sequence/README.md create mode 100644 math/Collatz Sequence/collatz.cpp diff --git a/math/Collatz Sequence/README.md b/math/Collatz Sequence/README.md new file mode 100644 index 00000000..87d7df89 --- /dev/null +++ b/math/Collatz Sequence/README.md @@ -0,0 +1,9 @@ +# Collatz conjecture + +The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: + * Start with any positive integer n. + * Then each term is obtained from the previous term as follows: + * if the previous term is even, the next term is one half the previous term. + * If the previous term is odd, the next term is 3 times the previous term plus 1. + +The conjecture is that no matter what value of n, the sequence will always reach 1. diff --git a/math/Collatz Sequence/collatz.cpp b/math/Collatz Sequence/collatz.cpp new file mode 100644 index 00000000..c46b99fb --- /dev/null +++ b/math/Collatz Sequence/collatz.cpp @@ -0,0 +1,25 @@ +/* Collatz sequenge +Author: Pablo Trinidad +*/ + +#include +using namespace std; + +void collatz(int n) { + while (n > 1) { + cout << n << " "; + if (n % 2 == 0) { + n = n / 2; + } else { + n = (3 * n) + 1; + } + } + cout << n << endl; +} +int main() { + int n; + cout << "Enter an integer n to compute the Collatz sequence: "; + cin >> n; + collatz(n); + return 0; +} From 5d2ad57afea2edec7838c2e68dab684093ca45ac Mon Sep 17 00:00:00 2001 From: Pritam Negi Date: Tue, 2 Oct 2018 10:49:05 +0530 Subject: [PATCH 010/285] Create prims_adjacency_list.cpp --- graphs/prims_adjacency_list.cpp | 100 ++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 graphs/prims_adjacency_list.cpp diff --git a/graphs/prims_adjacency_list.cpp b/graphs/prims_adjacency_list.cpp new file mode 100644 index 00000000..b12c8137 --- /dev/null +++ b/graphs/prims_adjacency_list.cpp @@ -0,0 +1,100 @@ + +/* The following is an implementation of Prim's algorithm + using adjacency list representation of a graph. The data structure + min heap is used for this. There are, again, two implementations + in this, the min heap code can be written differently in a class, or + the priority_queue present in STL can be used. Here, it's the + latter. + Now, a priority_queue is essentially a max heap, but can be used + as given below to form a min heap. The loop statements execute + v+e times, in addition to log(v) time for adding to priority_queue. + Overall, O(v+e)*O(log(v)) = O((e+v)*log(v)) + e = O(v^2) for dense graphs, because e <= v*(v-1)/2 for any connected graph. + And e = O(v), or, v = O(e) for sparsely connected graphs. + Hence, O((e+v)*log(v)) = O(e*log(v)). + The pop() and top() operations take O(log(v)) and O(1) time + respectively. +*/ + +#include +#define INF INT_MAX + +using namespace std; + +int main(){ + + cout << "Enter number of vertices of the graph" << endl; + int v; + cin >> v; + + vector > adj[v]; + int i, j; //Iterators + + cout << "Enter number of edges of the graph" << endl; + int e; + cin>>e; + + cout << "Enter the vertices and their edge weights in the following format :" << endl; + cout << "Vertex1 Vertex2 Weight" << endl; + cout << "PS : First vertex should be 0." << endl; + + for (i = 0; i < e; i ++){ + int v1,v2,w; + cin >> v1 >> v2 >> w; + adj[v1].push_back(make_pair(w,v2)); + adj[v2].push_back(make_pair(w,v1)); + } + + int mst[v]; + //Array to store MST + int keys[v]; + //Key values of every edge + bool included[v]; + //The corresponding vertex has already been included if true + + for (i = 0; i < v; i ++){ + mst[i] = -1; + keys[i] = INF; + //Set all key values to infinity + included[i] = false; + //None of the vertices have been included yet + } + + int selected = 0; + + priority_queue< pair , vector > , greater< pair > > Q; + //Priority queue as a minHeap + pair p; + //This is used to traverse through the vertices + + mst[0] = 0; + Q.push(make_pair(0,0)); + //To start MST with node 0, the root node + + while(!Q.empty()){ + + p = Q.top(); + selected = p.second; + //Edge with minimum weight is selected + Q.pop(); + + for(int i = 0;i < adj[selected].size(); i++ ){ + int next = adj[selected][i].second; + //This variable stores index of the adjacent vertices to 'selected' + int weight = adj[selected][i].first; + + if (!included[next] && keys[next] > weight){ + keys[next] = weight; + Q.push(adj[selected][i]); + mst[next] = selected; + } + } + } + + cout << "Minimum spanning tree has been generated." << endl; + + for(i = 1; i < v; i++){ + cout<< mst[i] <<" "; + } + return 0; +} From 4ce04ab2724f15eb598bf7522ac9339aa9b91b82 Mon Sep 17 00:00:00 2001 From: Yuval Zach Date: Mon, 1 Oct 2018 22:48:07 -0700 Subject: [PATCH 011/285] Unify code style and resolve numerous compile error in sorting --- sorting/bubble_sort.cpp | 49 +++++++------ .../{insertionSort.cpp => insertion_sort.cpp} | 37 +++++----- sorting/merge_sort.cpp | 47 +++++++------ sorting/quick_sort.cpp | 69 ++++++++++--------- 4 files changed, 107 insertions(+), 95 deletions(-) rename sorting/{insertionSort.cpp => insertion_sort.cpp} (50%) diff --git a/sorting/bubble_sort.cpp b/sorting/bubble_sort.cpp index 3fb6af54..d133dbfb 100644 --- a/sorting/bubble_sort.cpp +++ b/sorting/bubble_sort.cpp @@ -13,34 +13,39 @@ void swap(int *x, int *y) } // Implement bubble sort -void bubbleSort(int arr[], int n) +void bubble_sort(int arr[], size_t n) { - int i, j; - for (i = 0; i < n-1; i++) - // last i elements are already in place - for (j = 0; j < n-i-1; j++) - if (arr[j] > arr[j+1]) - swap(&arr[j], &arr[j+1]); + for (size_t i = 0; i < n - 1; i++) + { + // last i elements are already in place + for (size_t j = 0; j < n-i-1; j++) + { + if (arr[j] > arr[j + 1]) + { + swap(&arr[j], &arr[j + 1]); + } + } + } } -// Function to print elements -void printArray(int arr[], int size) -{ - int i; - for (i=0; i < size; i++) - printf("%d ", arr[i]); - printf("\n"); -} +// A utility function to print an array of size n +void print_array(int arr[], int n) +{ + for (size_t i = 0; i < n; i++) + { + std::cout << arr[i] << " "; + } + std::cout << std::endl; +} -// test int main() { int arr[] = {46, 24, 33, 10, 2, 81, 50}; int n = sizeof(arr)/sizeof(arr[0]); - printf("Unsorted array: \n"); - printArray(arr, n); - bubbleSort(arr, n); - printf("Sorted array: \n"); - printArray(arr, n); - return 0; + std::cout << "Unsorted array:" << std::endl; + print_array(arr, n); + bubble_sort(arr, n); + std::cout << "Sorted array:" << std::endl; + print_array(arr, n); + return 0; } diff --git a/sorting/insertionSort.cpp b/sorting/insertion_sort.cpp similarity index 50% rename from sorting/insertionSort.cpp rename to sorting/insertion_sort.cpp index 6543970d..b6cec71d 100644 --- a/sorting/insertionSort.cpp +++ b/sorting/insertion_sort.cpp @@ -6,33 +6,35 @@ #include /* Function to sort an array using insertion sort*/ -void insertionSort(int arr[], int n) +void insertion_sort(int arr[], int n) { - int i, key, j; - for (i = 1; i < n; i++) + int key; + size_t j; + for (size_t i = 1; i < n; i++) { key = arr[i]; - j = i-1; + j = i - 1; /* Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current position */ while (j >= 0 && arr[j] > key) { - arr[j+1] = arr[j]; - j = j-1; + arr[j + 1] = arr[j]; + j--; } - arr[j+1] = key; + arr[j + 1] = key; } } // A utility function to print an array of size n -void printArray(int arr[], int n) +void print_array(int arr[], int n) { - int i; - for (i=0; i < n; i++) - printf("%d ", arr[i]); - printf("\n"); + for (size_t i = 0; i < n; i++) + { + std::cout << arr[i] << " "; + } + std::cout << std::endl; } @@ -41,10 +43,11 @@ void printArray(int arr[], int n) int main() { int arr[] = {12, 11, 13, 5, 6}; - int n = sizeof(arr)/sizeof(arr[0]); - - insertionSort(arr, n); - printArray(arr, n); - + size_t n = sizeof(arr) / sizeof(arr[0]); + std::cout << "Unsorted array:" << std::endl; + print_array(arr, n); + insertion_sort(arr, n); + std::cout << "Sorted array:" << std::endl; + print_array(arr, n); return 0; } diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp index 4c86dd3c..3865c2b9 100644 --- a/sorting/merge_sort.cpp +++ b/sorting/merge_sort.cpp @@ -5,8 +5,7 @@ // abraham@abranhe.com //**************************************** -#include -#include +#include // Merge the two half into a sorted data. void merge(int arr[], int l, int m, int r) @@ -16,8 +15,8 @@ void merge(int arr[], int l, int m, int r) int n2 = r - m; /* create temp arrays */ - int L[n1], R[n2]; - + int* L = new int[n1]; + int* R = new int[n2]; /* Copy data to temp arrays L[] and R[] */ for (i = 0; i < n1; i++) L[i] = arr[l + i]; @@ -60,48 +59,48 @@ void merge(int arr[], int l, int m, int r) j++; k++; } + delete[] L; + delete[] R; } /* l is for left index and r is right index of the sub-array of arr to be sorted */ -void mergeSort(int arr[], int l, int r) +void merge_sort(int arr[], int l, int r) { if (l < r) { // Same as (l+r)/2, but avoids overflow for // large l and h - int m = l+(r-l)/2; + int m = l + (r - l) / 2; // Sort first and second halves - mergeSort(arr, l, m); - mergeSort(arr, m+1, r); + merge_sort(arr, l, m); + merge_sort(arr, m + 1, r); merge(arr, l, m, r); } } /* UTILITY FUNCTIONS */ -/* Function to print an array */ -void printArray(int A[], int size) -{ - int i; - for (i=0; i < size; i++) - printf("%d ", A[i]); - printf("\n"); -} +// A utility function to print an array of size n +void print_array(int arr[], int n) +{ + for (size_t i = 0; i < n; i++) + { + std::cout << arr[i] << " "; + } + std::cout << std::endl; +} /* Driver program to test above functions */ int main() { int arr[] = {12, 11, 13, 5, 6, 7}; int arr_size = sizeof(arr)/sizeof(arr[0]); - - printf("Given array is \n"); - printArray(arr, arr_size); - - mergeSort(arr, 0, arr_size - 1); - - printf("\nSorted array is \n"); - printArray(arr, arr_size); + std::cout << "Unsorted array:" << std::endl; + print_array(arr, arr_size); + merge_sort(arr, 0, arr_size - 1); + std::cout << "Sorted array:" << std::endl; + print_array(arr, arr_size); return 0; } diff --git a/sorting/quick_sort.cpp b/sorting/quick_sort.cpp index 3e72d734..91407403 100644 --- a/sorting/quick_sort.cpp +++ b/sorting/quick_sort.cpp @@ -1,51 +1,56 @@ #include #include -using namespace std; -void quickSort(vector&,int,int); -int partition(vector&, int,int); +void quick_sort(std::vector&, size_t, size_t); +int partition(std::vector&, size_t, size_t); -int main() -{ - vector A = {10,9,8,7,6,5,4,3,2,1}; - int start = 0; - int end = (int)A.size(); - cout << "Before:" << endl; - for(auto value : A) - cout << value <<" "; - cout << endl; - quickSort(A, start, end); - cout << "After: " << endl; - for(auto value : A) - cout << value <<" "; - cout << endl; -} - -void quickSort(vector& A, int start,int end) +void quick_sort(std::vector& arr, size_t start, size_t end) { - int pivot; if(start < end) { - pivot=partition(A, start, end); - quickSort(A, start, pivot); - quickSort(A, pivot+1, end); + int pivot = partition(arr, start, end); + quick_sort(arr, start, pivot); + quick_sort(arr, pivot + 1, end); } } -int partition(vector& A, int start,int end) +int partition(std::vector& arr, size_t start, size_t end) { - int x = A[start]; + int x = arr[start]; int i = start; - int j; - for(j = start+1; j < end; j++) + for(size_t j = start + 1; j < end; j++) { - if(A[j]<=x) - { + if(arr[j]<=x) + { i=i+1; - swap(A[i],A[j]); + std::swap(arr[i], arr[j]); } } - swap(A[i],A[start]); + std::swap(arr[i], arr[start]); return i; } + + +void print_vector(std::vector& arr) +{ + for (size_t i = 0; i < arr.size(); i++) + { + std::cout << arr[i] << " "; + } + std::cout << std::endl; +} + + +int main() +{ + std::vector arr = {10,9,8,7,6,5,4,3,2,1}; + int start = 0; + int end = arr.size(); + std::cout << "Unsorted array:" << std::endl; + print_vector(arr); + quick_sort(arr, start, end); + std::cout << "Sorted array:" << std::endl; + print_vector(arr); +} + From e4ffe3fe9e16d2cdb5a011e60815b2ccc0489033 Mon Sep 17 00:00:00 2001 From: descifrado Date: Tue, 2 Oct 2018 11:18:10 +0530 Subject: [PATCH 012/285] Adding data structures --- data-structures/Queue.cpp | 61 +++++++++++++++++++++++++++++++++++ data-structures/Stack.cpp | 68 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 data-structures/Queue.cpp create mode 100644 data-structures/Stack.cpp diff --git a/data-structures/Queue.cpp b/data-structures/Queue.cpp new file mode 100644 index 00000000..1a67df4c --- /dev/null +++ b/data-structures/Queue.cpp @@ -0,0 +1,61 @@ +#include +#define qsize 5 +struct queue +{ + int arr[qsize]; + int f,r; +}; +typedef struct queue Queue; +void enqueue(Queue *q, int x) +{ + if(q->r==qsize-1) + printf("QUEUE OVERFLOW\n"); + else + q->arr[++q->r]=x; +} +int dequeue(Queue *q) +{ + if(q->f-q->r==1) + printf("Queue Underflow"); + else + return(q->arr[q->f++]); +} +int main() +{ + Queue q; + q.f=0; + q.r=-1; + while(1) + { + printf("Enter 1 to Enqueue\nEnter 2 to Dequeue\nEnter 3 to Display All Elements\nEnter 0 to Exit\n"); + int c; + scanf("%d",&c); + switch(c) + { + case 0: printf("Ended\n"); return 0; + case 1: printf("Enter Element to Enqueue\n"); + int x; + scanf("%d",&x); + enqueue(&q,x); + break; + case 2: if(q.f-q.r==1) + printf("Queue Undeflow\n"); + else + printf("Dequeued Element is %d\n",dequeue(&q)); + break; + case 3: printf("Elements of Queue Are\n"); + if(q.f-q.r==1) + { + printf("Queue is Empty\n"); + break; + } + int i; + for(i=q.f;i<=q.r;i++) + printf("%d ",q.arr[i]); + printf("\n"); + break; + default: printf("Wrong Choice\n"); + } + } + return 0; +} diff --git a/data-structures/Stack.cpp b/data-structures/Stack.cpp new file mode 100644 index 00000000..b3a488cb --- /dev/null +++ b/data-structures/Stack.cpp @@ -0,0 +1,68 @@ +#include +#define max 50 +struct stack +{ + int ch[max]; + int top; +}; +typedef struct stack Stack; +void push(Stack *s, int x) +{ + if(s->top==max-1) + printf("ERROR: Stack Overflow\n"); + else + s->ch[++s->top]=x; +} +int pop(Stack *s) +{ + if(s->top==-1) + { + printf("ERROR: Stack Underflow\n"); + } + else + return (s->ch[s->top--]); +} +int main() +{ + printf("Stack Has Been Initiated...\n"); + Stack s; + s.top=-1; + int c; + while(1) + { + printf("\nEnter 1 to push an element\nEnter 2 to pop an element\nEnter 3 to display all the content of stack\nEnter 0 to exit\n"); + scanf("%d",&c); + switch(c) + { + case 0: return 0; + case 1: + { + printf("Enter element to be pushed\n"); + int x; + scanf("%d",&x); + push(&s,x); + printf("Element successfully pushed\n"); + break; + } + case 2: + { + printf("Poped Element Is %d\n",pop(&s)); + break; + } + case 3: + { + printf("Stack has the following content in order LIFO\n"); + int i; + for(i=s.top;i>=0;i--) + { + printf("%d ",s.ch[i]); + } + break; + } + default: + { + printf("Wrong Choice\n"); + } + } + } +} From 2adb43eecda8a915c6946f09bfda54c54b6beaa6 Mon Sep 17 00:00:00 2001 From: Ton Date: Tue, 2 Oct 2018 13:32:35 +0700 Subject: [PATCH 013/285] Tree Sort --- sorting/tree_sort.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sorting/tree_sort.cpp diff --git a/sorting/tree_sort.cpp b/sorting/tree_sort.cpp new file mode 100644 index 00000000..7fdf71a9 --- /dev/null +++ b/sorting/tree_sort.cpp @@ -0,0 +1,72 @@ +#include +using namespace std; + +struct Node +{ + int key; + struct Node *left, *right; +}; + +struct Node *newNode(int item) +{ + struct Node *temp = new Node; + temp->key = item; + temp->left = temp->right = NULL; + return temp; +} + +void storeSorted(Node *root, int arr[], int &i) +{ + if (root != NULL) + { + storeSorted(root->left, arr, i); + arr[i++] = root->key; + storeSorted(root->right, arr, i); + } +} + +Node* insert(Node* node, int key) +{ + if (node == NULL) return newNode(key); + + if (key < node->key){ + node->left = insert(node->left, key); + }else if (key > node->key) { + node->right = insert(node->right, key); + } + + return node; +} + +void treeSort(int arr[], int n) +{ + struct Node *root = NULL; + + root = insert(root, arr[0]); + for (int i=1; i Date: Tue, 2 Oct 2018 12:17:57 +0530 Subject: [PATCH 014/285] Create modular_exponentiation.cpp --- math/modular_exponentiation.cpp | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 math/modular_exponentiation.cpp diff --git a/math/modular_exponentiation.cpp b/math/modular_exponentiation.cpp new file mode 100644 index 00000000..5acf9a30 --- /dev/null +++ b/math/modular_exponentiation.cpp @@ -0,0 +1,35 @@ +// modular exponentiation implemented in C++ +//Author : Rituparno Biswas + +//Given three numbers x, y and p, compute (power(x,y)) % p. where power(a,b) calculates a to power of b + + +#include +using namespace std; + +typedef long long int ll; + +ll power(ll x, ll y, ll p) +{ + if(x==0) + return 0; + if(y==0) + return 1; + if (y%2==0) + { + ll g=power(x,y/2,p); + return (g*g)%p; + } + else + { + ll g=power(x,y/2,p); + return (x*(g*g)%p)%p; + } +} + +int main() +{ + ll x = 2,y = 5, p = 13; + printf("Power is %lld", power(x, y, p)); + return 0; +} \ No newline at end of file From 5f5c437f900558504e80b8e6aac19844aef404e7 Mon Sep 17 00:00:00 2001 From: Sriram Desai Date: Tue, 2 Oct 2018 13:22:10 +0530 Subject: [PATCH 015/285] Added ternary search implementation. --- searches/ternary_search.cpp | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 searches/ternary_search.cpp diff --git a/searches/ternary_search.cpp b/searches/ternary_search.cpp new file mode 100644 index 00000000..bdd4042d --- /dev/null +++ b/searches/ternary_search.cpp @@ -0,0 +1,54 @@ +// Ternary Search implemented in C++ +//Sriram Desai + +#include +#include +using namespace std; + +vector ar; + +int ternary_search(int l,int r, int x) +{ + if(r>=l) + { + int mid1 = l + (r-l)/3; + int mid2 = r - (r-l)/3; + if(ar[mid1] == x) + return mid1; + if(ar[mid2] == x) + return mid2; + if(xar[mid2]) + return ternary_search(mid2+1,r,x); + else + return ternary_search(mid1+1,mid2-1,x); + + } + return -1; +} + +int main(int argc, char const *argv[]) +{ + int n, key; + cout << "Enter size of array: "; + cin >> n; + cout << "Enter array elements: "; + + for (int i = 0; i < n; ++i) + { + int t; + cin>>t; + ar.push_back(t); + } + cout << "Enter search key: "; + cin>>key; + + int res = ternary_search(0, n-1, key); + + if(res != -1) + cout<< key << " found at index " << res << endl; + else + cout << key << " not found" << endl; + return 0; +} From ade2ec120acc15ecbce4355da07a914210200678 Mon Sep 17 00:00:00 2001 From: mohbius Date: Tue, 2 Oct 2018 13:34:21 +0530 Subject: [PATCH 016/285] Create nth_fibonacci_using_goldenratio.cpp --- math/nth_fibonacci_using_goldenratio.cpp | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 math/nth_fibonacci_using_goldenratio.cpp diff --git a/math/nth_fibonacci_using_goldenratio.cpp b/math/nth_fibonacci_using_goldenratio.cpp new file mode 100644 index 00000000..09e676b1 --- /dev/null +++ b/math/nth_fibonacci_using_goldenratio.cpp @@ -0,0 +1,39 @@ + +// CPP program to find n-th Fibonacci number +#include +using namespace std; + +// Approximate value of golden ratio +double PHI = 1.6180339; + +// Fibonacci numbers upto n = 5 +int f[6] = { 0, 1, 1, 2, 3, 5 }; + +// Function to find nth +// Fibonacci number +int fib (int n) +{ + // Fibonacci numbers for n < 6 + if (n < 6) + return f[n]; + + // Else start counting from + // 5th term + int t = 5, fn = 5; + + while (t < n) { + fn = round(fn * PHI); + t++; + } + + return fn; +} + +int main() +{ + int fibNo; + fibNo = fib(9); //RETURNS 34 + fibNo = fib(8); //RETURNS 21 + fibNo = fib(7); //RETURNS 13 + return 0; +} From ce0899d77eaf85d02a9c5e01ea62c15636a1fe8d Mon Sep 17 00:00:00 2001 From: sahil Date: Tue, 2 Oct 2018 14:07:40 +0530 Subject: [PATCH 017/285] added bogo sort algo --- sorting/bogo_sort.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sorting/bogo_sort.cpp diff --git a/sorting/bogo_sort.cpp b/sorting/bogo_sort.cpp new file mode 100644 index 00000000..968faca6 --- /dev/null +++ b/sorting/bogo_sort.cpp @@ -0,0 +1,47 @@ + + +#include +using namespace std; + + +bool isSorted(int a[], int n) +{ + while ( --n > 1 ) + if (a[n] < a[n-1]) + return false; + return true; +} + + +void shuffle(int a[], int n) +{ + for (int i=0; i < n; i++) + swap(a[i], a[rand()%n]); +} + + +void bogosort(int a[], int n) +{ + + while ( !isSorted(a, n) ) + shuffle(a, n); +} + + +void printArray(int a[], int n) +{ + for (int i=0; i Date: Tue, 2 Oct 2018 14:23:56 +0530 Subject: [PATCH 018/285] Added Slicker Algorithm. --- math/Slicker_Algorithm.cpp | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 math/Slicker_Algorithm.cpp diff --git a/math/Slicker_Algorithm.cpp b/math/Slicker_Algorithm.cpp new file mode 100644 index 00000000..ae39510d --- /dev/null +++ b/math/Slicker_Algorithm.cpp @@ -0,0 +1,68 @@ +// C++ Program to Implement Slicker Algorithm that avoids Triangulation to Find Area of a Polygon + +/* This is a C++ Program to find the area of ploygon using slicker algorithm. +The algorithm assumes the usual mathematical convention that positive y points upwards. +In computer systems where positive y is downwards (most of them) the easiest thing to do +is list the vertices counter-clockwise using the “positive y down” coordinates. +The two effects then cancel out to produce a positive area. */ + +#include + +using namespace std; + +const int MAXPOLY = 200; +double EPSILON = 0.000001; + +class Point +{ + private: + public: + double x, y; +}; + +class Polygon +{ + private: + public: + Point p[MAXPOLY]; + int n; + + Polygon() + { + for (int i = 0; i < MAXPOLY; i++) + Point p[i];// = new Point(); + } +}; + +double area(Polygon p) +{ + double total = 0; + for (int i = 0; i < p.n; i++) + { + int j = (i + 1) % p.n; + total += (p.p[i].x * p.p[j].y) - (p.p[j].x * p.p[i].y); + } + return total / 2; +} + +int main(int argc, char **argv) +{ + Polygon p; + + cout << "Enter the number of points in Polygon: "; + cin >> p.n; + cout << "Enter the coordinates of each point: "; + for (int i = 0; i < p.n; i++) + { + cin >> p.p[i].x; + cin >> p.p[i].y; + } + + double a = area(p); + if (a > 0) + cout << "The Area of Polygon with " << (p.n) + << " points using Slicker Algorithm is : " << a; + else + cout << "The Area of Polygon with " << p.n + << " points using Slicker Algorithm is : " << (a * -1); +} From 836aab1453e728f3313fce879d18926f63863094 Mon Sep 17 00:00:00 2001 From: Saket Kumar <37291252+saket1999@users.noreply.github.com> Date: Tue, 2 Oct 2018 14:42:27 +0530 Subject: [PATCH 019/285] Sorting on vector --- sorting/sort_vector.cpp | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sorting/sort_vector.cpp diff --git a/sorting/sort_vector.cpp b/sorting/sort_vector.cpp new file mode 100644 index 00000000..9216947a --- /dev/null +++ b/sorting/sort_vector.cpp @@ -0,0 +1,45 @@ +// A C++ program to demonstrate working of sort(), +// reverse() +#include +#include +#include +#include //For accumulate operation +using namespace std; + +int main() +{ + // Initializing vector with array values + int arr[] = {10, 20, 5, 23 ,42 , 15}; + int n = sizeof(arr)/sizeof(arr[0]); + vector vect(arr, arr+n); + + cout << "Vector is: "; + for (int i=0; i Date: Tue, 2 Oct 2018 15:12:08 +0530 Subject: [PATCH 020/285] Longest Increasing Subsequence dp solution --- dynamic-programming/lis.cpp | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 dynamic-programming/lis.cpp diff --git a/dynamic-programming/lis.cpp b/dynamic-programming/lis.cpp new file mode 100644 index 00000000..0ff515f5 --- /dev/null +++ b/dynamic-programming/lis.cpp @@ -0,0 +1,39 @@ +#include +#include + +/* lis() returns the length of the longest increasing + subsequence in arr[] of size n */ +int lis( int arr[], int n ) +{ + int *lis, i, j, max = 0; + lis = (int*) malloc ( sizeof( int ) * n ); + + /* Initialize LIS values for all indexes */ + for (i = 0; i < n; i++ ) + lis[i] = 1; + + /* Compute optimized LIS values in bottom up manner */ + for (i = 1; i < n; i++ ) + for (j = 0; j < i; j++ ) + if ( arr[i] > arr[j] && lis[i] < lis[j] + 1) + lis[i] = lis[j] + 1; + + /* Pick maximum of all LIS values */ + for (i = 0; i < n; i++ ) + if (max < lis[i]) + max = lis[i]; + + /* Free memory to avoid memory leak */ + free(lis); + + return max; +} + +int main() +{ + /* Driver program to find Longest Increasing Subsequence */ + int arr[] = { 10, 22, 9, 33, 21, 50, 41, 60 }; + int n = sizeof(arr)/sizeof(arr[0]); + printf("Length of lis is %d", lis( arr, n ) ); + return 0; +} From 9d2ebf0767935f2b60221c8cb9a2fde7bc352e3d Mon Sep 17 00:00:00 2001 From: Swapnilr1 Date: Tue, 2 Oct 2018 16:23:50 +0530 Subject: [PATCH 021/285] Added HeapSort algorithm --- sorting/heap_sort.cpp | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sorting/heap_sort.cpp diff --git a/sorting/heap_sort.cpp b/sorting/heap_sort.cpp new file mode 100644 index 00000000..4c480179 --- /dev/null +++ b/sorting/heap_sort.cpp @@ -0,0 +1,70 @@ +// HeapSorted Implementation (based on CLRS Introduction to Algoithms). + +#include +#include +using namespace std; + +void MaxHeapify(vector&, int, int, int); +void BuildMaxHeap(vector&, int, int, int); +void heapSort(vector&, int, int); + +int main() +{ + vector A = {9,4,5,6,5,3,2,10,200,1}; // Random test data + cout << "UNSORTED:" << endl; + for(int i=0; i& A, int low, int i, int HeapSize) +{ + int largest; + int l = 2*(i)+1; //LEFT(i) + int r = 2*(i)+ 1 + 1; // RIGHT(i) + if (l< HeapSize && A[low+l]>A[low+i]) + { + largest = low+l; + } + else largest = low+i; + if (r< HeapSize && A[low+r]>A[largest]) + { + largest = low+r; + } + if (largest != (low+i)) + { + int temp = A[i+low]; + A[i+low] = A[largest]; + A[largest] = temp; + MaxHeapify(A, low, largest-low, HeapSize ); + } +} + +void BuildMaxHeap(vector& A, int low, int high, int HeapSize) +{ + for (int i=(high-low+1)/2-1; i>=0; i--) + { + MaxHeapify(A,low, i, HeapSize); + } +} + +void heapSort(vector& A, int low, int high) +{ + int HeapSize = high-low+1; + BuildMaxHeap(A, low, high, HeapSize); + for (int i=high; i>low; i--) + { + int temp = A[i]; + A[i] = A[low]; + A[low] = temp; + HeapSize--; + MaxHeapify(A,low, 0, HeapSize); + } +} + + + + From f342b693a567d5ceedafea327b3dd846c56d2161 Mon Sep 17 00:00:00 2001 From: SHUBHAM SHARMA Date: Tue, 2 Oct 2018 16:37:05 +0530 Subject: [PATCH 022/285] Palindrome for numbers --- palindrome_number | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 palindrome_number diff --git a/palindrome_number b/palindrome_number new file mode 100644 index 00000000..64841a3f --- /dev/null +++ b/palindrome_number @@ -0,0 +1,28 @@ +#include +using namespace std; + +int main() +{ + int n, num, digit, rev = 0; + + cout << "Enter a positive number: "; + cin >> num; + + n = num; + + do + { + digit = num % 10; + rev = (rev * 10) + digit; + num = num / 10; + } while (num != 0); + + cout << " The reverse of the number is: " << rev << endl; + + if (n == rev) + cout << " The number is a palindrome."; + else + cout << " The number is not a palindrome."; + + return 0; +} From 9a0dd1be8a96606cf0645554cda83032a69a0d53 Mon Sep 17 00:00:00 2001 From: mohbius Date: Tue, 2 Oct 2018 16:44:40 +0530 Subject: [PATCH 023/285] Create HoaxNo.cpp --- math/HoaxNo.cpp | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 math/HoaxNo.cpp diff --git a/math/HoaxNo.cpp b/math/HoaxNo.cpp new file mode 100644 index 00000000..b37374e9 --- /dev/null +++ b/math/HoaxNo.cpp @@ -0,0 +1,87 @@ + +// CPP code to check if a number is a hoax +// number or not. +#include +using namespace std; +// Function to find distinct prime factors +// of given number n +vector primeFactors(int n) +{ + vector res; + if (n % 2 == 0) { + while (n % 2 == 0) + n = n / 2; + res.push_back(2); + } + + // n is odd at this point, since it is no + // longer divisible by 2. So we can test + // only for the odd numbers, whether they + // are factors of n + for (int i = 3; i <= sqrt(n); i = i + 2) { + + // Check if i is prime factor + if (n % i == 0) { + while (n % i == 0) + n = n / i; + res.push_back(i); + } + } + + // This condition is to handle the case + // when n is a prime number greater than 2 + if (n > 2) + res.push_back(n); + return res; +} + +// Function to calculate sum of digits of +// distinct prime factors of given number n +// and sum of digits of number n and compare +// the sums obtained +bool isHoax(int n) +{ + // Distinct prime factors of n are being + // stored in vector pf + vector pf = primeFactors(n); + + // If n is a prime number, it cannot be a + // hoax number + if (pf[0] == n) + return false; + + // Finding sum of digits of distinct prime + // factors of the number n + int all_pf_sum = 0; + for (int i = 0; i < pf.size(); i++) { + + // Finding sum of digits in current + // prime factor pf[i]. + int pf_sum; + for (pf_sum = 0; pf[i] > 0; + pf_sum += pf[i] % 10, pf[i] /= 10) + ; + + all_pf_sum += pf_sum; + } + + // Finding sum of digits of number n + int sum_n; + for (sum_n = 0; n > 0; sum_n += n % 10, + n /= 10) + ; + + // Comparing the two calculated sums + return sum_n == all_pf_sum; +} + +// Driver Method +int main() +{ + int n = 84; //Example input. This number is hoax number. + if (isHoax(n)) + cout << "A Hoax Number\n"; + else + cout << "Not a Hoax Number\n"; + return 0; +} From 19bd2a448a92d5a735d3cc8831f4c42bf7a0efd4 Mon Sep 17 00:00:00 2001 From: mohbius Date: Tue, 2 Oct 2018 17:15:02 +0530 Subject: [PATCH 024/285] Create sphenicNo.cpp --- math/sphenicNo.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 math/sphenicNo.cpp diff --git a/math/sphenicNo.cpp b/math/sphenicNo.cpp new file mode 100644 index 00000000..874acfea --- /dev/null +++ b/math/sphenicNo.cpp @@ -0,0 +1,86 @@ +//CODE ADAPTED FROM OTHER WEBSITE. +// C++ program to check whether a number is a +// Sphenic number or not +#include +using namespace std; + +const int MAX = 1000; + +// Create a vector to store least primes. +// Initialize all entries as 0. +vector least_pf(MAX, 0); + +// This function fills values in least_pf[]. +// such that the value of least_pf[i] stores +// smallest prime factor of i. +// This function is based on sieve of Eratosthenes +void leastPrimeFactor(int n) +{ + // Least prime factor for 1 is 1 + least_pf[1] = 1; + + // Store least prime factor for all other + // numbers. + for (int i = 2; i <= n; i++) + { + // least_pf[i] == 0 means i is prime + if (least_pf[i] == 0) + { + // Initializing prime number as its own + // least prime factor. + least_pf[i] = i; + + // Mark 'i' as a divisor for all its + // multiples that are not already marked + for (int j = 2*i; j <= n; j += i) + if (least_pf[j] == 0) + least_pf[j] = i; + } + } +} + +// Function returns true if n is a sphenic number and +// No otherwise +bool isSphenic(int n) +{ + // Stores three prime factors of n. We have at-most + // three elements in s. + set s; + + // Keep finding least prime factors until n becomes 1 + while (n > 1) + { + // Find least prime factor of current value of n. + int lpf = least_pf[n]; + + // We store current size of s to check if a prime + // factor repeats + int init_size = s.size(); + + // Insert least prime factor of current value of n + s.insert(lpf); + + // If either lpf repeats or number of lpfs becomes + // more than 3, then return false. + if (s.size() == init_size || s.size() > 3) + + // same prime divides the + // number more than once + return false; + + // Divide n by lpf + n /= lpf; + } + + // Return true if size of set is 3 + return (s.size() == 3); +} + +int main() +{ + leastPrimeFactor(MAX); + for (int i=1; i<100; i++) + if (isSphenic(i)) + cout << i << " "; + return 0; +} From 210bc250e576846dc3139594c0b474cfc55b9001 Mon Sep 17 00:00:00 2001 From: Kaushl Date: Tue, 2 Oct 2018 17:56:14 +0530 Subject: [PATCH 025/285] Add C++ program of Heap_Sort --- sorting/Heap_sort.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sorting/Heap_sort.cpp diff --git a/sorting/Heap_sort.cpp b/sorting/Heap_sort.cpp new file mode 100644 index 00000000..08d25508 --- /dev/null +++ b/sorting/Heap_sort.cpp @@ -0,0 +1,54 @@ +// C++ program for implementation of Heap Sort +#include + +using namespace std; +void heapify(int arr[], int n, int i) +{ + int largest = i; + int l = 2*i + 1; + int r = 2*i + 2; + + + if (l < n && arr[l] > arr[largest]) + largest = l; + + if (r < n && arr[r] > arr[largest]) + largest = r; + + if (largest != i) + { + swap(arr[i], arr[largest]); + + heapify(arr, n, largest); + } +} + +void heapSort(int arr[], int n) +{ + for (int i = n / 2 - 1; i >= 0; i--) + heapify(arr, n, i); + + for (int i=n-1; i>=0; i--) + { + swap(arr[0], arr[i]); + heapify(arr, i, 0); + } +} + +void printArray(int arr[], int n) +{ + for (int i=0; i Date: Tue, 2 Oct 2018 18:30:11 +0530 Subject: [PATCH 026/285] add algorithm to check for armstrong number --- math/armstrong_number.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 math/armstrong_number.cpp diff --git a/math/armstrong_number.cpp b/math/armstrong_number.cpp new file mode 100644 index 00000000..d4c6a43b --- /dev/null +++ b/math/armstrong_number.cpp @@ -0,0 +1,21 @@ +#include +#include +using namespace std; + + +string check_armstrong(long long number){ + long long sum_of_digits = 0; + long long value = number; + while(number){ + int unit = number % 10; + sum_of_digits += (unit*unit*unit); + number = number / 10; + } + return value == sum_of_digits?"\tIt is Armstrong Number":"\tNot A Armstrong Number"; +} + +int main(){ + cout< Date: Tue, 2 Oct 2018 18:55:37 +0530 Subject: [PATCH 027/285] add heap-sort algorithm --- sorting/heap_sort.cpp | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sorting/heap_sort.cpp diff --git a/sorting/heap_sort.cpp b/sorting/heap_sort.cpp new file mode 100644 index 00000000..9433aea6 --- /dev/null +++ b/sorting/heap_sort.cpp @@ -0,0 +1,70 @@ +// C++ program for implementation of Heap Sort +#include + +using namespace std; + +// To heapify a subtree rooted with node i which is +// an index in arr[]. n is size of heap +void heapify(int arr[], int n, int i) +{ + int largest = i; // Initialize largest as root + int l = 2*i + 1; // left = 2*i + 1 + int r = 2*i + 2; // right = 2*i + 2 + + // If left child is larger than root + if (l < n && arr[l] > arr[largest]) + largest = l; + + // If right child is larger than largest so far + if (r < n && arr[r] > arr[largest]) + largest = r; + + // If largest is not root + if (largest != i) + { + swap(arr[i], arr[largest]); + + // Recursively heapify the affected sub-tree + heapify(arr, n, largest); + } +} + +// main function to do heap sort +void heapSort(int arr[], int n) +{ + // Build heap (rearrange array) + for (int i = n / 2 - 1; i >= 0; i--) + heapify(arr, n, i); + + // One by one extract an element from heap + for (int i=n-1; i>=0; i--) + { + // Move current root to end + swap(arr[0], arr[i]); + + // call max heapify on the reduced heap + heapify(arr, i, 0); + } +} + +/* A utility function to print array of size n */ +void printArray(int arr[], int n) +{ + for (int i=0; i Date: Tue, 2 Oct 2018 20:38:25 +0530 Subject: [PATCH 028/285] Create Sum of all factorials of n! Sum of all factorials of n! --- Sum of all factorials of n! | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Sum of all factorials of n! diff --git a/Sum of all factorials of n! b/Sum of all factorials of n! new file mode 100644 index 00000000..debb97f1 --- /dev/null +++ b/Sum of all factorials of n! @@ -0,0 +1,22 @@ +Following are the steps for an efficient solution: + +n! can be represented as :- n! = (a1^p1) (a2^p2)x...(ak^pk). + +where ak is the prime divisor lesser than n and pk is the highest power which can divide n!. + +Through sieve find the prime number and the highest power can be easily find out by : + +countofpower = [n/a] + [n/a^2] + [n/a^3] +...... or ` while (n) +{ + n/ = a; + ans += n +} +Count Of Factors = (ans1 +1)*(ans2 +1)*....(ansk +1) + +After calculating this last step is the sum : + +SUM = product of all (pow(ak,pk+1)-1)/(ak-1); +ex = 4! +4! = 2^3 * 3^1; +count of factors = (3+1)*(1+1) = 8 (1,2,3,4,6,8,12,24) +sum = ( 1 + 2 + 4 + 8)*(1 + 3) = 60. From c97ee7f884e198a0f353c39a0b208caac25fc4d9 Mon Sep 17 00:00:00 2001 From: sanchit garg Date: Tue, 2 Oct 2018 20:43:15 +0530 Subject: [PATCH 029/285] Update Sum of all factorials of n! --- Sum of all factorials of n! | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sum of all factorials of n! b/Sum of all factorials of n! index debb97f1..02d11899 100644 --- a/Sum of all factorials of n! +++ b/Sum of all factorials of n! @@ -1,6 +1,6 @@ Following are the steps for an efficient solution: -n! can be represented as :- n! = (a1^p1) (a2^p2)x...(ak^pk). +n! can be represented as :- n! = (a1^p1) (a2^p2)x...(ak^pk). where ak is the prime divisor lesser than n and pk is the highest power which can divide n!. From 645db6878ca263d37efd1f676c0116e6eb4e5b9b Mon Sep 17 00:00:00 2001 From: sanchit garg Date: Tue, 2 Oct 2018 20:43:51 +0530 Subject: [PATCH 030/285] Rename Sum of all factorials of n! to The sum of all factorials of n! --- Sum of all factorials of n! => The sum of all factorials of n! | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Sum of all factorials of n! => The sum of all factorials of n! (100%) diff --git a/Sum of all factorials of n! b/The sum of all factorials of n! similarity index 100% rename from Sum of all factorials of n! rename to The sum of all factorials of n! From 36def187324b484c39b7923a17a984649d7b9528 Mon Sep 17 00:00:00 2001 From: Jhalak46 <42498888+Jhalak46@users.noreply.github.com> Date: Tue, 2 Oct 2018 21:23:58 +0530 Subject: [PATCH 031/285] Added rank_sort.cpp This algorithm sorts an array of integers. --- sorting/rank_sort.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sorting/rank_sort.cpp diff --git a/sorting/rank_sort.cpp b/sorting/rank_sort.cpp new file mode 100644 index 00000000..387c4bb4 --- /dev/null +++ b/sorting/rank_sort.cpp @@ -0,0 +1,54 @@ + +#include +#include +using namespace std; + + void rankSort(int A[], int low, int high) + { + int R[high-low+1]; + for(int i=0; i= A[j]) + R[i-low]++; + + else + R[j-low]++; + } + } + + int U[high-low+1]; + for(int i=0;i>n; + int houses[n]; + cout<<"enter the entries"<>houses[i]; + } + + rankSort(houses,0,n-1); + for(int i=0;i Date: Tue, 2 Oct 2018 21:50:10 +0530 Subject: [PATCH 032/285] added expoential search algo --- searches/exponential_search.cpp | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 searches/exponential_search.cpp diff --git a/searches/exponential_search.cpp b/searches/exponential_search.cpp new file mode 100644 index 00000000..e0419f32 --- /dev/null +++ b/searches/exponential_search.cpp @@ -0,0 +1,50 @@ +#include +using namespace std; + +int binarySearch(int arr[], int, int, int); + +int exponentialSearch(int arr[], int n, int x) +{ + + if (arr[0] == x) + return 0; + int i = 1; + while (i < n && arr[i] <= x) + i = i*2; + + + return binarySearch(arr, i/2, min(i, n), x); +} + + +int binarySearch(int arr[], int l, int r, int x) +{ + if (r >= l) + { + int mid = l + (r - l)/2; + + if (arr[mid] == x) + return mid; + + if (arr[mid] > x) + return binarySearch(arr, l, mid-1, x); + + return binarySearch(arr, mid+1, r, x); + } + + + return -1; +} + + +int main(void) +{ + int arr[] = {2, 3, 4, 10, 40}; + int n = sizeof(arr)/ sizeof(arr[0]); + int x = 10; + int result = exponentialSearch(arr, n, x); + (result == -1)? printf("Element is not present in array") + : printf("Element is present at index %d", + result); + return 0; +} From 2be90a3db5568da526113e0a2b401ccfaa9c965c Mon Sep 17 00:00:00 2001 From: Pablo Trinidad Date: Tue, 2 Oct 2018 11:40:51 -0500 Subject: [PATCH 033/285] Factorial docs removed --- math/Factorial/README.md | 5 ----- math/{Factorial => }/factorial.cpp | 0 2 files changed, 5 deletions(-) delete mode 100644 math/Factorial/README.md rename math/{Factorial => }/factorial.cpp (100%) diff --git a/math/Factorial/README.md b/math/Factorial/README.md deleted file mode 100644 index 5ed2ca8f..00000000 --- a/math/Factorial/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Factorial - -The factorial of a non-negative integer *n*, denoted by *n!*, is -the product of all positive integers less than or equal to *n*. -For example: `5! = 5 x 4 x 3 x 2 x 1 = 120`. diff --git a/math/Factorial/factorial.cpp b/math/factorial.cpp similarity index 100% rename from math/Factorial/factorial.cpp rename to math/factorial.cpp From 9b3e48c03d29e41ca36fab8d0b5f8c8dfbc466e4 Mon Sep 17 00:00:00 2001 From: Pablo Trinidad Date: Tue, 2 Oct 2018 11:43:54 -0500 Subject: [PATCH 034/285] Collatz sequence docs removed --- math/Collatz Sequence/README.md | 9 --------- math/{Collatz Sequence => }/collatz.cpp | 0 2 files changed, 9 deletions(-) delete mode 100644 math/Collatz Sequence/README.md rename math/{Collatz Sequence => }/collatz.cpp (100%) diff --git a/math/Collatz Sequence/README.md b/math/Collatz Sequence/README.md deleted file mode 100644 index 87d7df89..00000000 --- a/math/Collatz Sequence/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Collatz conjecture - -The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: - * Start with any positive integer n. - * Then each term is obtained from the previous term as follows: - * if the previous term is even, the next term is one half the previous term. - * If the previous term is odd, the next term is 3 times the previous term plus 1. - -The conjecture is that no matter what value of n, the sequence will always reach 1. diff --git a/math/Collatz Sequence/collatz.cpp b/math/collatz.cpp similarity index 100% rename from math/Collatz Sequence/collatz.cpp rename to math/collatz.cpp From 10809eae257ec396226bd8a65ef712de390386d0 Mon Sep 17 00:00:00 2001 From: gktejus Date: Tue, 2 Oct 2018 22:35:48 +0530 Subject: [PATCH 035/285] Added rod cutting problem in dynamic programming --- dynamic-programming/rod_cutting.cpp | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dynamic-programming/rod_cutting.cpp diff --git a/dynamic-programming/rod_cutting.cpp b/dynamic-programming/rod_cutting.cpp new file mode 100644 index 00000000..ac93e726 --- /dev/null +++ b/dynamic-programming/rod_cutting.cpp @@ -0,0 +1,46 @@ +#include +#include + +using namespace std; + +int rodCutting(int n, int value[]) +{ + int i,j; + + + int result[n+1]; + + result[0]=0; + + for(i=1;i<=n;i++) + { + result[i]=INT_MIN; + + for(j=0;j>n; + + int value[n]; + cout<<"Enter the values of pieces of rod of all size"<>value[i]; + + cout<<"Maximum obtainable value by cutting up the rod in many pieces are"< Date: Wed, 3 Oct 2018 00:34:18 +0530 Subject: [PATCH 036/285] Create all_factors_ofa_number.cpp --- math/all_factors_ofa_number.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 math/all_factors_ofa_number.cpp diff --git a/math/all_factors_ofa_number.cpp b/math/all_factors_ofa_number.cpp new file mode 100644 index 00000000..649c843b --- /dev/null +++ b/math/all_factors_ofa_number.cpp @@ -0,0 +1,24 @@ +#include +#include +using namespace std; + +int main() +{ + int n=12; + + while(n%2==0) + { + cout<<"2 "; + n=n/2; + } + for(int i=3;i1) + cout< Date: Tue, 2 Oct 2018 16:31:37 +0530 Subject: [PATCH 037/285] Added String algorithm --- Strings/Rabin_carp_algo.cpp | 117 ++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Strings/Rabin_carp_algo.cpp diff --git a/Strings/Rabin_carp_algo.cpp b/Strings/Rabin_carp_algo.cpp new file mode 100644 index 00000000..acd6fd15 --- /dev/null +++ b/Strings/Rabin_carp_algo.cpp @@ -0,0 +1,117 @@ + /* + + * C++ Program to Implement Rabin-Karp Algorithm + + */ + + #include + + #include + + #include + + #include + + using namespace std; + + #define d 256 + + /* + + * search a substring in a string + + */ + + void search(char *pat, char *txt, int q) + + { + + int M = strlen(pat); + + int N = strlen(txt); + + int i, j; + + int p = 0; + + int t = 0; + + int h = 1; + + for (i = 0; i < M - 1; i++) + + h = (h * d) % q; + + for (i = 0; i < M; i++) + + { + + p = (d *p + pat[i]) % q; + + t = (d * t + txt[i]) % q; + + } + + for (i = 0; i <= N - M; i++) + + { + + if (p == t) + + { + + for (j = 0; j < M; j++) + + { + + if (txt[i + j] != pat[j]) + + break; + + } + + if (j == M) + + { + + cout<<"Pattern found at index: "< Date: Tue, 2 Oct 2018 17:20:13 +0530 Subject: [PATCH 038/285] added path to Strings in ReadMe file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6886d0f2..14d9f2fa 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ - [Hashes](hashes) - [Searches](searches) - [Sorting](sorting) -- [Strings](strings) +- [Strings](https://github.com/kavya98527/cpp/tree/master/Strings) - [Traversals](traversals) ## License From 3ae61a30e0720033d9722dc56713ba97d9f41576 Mon Sep 17 00:00:00 2001 From: Kavya Date: Tue, 2 Oct 2018 17:36:11 +0530 Subject: [PATCH 039/285] added path to Strings in ReadMe file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14d9f2fa..178ab926 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ - [Hashes](hashes) - [Searches](searches) - [Sorting](sorting) -- [Strings](https://github.com/kavya98527/cpp/tree/master/Strings) +- [Strings](https://github.com/AllAlgorithms/cpp/tree/master/Strings) - [Traversals](traversals) ## License From 4250b364d9adc347d717b03c30800717f82f346e Mon Sep 17 00:00:00 2001 From: Kavya Date: Wed, 3 Oct 2018 22:07:33 +0530 Subject: [PATCH 040/285] added a new String algorithm --- Strings/z algo.cpp | 115 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Strings/z algo.cpp diff --git a/Strings/z algo.cpp b/Strings/z algo.cpp new file mode 100644 index 00000000..1aabaff9 --- /dev/null +++ b/Strings/z algo.cpp @@ -0,0 +1,115 @@ + /* + + * C++ Program to Implement Z-Algorithm + + */ + + #include + + #include + + #include + + using namespace std; + + bool zAlgorithm(string pattern, string target) + + { + + string s = pattern + '$' + target; + + int n = s.length(); + + vector z(n, 0); + + int goal = pattern.length(); + + int r = 0, l = 0, i; + + for (int k = 1; k < n; k++) + + { + + if (k > r) + + { + + for (i = k; i < n && s[i] == s[i - k]; i++); + + if (i > k) + + { + + z[k] = i - k; + + l = k; + + r = i - 1; + + } + + } + + else + + { + + int kt = k - l, b = r - k + 1; + + if (z[kt] > b) + + { + + for (i = r + 1; i < n && s[i] == s[i - k]; i++); + + z[k] = i - k; + + l = k; + + r = i - 1; + + } + + } + + if (z[k] == goal) + + return true; + + } + + return false; + + } + + + + int main() + + { + + string tar = "This is a sample Testcase"; + + string pat = "case"; + + if (zAlgorithm(pat, tar)) + + cout<<"'"< Date: Wed, 3 Oct 2018 23:11:15 +0530 Subject: [PATCH 041/285] added shaker sort.cpp --- sorting/shaker_sort.cpp | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sorting/shaker_sort.cpp diff --git a/sorting/shaker_sort.cpp b/sorting/shaker_sort.cpp new file mode 100644 index 00000000..f65f3d8e --- /dev/null +++ b/sorting/shaker_sort.cpp @@ -0,0 +1,61 @@ +#include + +using namespace std; + +// A function to swap values using call by reference. +void swap(int *a, int *b) +{ + int temp; + temp = *a; + *a = *b; + *b = temp; +} + +// A function implementing shaker sort. +void ShakerSort(int a[], int n) +{ + int i, j, k; + for(i = 0; i < n;) + { + // First phase for ascending highest value to the highest unsorted index. + for(j = i+1; j < n; j++) + { + if(a[j] < a[j-1]) + swap(&a[j], &a[j-1]); + } + // Decrementing highest index. + n--; + + // Second phase for descending lowest value to the lowest unsorted index. + for(k = n-1; k > i; k--) + { + if(a[k] < a[k-1]) + swap(&a[k], &a[k-1]); + } + // Incrementing lowest index. + i++; + } +} + +int main() +{ + int n, i; + cout<<"\nEnter the number of data element to be sorted: "; + cin>>n; + + int arr[n]; + for(i = 0; i < n; i++) + { + cout<<"Enter element "<>arr[i]; + } + + ShakerSort(arr, n); + + // Printing the sorted data. + cout<<"\nSorted Data "; + for (i = 0; i < n; i++) + cout<<"->"< Date: Wed, 3 Oct 2018 23:45:08 +0530 Subject: [PATCH 042/285] added stooge sort.cpp --- sorting/stooge_sort.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sorting/stooge_sort.cpp diff --git a/sorting/stooge_sort.cpp b/sorting/stooge_sort.cpp new file mode 100644 index 00000000..5fd219c9 --- /dev/null +++ b/sorting/stooge_sort.cpp @@ -0,0 +1,48 @@ +#include + +using namespace std; + +// A function implementing stooge sort. +void StoogeSort(int a[],int start, int end) +{ + int temp; + // Further breaking the array if the Subpart's length is more than 2. + if(end-start+1 > 2) + { + temp = (end-start+1)/3; + StoogeSort(a, start, end-temp); + StoogeSort(a, start+temp, end); + StoogeSort(a, start, end-temp); + } + + // swapping the element at start and end. + if(a[end] < a[start]) + { + temp = a[start]; + a[start] = a[end]; + a[end] = temp; + } +} + +int main() +{ + int n, i; + cout<<"\nEnter the number of data element to be sorted: "; + cin>>n; + + int arr[n]; + for(i = 0; i < n; i++) + { + cout<<"Enter element "<>arr[i]; + } + + StoogeSort(arr, 0, n-1); + + // Printing the sorted data. + cout<<"\nSorted Data "; + for (i = 0; i < n; i++) + cout<<"->"< Date: Thu, 4 Oct 2018 00:30:48 +0530 Subject: [PATCH 043/285] added radix sort in sorting --- sorting/radix_sort.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sorting/radix_sort.cpp diff --git a/sorting/radix_sort.cpp b/sorting/radix_sort.cpp new file mode 100644 index 00000000..88556971 --- /dev/null +++ b/sorting/radix_sort.cpp @@ -0,0 +1,73 @@ +// C++ implementation of Radix Sort +#include +using namespace std; + +// A utility function to get maximum value in arr[] +int getMax(int arr[], int n) +{ + int mx = arr[0]; + for (int i = 1; i < n; i++) + if (arr[i] > mx) + mx = arr[i]; + return mx; +} + +// A function to do counting sort of arr[] according to +// the digit represented by exp. +void countSort(int arr[], int n, int exp) +{ + int output[n]; // output array + int i, count[10] = {0}; + + // Store count of occurrences in count[] + for (i = 0; i < n; i++) + count[ (arr[i]/exp)%10 ]++; + + // Change count[i] so that count[i] now contains actual + // position of this digit in output[] + for (i = 1; i < 10; i++) + count[i] += count[i - 1]; + + // Build the output array + for (i = n - 1; i >= 0; i--) + { + output[count[ (arr[i]/exp)%10 ] - 1] = arr[i]; + count[ (arr[i]/exp)%10 ]--; + } + + // Copy the output array to arr[], so that arr[] now + // contains sorted numbers according to current digit + for (i = 0; i < n; i++) + arr[i] = output[i]; +} + +// The main function to that sorts arr[] of size n using +// Radix Sort +void radixsort(int arr[], int n) +{ + // Find the maximum number to know number of digits + int m = getMax(arr, n); + + // Do counting sort for every digit. Note that instead + // of passing digit number, exp is passed. exp is 10^i + // where i is current digit number + for (int exp = 1; m/exp > 0; exp *= 10) + countSort(arr, n, exp); +} + +// A utility function to print an array +void print(int arr[], int n) +{ + for (int i = 0; i < n; i++) + cout << arr[i] << " "; +} + +// Driver program to test above functions +int main() +{ + int arr[] = {170, 45, 75, 90, 802, 24, 2, 66}; + int n = sizeof(arr)/sizeof(arr[0]); + radixsort(arr, n); + print(arr, n); + return 0; +} From 064e908b4b9549fa5ddfec71397644e08132dbcf Mon Sep 17 00:00:00 2001 From: Milan Pokharna Date: Thu, 4 Oct 2018 16:15:48 +0530 Subject: [PATCH 044/285] Create fibonacci_number.cpp --- dynamic-programming/fibonacci_number.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 dynamic-programming/fibonacci_number.cpp diff --git a/dynamic-programming/fibonacci_number.cpp b/dynamic-programming/fibonacci_number.cpp new file mode 100644 index 00000000..d8d0f2fe --- /dev/null +++ b/dynamic-programming/fibonacci_number.cpp @@ -0,0 +1,18 @@ +#include +int fibonacci_fast(int n) { + // write your code here + int fin[n]; + fin[0]=0; + fin[1]=1; + for (int i=2;i<=n;i++) + fin[i]=fin[i-1]+fin[i-2]; + + return fin[n]; +} +int main() { + int n = 0; + std::cin >> n; + + std::cout << fibonacci_fast(n) << '\n'; + return 0; +} From 22efa0a3ab3ff2e393aa2788bbad3089651cb3e4 Mon Sep 17 00:00:00 2001 From: megamayoy Date: Thu, 4 Oct 2018 15:05:21 +0200 Subject: [PATCH 045/285] Add DoublyinkedList implementation --- .../DoublyLinkedList/doubly_linked_list.cpp | 272 ++++++++++++++++++ .../DoublyLinkedList/doubly_linked_list.h | 68 +++++ 2 files changed, 340 insertions(+) create mode 100644 data-structures/DoublyLinkedList/doubly_linked_list.cpp create mode 100644 data-structures/DoublyLinkedList/doubly_linked_list.h diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.cpp b/data-structures/DoublyLinkedList/doubly_linked_list.cpp new file mode 100644 index 00000000..8402dce5 --- /dev/null +++ b/data-structures/DoublyLinkedList/doubly_linked_list.cpp @@ -0,0 +1,272 @@ +#include"doubly_linked_list.h" + +template +void DoublyLinkedList :: Push_back(T val) +{ + + Node* new_node = new Node(val); + + if(Tail != NULL) //or if(Size != 0) + { + Tail->next = new_node; + new_node->prev = Tail; + Tail = new_node; + + } + else + { + Tail = new_node; + Head = new_node; + } + + Size_++; +} + + +template +void DoublyLinkedList :: Pop_back() +{ + //if list is empty + if(Tail == NULL) //or Head == NULL + { + cout<<"Can't pop back the DLS is empty"<<'\n'; + return; + } + + if(Tail == Head) // if there's only one element in the DLS + { + delete Tail; + Tail = NULL; + Head = NULL; + + } + else + { + Node* previous_node = Tail->prev; + + delete Tail; + + Tail = previous_node; + Tail->next = NULL; + } + + Size_--; + +} + +template +void DoublyLinkedList :: Push_front(T val) +{ + + Node* new_node = new Node(val); + + new_node->next = Head; + if(Head != NULL) + { + Head->prev = new_node; + + } + Head = new_node; + if(Tail == NULL) + { + Tail = Head; + } + + Size_++; + +} + +template +void DoublyLinkedList :: Pop_front() +{ + if(Head == NULL) //if dls is empty can't pop + { + cout<<"Can't pop front the DLS is empty"<<'\n'; + return; + } + + Node* next_node = Head->next; + delete Head; + Head = next_node; + + if(Head == NULL) //if we popped the last element + { + Tail = NULL; + } + else + { + Head->prev = NULL; + } + +Size_--; + +} + +template +void DoublyLinkedList :: Add_before(Node* node, T val) +{ + + Node* new_node = new Node(val); + new_node->next = node; + new_node->prev = node->prev; + node->prev = new_node; + + if(new_node->prev != NULL) + { + new_node->prev->next = new_node; + } + + if(Head == node) + { + Head = new_node; + + } + Size_++; +} + + + +template +void DoublyLinkedList :: Add_after(Node* node,T val) +{ + + Node* new_node = new Node(val); + new_node->prev = node; + new_node->next = node->next; + node->next = new_node; + + + if(new_node->next != NULL) + { + new_node->next->prev = new_node; + + } + + if(Tail == node) + { + Tail = new_node; + } + +Size_++; + +} + +template +void DoublyLinkedList :: Display() +{ + + if(Size_ == 0) + { + cout<<"Linked List is empty"; + } + else + { + for(Node* tmp_ptr = Head;tmp_ptr!= NULL; tmp_ptr= tmp_ptr->next) + { + cout<data<<" "; + + } + } +cout<<'\n'; +} + + + +template +void DoublyLinkedList :: Clear() +{ + + Node* tmp = Head; + if(Size_ == 0 ) + { + cout<<" all cleared linked list is empty"<<'\n'; + return; + } + + while(Head != NULL) + { + + Head = Head->next; + delete tmp; + tmp = Head; + + } + cout<<" all cleared linked list is empty"<<'\n'; +Tail = NULL; +Size_ = 0; +} +template +void DoublyLinkedList :: Insert_at(T val ,int position) +{ + if(position >Size_ || position <= 0) + { + cout<<"invalid position choose a position between 1 and size "<<'\n'; + cout<<"size is: "<* tmp = Head; + //get a pointer of that position that position + for(int i =1 ; i<=position-1 ; i++,tmp = tmp->next); + Add_before(tmp,val); + } + + + } + +template +void DoublyLinkedList :: Delete_at(int position) +{ + + + if(Size_ ==0) + { + cout<<"Can't delete DLS is empty "<<'\n'; + return; + } + + if(position >Size_ || position < 0) + { + cout<<"invalid position choose a position between 1 and size "<<'\n'; + cout<<"size is: "<* tmp = Head; + + for(int i = 1; i <= position-1; i++,tmp = tmp->next); + + if(tmp->next != NULL) + { + tmp->next->prev = tmp->prev; + } + + if(tmp->prev != NULL) + { + tmp->prev->next = tmp->next; + + } + + if(Head == tmp) + { + Head = tmp->next; + + } + + if(Tail == tmp) + { + Tail = Tail->prev; + } + +delete tmp; +Size_--; + + +} + + + diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.h b/data-structures/DoublyLinkedList/doubly_linked_list.h new file mode 100644 index 00000000..4acf21fb --- /dev/null +++ b/data-structures/DoublyLinkedList/doubly_linked_list.h @@ -0,0 +1,68 @@ +#include + +using namespace std; + +template + +class Node{ + + + //each node has a next pointer and a previous pinter + public: + T data; + Node* next; + Node* prev; + + + Node() + { + next = NULL; + prev = NULL; + + } + + Node( T value) + { + data = value; + next = NULL; + prev = NULL; + } + +}; + + +template + +class DoublyLinkedList{ + + public: + Node* Head; + Node* Tail; + int Size_; + + DoublyLinkedList() + { + Head = NULL; + Tail = NULL; + Size_ = 0; + + } + + void Push_back(T val); //append + void Pop_back(); + void Push_front(T val); //prepend + void Pop_front(); + void Display(); + void Clear(); + void Insert_at(T val,int position); + void Delete_at(int position); + void Add_before(Node* node, T val); + void Add_after(Node* node,T val); + + ~DoublyLinkedList() + { + cout<<"destructor is called"<<'\n'; + Clear(); + } + +}; From 6d4fe9a2d5ce3998c3772893c046951783432e14 Mon Sep 17 00:00:00 2001 From: Sathwik Matsa Date: Thu, 4 Oct 2018 19:26:38 +0530 Subject: [PATCH 046/285] Fix Lucky Numbers Implementation --- math/lucky_numbers.cpp | 82 +++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/math/lucky_numbers.cpp b/math/lucky_numbers.cpp index 351f43f5..d5c5ff47 100644 --- a/math/lucky_numbers.cpp +++ b/math/lucky_numbers.cpp @@ -1,37 +1,47 @@ -// Lucky number implementation -// Carlos Abraham Hernandez -// algorithms.abranhe.com/math/lucky-numbers +/* +* Lucky Numbers Implementation in C++ +* Author: Sathwik Matsa +*/ -#include -#define bool int - -/* Returns 1 if n is a lucky no. ohterwise returns 0*/ -bool isLucky(int n) -{ - static int counter = 2; - - /*variable next_position is just for readability of - the program we can remove it and use n only */ - int next_position = n; - if(counter > n) - return 1; - if(n%counter == 0) - return 0; - - /*calculate next position of input no*/ - next_position -= next_position/counter; - - counter++; - return isLucky(next_position); -} - -/*Driver function to test above function*/ -int main() -{ - int x = 7; - if( isLucky(x) ) - printf("%d is a lucky number.", x); - else - printf("%d is not a lucky number.", x); - getchar(); -} +#include +#include +#include + +using namespace std; + +// returns a vector of int containing lucky numbers in range [1,n] +vector lucky_numbers(int n){ + + vector seive; + + // store numbers from 1 to n in the vector + for(int i = 1; i<=n; i++){ + seive.push_back(i); + } + + int survivor = 1; + int delete_every = 2; + int index; + while(seive.size() >= delete_every){ + index = delete_every-1; + while(index < seive.size()){ + seive.erase(seive.begin()+index); + index+=(delete_every-1); + } + delete_every = survivor = (*(++find(seive.begin(), seive.end(), survivor))); + } + + return seive; +} + +int main(){ + int n; + cin>>n; + vector luckyNumbers = lucky_numbers(n); + cout << "lucky numbers up to " << n << ":" <::iterator it = luckyNumbers.begin() ; it < luckyNumbers.end(); it++ ){ + cout << *it << " "; + } + cout< Date: Thu, 4 Oct 2018 17:18:12 +0200 Subject: [PATCH 047/285] Dijkstra' algorithm using linked list and C++11's style --- graphs/dijkstra_list.cc | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 graphs/dijkstra_list.cc diff --git a/graphs/dijkstra_list.cc b/graphs/dijkstra_list.cc new file mode 100644 index 00000000..06a112ee --- /dev/null +++ b/graphs/dijkstra_list.cc @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include +using namespace std; +#define INF 999999 + +typedef pair pii; + +list adj[INF]; +int V; +vector previous(INF, -1); +int dijkstra(int src, int dest) { + priority_queue, greater > pq; + + vector dist(INF, INF); + previous.resize(V); + pq.push(make_pair(0, src)); + dist[src] = 0; + while(!pq.empty()) { + int u = pq.top().second; + pq.pop(); + + for(auto const& i : adj[u]) { + int v = i.first; + int w = i.second; + + if(dist[v] > dist[u] + w) { + dist[v] = dist[u] + w; + pq.push({dist[v], v}); + previous[v] = u; + } + } + } + + return dist[dest]; +} + +void dijShortPath(int v, list& path) { +/* example: +v = 6; +v = previous[6] (5) +v = previous[5] (2) +... +*/ + for(; v != -1; v = previous[v]) + path.push_front(v); +} + +int main() { +/* +nVertex nEdges +sorg dest +ver1 ver2 weight +... +*/ + cin >> V; + int e, sorg, dest; + cin >> e >> sorg >> dest; + int u, v, w; + for(int i = 0; i < e; i++) { + cin >> u >> v >> w; + adj[u].push_back(make_pair(v, w)); + } + cout << dijkstra(sorg, dest) << endl; + list path; + dijShortPath(dest, path); + for(auto const& i : path) + cout << i << ' '; + + return 0; +} From fe149c605e481bc8bde0b4e65eb9be09c927351e Mon Sep 17 00:00:00 2001 From: Harsh Kashyap Date: Thu, 4 Oct 2018 23:40:28 +0530 Subject: [PATCH 048/285] Add Radix Sort Program --- sorting/radix_sort.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sorting/radix_sort.cpp diff --git a/sorting/radix_sort.cpp b/sorting/radix_sort.cpp new file mode 100644 index 00000000..99aaea06 --- /dev/null +++ b/sorting/radix_sort.cpp @@ -0,0 +1,73 @@ +// C++ implementation of Radix Sort +#include +using namespace std; + +// A utility function to get maximum value in arr[] +int getMax(int arr[], int n) +{ + int mx = arr[0]; + for (int i = 1; i < n; i++) + if (arr[i] > mx) + mx = arr[i]; + return mx; +} + +// A function to do counting sort of arr[] according to +// the digit represented by exp. +void countSort(int arr[], int n, int exp) +{ + int output[n]; // output array + int i, count[10] = {0}; + + // Store count of occurrences in count[] + for (i = 0; i < n; i++) + count[ (arr[i]/exp)%10 ]++; + + // Change count[i] so that count[i] now contains actual + // position of this digit in output[] + for (i = 1; i < 10; i++) + count[i] += count[i - 1]; + + // Build the output array + for (i = n - 1; i >= 0; i--) + { + output[count[ (arr[i]/exp)%10 ] - 1] = arr[i]; + count[ (arr[i]/exp)%10 ]--; + } + + // Copy the output array to arr[], so that arr[] now + // contains sorted numbers according to current digit + for (i = 0; i < n; i++) + arr[i] = output[i]; +} + +// The main function to that sorts arr[] of size n using +// Radix Sort +void radixsort(int arr[], int n) +{ + // Find the maximum number to know number of digits + int m = getMax(arr, n); + + // Do counting sort for every digit. Note that instead + // of passing digit number, exp is passed. exp is 10^i + // where i is current digit number + for (int exp = 1; m/exp > 0; exp *= 10) + countSort(arr, n, exp); +} + +// A utility function to print an array +void print(int arr[], int n) +{ + for (int i = 0; i < n; i++) + cout << arr[i] << " "; +} + +// Driver program to test above functions +int main() +{ + int arr[] = {170, 45, 75, 90, 802, 24, 2, 66}; + int n = sizeof(arr)/sizeof(arr[0]); + radixsort(arr, n); + print(arr, n); + return 0; +} \ No newline at end of file From 98a20c39ce7cff8727ec89152e0ca997cd0fd390 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 4 Oct 2018 16:43:30 -0400 Subject: [PATCH 049/285] asking for a number --- math/lucky_numbers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/math/lucky_numbers.cpp b/math/lucky_numbers.cpp index d5c5ff47..1d161c63 100644 --- a/math/lucky_numbers.cpp +++ b/math/lucky_numbers.cpp @@ -1,6 +1,7 @@ /* * Lucky Numbers Implementation in C++ -* Author: Sathwik Matsa +* Author: Sathwik Matsa +* Github: @sathwikmatsa */ #include @@ -36,6 +37,7 @@ vector lucky_numbers(int n){ int main(){ int n; + cout << "Enter a number: "; cin>>n; vector luckyNumbers = lucky_numbers(n); cout << "lucky numbers up to " << n << ":" < Date: Fri, 5 Oct 2018 19:59:37 +0530 Subject: [PATCH 050/285] Create pangram_check.cpp --- strings/pangram_check.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 strings/pangram_check.cpp diff --git a/strings/pangram_check.cpp b/strings/pangram_check.cpp new file mode 100644 index 00000000..f0ff70e7 --- /dev/null +++ b/strings/pangram_check.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; + +bool checkPangram(string s) { + int arr[26] = {0}; + for(int i = 0;i < s.length();i++) { + if (s[i]!=' ') { + arr[(int)s[i] - 97] = 1; + } + } + for (int i = 0;i < 26;i++) + if (arr[i]==0) + return false; + return true; +} + +int main() +{ + string s = "The quick brown fox jumps over the lazy dog"; + if (checkPangram(s)) + cout << "Given string is Pangram"; + else + cout << "Given string is not Pangram"; + return 0; +} From 91e01669633a09dd621280cbaeae20ab0537f8b3 Mon Sep 17 00:00:00 2001 From: adriarce99 Date: Fri, 5 Oct 2018 19:56:06 +0200 Subject: [PATCH 051/285] Added Gauss Jordan Function --- math/Gauss Jordan.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 math/Gauss Jordan.cpp diff --git a/math/Gauss Jordan.cpp b/math/Gauss Jordan.cpp new file mode 100644 index 00000000..5559fa76 --- /dev/null +++ b/math/Gauss Jordan.cpp @@ -0,0 +1,32 @@ + +void Gauss_Jordan (double m[][MAX],int fila,int columna) +{ + int i,j,t,k,l; + double divisores[MAX]; + int fila_pivote=0; + + for (t=0; t=t; l--) + { + m[t][l]=m[t][l]/m[t][t]; + } + + //Divisores + for (k=0; k Date: Sat, 6 Oct 2018 13:57:37 +0530 Subject: [PATCH 052/285] Added Algorithm for pascals triangle. --- math/Pascals_triangle.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 math/Pascals_triangle.cpp diff --git a/math/Pascals_triangle.cpp b/math/Pascals_triangle.cpp new file mode 100644 index 00000000..31bb6ce1 --- /dev/null +++ b/math/Pascals_triangle.cpp @@ -0,0 +1,39 @@ + +// Algorith in C++ for Pascal's Triangle of n Lines +#include +int binomialCoeff(int n, int k); + +// Function to print first n lines of Pascal's Triangle +void printPascal(int n) +{ + for (int line = 0; line < n; line++) + { + for (int i = 0; i <= line; i++) + printf("%d ", + binomialCoeff(line, i)); + printf("\n"); + } +} + + +int binomialCoeff(int n, int k) +{ + int res = 1; + if (k > n - k) + k = n - k; + for (int i = 0; i < k; ++i) + { + res *= (n - i); + res /= (i + 1); + } + + return res; +} + + +int main() +{ + int n = 7; + printPascal(n); + return 0; +} From 6c5b590f183cc58778d7edfc719069ea738f7176 Mon Sep 17 00:00:00 2001 From: adriarce99 Date: Sat, 6 Oct 2018 12:26:39 +0200 Subject: [PATCH 053/285] Added binomial function --- math/Binomial Function.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 math/Binomial Function.cpp diff --git a/math/Binomial Function.cpp b/math/Binomial Function.cpp new file mode 100644 index 00000000..3a042efd --- /dev/null +++ b/math/Binomial Function.cpp @@ -0,0 +1,19 @@ +//Funcion factorial +unsigned long int factorial (unsigned long int valor) +{ + if (valor<=1) + return valor=1; + else + return valor=valor*factorial(valor-1); +} + +/*///////////////////////////////////////////////////////////////////////////////////////*/ +/*///////////////////////////////////////////////////////////////////////////////////////*/ + +//Funcion binomial(requiere la funcion factorial) +float numero_binomio (unsigned long int arriba,unsigned long int abajo) +{ + float respuesta; + respuesta = factorial(arriba) / (factorial(abajo) * factorial(arriba-abajo)); + return respuesta; +} From e62a299bd609b867961df989c9343dbd85a6cb10 Mon Sep 17 00:00:00 2001 From: Mkishore7 Date: Sat, 6 Oct 2018 15:59:49 +0530 Subject: [PATCH 054/285] 3_way_quicksort The idea of 3 way QuickSort is to process all occurrences of the pivot. In simple QuickSort algorithm, we select an element as the pivot, partition the array around the pivot and recur for subarrays on left and right of the pivot. --- sorting/3_way_quicksort.c | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sorting/3_way_quicksort.c diff --git a/sorting/3_way_quicksort.c b/sorting/3_way_quicksort.c new file mode 100644 index 00000000..a9dbd1c9 --- /dev/null +++ b/sorting/3_way_quicksort.c @@ -0,0 +1,81 @@ +#include +int common=0; +void swap (int *a,int *b) +{ + int temp; + temp=*a; + *a=*b; + *b=temp; + return; +} + +int partition(int *a,int start,int end) +{ + int i=0; + int pivot_index=0; + int pivot=a[end]; + if (start==end) + return pivot_index; + + for (i=0;i=end) + return; + + int pivot=partition(a,start,end); + int temp=common; + common=0; + quicksort(a,start,pivot-temp-1); + quicksort(a,pivot+1,end); +} + +void print(int *a,int n) +{ + int i=0; + for(i=0;i Date: Mon, 8 Oct 2018 12:04:27 +0530 Subject: [PATCH 055/285] Create BinarySearchTree.cpp Implemented functions for insert,display,delete,searching data,zigzag pattern traversal in Binary search Tree. --- data-structures/BinarySearchTree.cpp | 170 +++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 data-structures/BinarySearchTree.cpp diff --git a/data-structures/BinarySearchTree.cpp b/data-structures/BinarySearchTree.cpp new file mode 100644 index 00000000..970e7c6a --- /dev/null +++ b/data-structures/BinarySearchTree.cpp @@ -0,0 +1,170 @@ +#include +#define ll long long int +#define ull unsigned long long int +#define pb push_back +#define MIN 2 +#define sc(n) scanf("%d",&n) +#define pr(n) printf("%d",n) +#define gc getchar_unlocked +#define AC 0 +#define MOD 1000000007 +#define mp make_pair +#define vc vector +#define wh(n) while(n--) +#define ite(type,datatype,name) type::iterator name +#define gt goto + +using namespace std; + + /*Structure of node*/ +struct node{ + int data; + struct node *left,*right; +}; + /*Create a new Node*/ +struct node *newnode(int p){ + struct node *temp = new node(); + temp->data = p; + temp->left = temp->right = NULL; + return temp; +} + + /*Insert a new Node in BST*/ +struct node *insert(struct node *root,int p){ + if(root == NULL){ + return newnode(p); + } + if(root->data > p){ + root->left = insert(root->left,p); + } + else{ + root->right = insert(root->right,p); + } + return root; +} +/* Display BST */ +void display(struct node *root){ + if(root != NULL){ + cout<data<<" "; //Pre-Order + display(root->left); + // cout<data<<" "; + display(root->right); + + } +} + /*Return node with minimum value*/ +struct node *minvalue(struct node *root){ + struct node *curr = root; + + while(curr->left != NULL){ + curr = curr->left; + } + return curr; +} + +/* Delete node with given key value in BST */ +struct node *del(struct node* root,int key){ + //Base case for root + if(root == NULL) return root; + if(root->data > key){ + root->left = del(root->left,key); + } + else if(root->data < key){ + root->right = del(root->right,key); + } + else{ + //noDe has one or nO noDe + if(root->left == NULL){ + struct node *temp = root->right; + free(root); + return temp; + } + else if(root->right == NULL){ + struct node *temp = root->left; + free(root); + return temp; + } + //tWo chiLd + struct node *temp = minvalue(root->right); + root->data = temp->data; + root->right = del(root->right,temp->data); + } + return root; +} + + /* Return height of BST */ +int maxheight(struct node *node){ + if(node == NULL){ + return 0; + } + int lh = maxheight(node->left); + int rh = maxheight(node->right); + + if(lh>rh) return (lh+1); + else return (rh+1); +} +/* return the search value for given key */ +int search(struct node* temp,int key){ + int p=key; + while(1){ + if(temp->data == key){ + return p; + } + else if(temp->data > key){ + p = max(p,temp->data); + temp = temp->left; + } + else if(temp->data < key){ + temp = temp->right; + } + } + return p; +} + + /*Print BST in zigzag Pattern */ +void zigzeg(struct node* root){ + stack s[2]; + int curr = 0; + int oth = 1; + s[curr].push(root->data); + struct node* temp1 = root; + struct node* temp2 = root; + while((!s[curr].empty()) || (!s[oth].empty())){ + if(curr == 0){ + int p = s[curr].top(); + s[curr].pop(); + s[oth].push(temp1->left->data); + s[oth].push(temp1->right->data); + temp1= temp1->right; + cout<right->data); + s[curr].push(temp1->left->data); + temp1= temp1->left; + cout< Date: Mon, 8 Oct 2018 13:44:56 +0700 Subject: [PATCH 056/285] Add AverageCalc.cpp --- math/AverageCalc.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 math/AverageCalc.cpp diff --git a/math/AverageCalc.cpp b/math/AverageCalc.cpp new file mode 100644 index 00000000..c079f729 --- /dev/null +++ b/math/AverageCalc.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; + +int main() +{ + float a,b=0,c=0; + //This program will count the average of all the data, type "0" to show the average. + while(a!=0) + { + b=b+1; + cout << "Data " << b << "= "; + cin >> a; + c=c+a; + } + + float average=c/(b-1); + cout << " \n"; + cout << "Average= " << average << endl; + + system("pause"); + return 0; +} \ No newline at end of file From 647aa2d29054b8f5697776057335a12ba4083735 Mon Sep 17 00:00:00 2001 From: bag-PacKer <35328339+bag-PacKer@users.noreply.github.com> Date: Mon, 8 Oct 2018 12:33:51 +0530 Subject: [PATCH 057/285] Create Trie.cpp Using Trie data structure we can store large dictionary and search spelling fast. --- data-structures/Trie.cpp | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 data-structures/Trie.cpp diff --git a/data-structures/Trie.cpp b/data-structures/Trie.cpp new file mode 100644 index 00000000..89e243eb --- /dev/null +++ b/data-structures/Trie.cpp @@ -0,0 +1,79 @@ +#include +using namespace std; +const int SIZE = 26; + +struct MyNode{ + struct MyNode *children[SIZE]; + bool isEndOfWord; +}; + +// Returns new trie node +struct MyNode *getNode(void) +{ + struct MyNode *pNode = new MyNode; + + pNode->isEndOfWord = false; + + for (int i = 0; i < SIZE; i++) + pNode->children[i] = NULL; + + return pNode; +} + +/* If not present, inserts key into trie + If the key is prefix of trie node, just + marks leaf node*/ +void insert(struct MyNode *root, string key) +{ + struct MyNode *pCrawl = root; + + for (int i = 0; i < key.length(); i++) + { + int index = key[i] - 'a'; + if (!pCrawl->children[index]) + pCrawl->children[index] = getNode(); + + pCrawl = pCrawl->children[index]; + } + + // mark last node as leaf + pCrawl->isEndOfWord = true; +} + +// Returns true if key presents in trie, else false +bool search(struct MyNode *root, string key) +{ + struct MyNode *pCrawl = root; + + for (int i = 0; i < key.length(); i++) + { + int index = key[i] - 'a'; + if (!pCrawl->children[index]) + return false; + + pCrawl = pCrawl->children[index]; + } + + return (pCrawl != NULL && pCrawl->isEndOfWord); +} + +// Driver Programme to check above functions +int main() +{ + // For input keys use only lower case + string keys[] = {"the", "a", "there", + "answer", "any", "by", + "bye", "their" }; + int n = sizeof(keys)/sizeof(keys[0]); + + struct MyNode *root = getNode(); + + // Build trie + for (int i = 0; i < n; i++) + insert(root, keys[i]); + + // Search for different keys to check is it present in our dictonary or not..?? + search(root, "the")? cout << "Yes\n" : cout << "No\n"; + search(root, "these")? cout << "Yes\n" : cout << "No\n"; + return 0; +} From 86f9ab3b7763dfe393d70fb93326dce53aeb23df Mon Sep 17 00:00:00 2001 From: Akash Banchhor Date: Mon, 8 Oct 2018 12:50:27 +0530 Subject: [PATCH 058/285] statusCheck() algorithm This is an greedy approach for calculating the number of statusCheck require for a given set of process --- greedy/readme_statusCheckG.txt | 16 ++++ greedy/sampleInputs.txt | 28 ++++++ greedy/statusCheck.cpp | 163 +++++++++++++++++++++++++++++++++ 3 files changed, 207 insertions(+) create mode 100644 greedy/readme_statusCheckG.txt create mode 100644 greedy/sampleInputs.txt create mode 100644 greedy/statusCheck.cpp diff --git a/greedy/readme_statusCheckG.txt b/greedy/readme_statusCheckG.txt new file mode 100644 index 00000000..629e495e --- /dev/null +++ b/greedy/readme_statusCheckG.txt @@ -0,0 +1,16 @@ +This algorithm find's the minimum number of status check require inorder to cover maximum number of process running at a time. +statusCkeckG.cpp is designed in a Greedy manner. +In this problem start time and finish time of each process is given. +And we've to sort in non-decreasing order of their finish time. +Then check at what time statusCheck() needed to be invoked such that the number of invocation of statusCheck() is minimum. + +statusCheck() is a function which collects the some information about process. + +Inputs are: +'start time', 'finish time', 'type of process' + +'type of process': +it can be 'normal' represented as 'N' +or it can be 'sensitive' represented as 'S' + +given condition that for each sensitive process there must be atleast on statusCheck(). \ No newline at end of file diff --git a/greedy/sampleInputs.txt b/greedy/sampleInputs.txt new file mode 100644 index 00000000..2ed45d56 --- /dev/null +++ b/greedy/sampleInputs.txt @@ -0,0 +1,28 @@ +---SAMPLE INPUTS---- + + +6 8 S +2 5 S +9 11 S +7 9 S +0 3 S + +o/p: 3 + +6 9 S +2 5 S +9 11 S +7 9 S +0 3 S + +o/p: 2 + +0 2 S +3 5 S +4 7 S +6 8 S +8 11 S +8 11 S + +o/p: 3 + diff --git a/greedy/statusCheck.cpp b/greedy/statusCheck.cpp new file mode 100644 index 00000000..bde68e1a --- /dev/null +++ b/greedy/statusCheck.cpp @@ -0,0 +1,163 @@ +#include + +using namespace std; + +void swap(int* a, int* b){ + int t = *a; + *a = *b; + *b = t; +} + +void swapc(char* a, char* b){ + char t = *a; + *a = *b; + *b = t; +} + +void heapify(int start[], int finish[], char status[], int n, int i){ + int largest = i; + int l = 2*i + 1; + int r = 2*i + 2; + + if (l < n && finish[l] > finish[largest]) + largest = l; + + if (r < n && finish[r] > finish[largest]) + largest = r; + + if (largest != i){ + swap(&finish[i], &finish[largest]); + swap(&start[i], &start[largest]); + swapc(&status[i], &status[largest]); + heapify(start, finish, status, n, largest); + } +} + +void sort(int start[], int finish[], char status[], int n){ + for (int i = n / 2 - 1; i >= 0; i--) + heapify(start, finish, status, n, i); + + for (int i=n-1; i>=0; i--){ + swap(&finish[0], &finish[i]); + swap(&start[0], &start[i]); + swapc(&status[0], &status[i]); + heapify(start, finish, status, i, 0); + } +} + +int maxFinishTime(int finish[], int n){ + int max = 0; + for(int i=0;i max) + max = finish[i]; + return max; +} + +int status_check(int s[], int f[], char st[], int n) { + + //find the maximum finish time among all process + int N = maxFinishTime(f, n) + 1; + + //count stores whether status_check() is invoked, if yes count[i] = 1, else count[i] = 0 + int count[N]; + + //initialize count to 0 initially + for(int i=0;i=0;k--){ + if(count[k] == 1){ + lastStatusCheck = k; + break; + } + } + + if(pid[i] == 0){ + count[f[i]] = 1; + timeF = f[i]; + pid[i] = 1; + pid[j] = 1; + } + + else if(pid[j] == 0 && timeF != lastStatusCheck){ + count[f[j]] = 1; + timeF = f[j]; + pid[j] = 1; + } + } + + //overlap + else if(f[i] >= s[j] && s[i] != s[j]){ + //if status is S i.e. 'Sensitive' apply status_check() + if(timeF < f[i]){ + count[f[i]] = 1; + timeF = f[j]; + pid[i] = 1; + pid[j] = 1; + } + } + + //no overlap + else{ + if(timeF < f[i] && s[i] != s[j]){ + count[f[i]] = 1; + timeF = f[i]; + pid[i] = 1; + pid[j] = 1; + } + } + i++; + } + cout<>n; + int start[n]; + int finish[n]; + char status[n]; + for(int i=0;i>start[i] >> finish[i] >> status[i]; + } + + //sort in non-decreasing order of finish time + sort(start, finish, status, n); + + //check for conflict + int check = status_check(start, finish, status, n); + + cout<<"Number of times status_check() is invoked is %d"< Date: Mon, 8 Oct 2018 14:29:11 +0530 Subject: [PATCH 059/285] Added maxRectangle.cpp maxRectangle in Binary Matrix under dp section --- dynamic-programming/maxRectangle.cpp | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 dynamic-programming/maxRectangle.cpp diff --git a/dynamic-programming/maxRectangle.cpp b/dynamic-programming/maxRectangle.cpp new file mode 100644 index 00000000..0660aabd --- /dev/null +++ b/dynamic-programming/maxRectangle.cpp @@ -0,0 +1,89 @@ +#include +using namespace std; + +int largestRectangleArea(vector &hist) { + + + stack s; + int n=hist.size(); + int max_area = 0; + int tp; + int area_with_top; + + int i = 0; + while (i < n) + { + if (s.empty() || hist[s.top()] <= hist[i]) + s.push(i++); + + + else + { + tp = s.top(); + s.pop(); + + area_with_top = hist[tp] * (s.empty() ? i : i - s.top() - 1); + + if (max_area < area_with_top) + max_area = area_with_top; + } + } + + + while (s.empty() == false) + { + tp = s.top(); + s.pop(); + area_with_top = hist[tp] * (s.empty() ? i : i - s.top() - 1); + + if (max_area < area_with_top) + max_area = area_with_top; + } + + return max_area; +} + + +int maximalRectangle(vector > &A) { + + int i,j,k,l,n=A.size(),m=A[0].size(),maxi=0; + vector vec(m,0); + + for(i=0;i > vec; + vector arr; + cin>>n>>m; + + for(i=0;i>x; + arr.push_back(x); + } + vec.push_back(arr); + } + + cout< Date: Mon, 8 Oct 2018 14:36:21 +0530 Subject: [PATCH 060/285] preety printing added --- dynamic-programming/pretty_printing.c | 188 ++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 dynamic-programming/pretty_printing.c diff --git a/dynamic-programming/pretty_printing.c b/dynamic-programming/pretty_printing.c new file mode 100644 index 00000000..1e9cb0d7 --- /dev/null +++ b/dynamic-programming/pretty_printing.c @@ -0,0 +1,188 @@ +#include +#include +#include +#include + +#define inf FLT_MAX +#define pline printf("\n"); + +int tChar=0; + +struct strg{ + char *x; +}; + +int wordcnt(char *str){ + int i=0;int flag=0; int wc=1; + while(str[i]!='\0'){ + i++; + if(flag==0 && str[i]==' '){ + wc++; + flag=1; + } + else if(str[i]!=' '){ + flag=0; + } + } +return wc; +} + +int* wlen(char *str, int wc){ + int* wl = malloc(sizeof(int)*wc); + int i=0, flag=0, wordlen,j=0; + while(str[i]!='\0'){ + if(flag==0 && str[i]==' '){ + wl[j]=wordlen;j++; + tChar += wordlen; + wordlen=0; + flag=1; + } + else if(str[i]!=' '){ + flag=0; + wordlen++; printf("%c",str[i]); + } + i++; + }wl[j]=wordlen-1;tChar += wordlen-1; +// for(i=0;i=0) + mat[i][j] = (line-temp)*(line-temp); + else + mat[i][j]=50000; + } + } +} + +int* justify(int **mat, int dim){ + int minCost[dim]; + int* result = malloc(sizeof(int)*dim); + int i; + for(i=0;i= 0 ; i--){ + minCost[i] = mat[i][dim-1]; + result[i] = dim; + int j; + for(j=dim-1; j > i; j--){ + if(mat[i][j-1] == 50000){ + continue; + } + if(minCost[i] > (minCost[j] + mat[i][j-1])){ + minCost[i] = minCost[j] + mat[i][j-1]; + result[i] = j; + } + } + } + printf("Min cost %d\n",minCost[0]); + for(i=0;imax){ + max=q[j]; + n[k]=max;k++; + } + } + for(i=0;i-1; i--) + mat[i]=(int*)calloc(i+1,sizeof(int)); + +badness(mat,p,dim,10); + +printf("Badness Matrix: \n"); +for(i=0; i=i?mat[i][j]:0,j!=dim-1?' ':'\n'); + +int *q = justify(mat,dim); +printf("tchar %d\n",tChar); +char *pstr = clearText(str, tChar); +pretty(pstr,p,q,dim); + +return 0; +} From 193bbbfcab746a3bc2c2d0a83be26946c349ab09 Mon Sep 17 00:00:00 2001 From: Lunatic <34325808+gauravyug@users.noreply.github.com> Date: Mon, 8 Oct 2018 15:18:34 +0530 Subject: [PATCH 061/285] Create largestRectangleArea.cpp --- data-structures/largestRectangleArea.cpp | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 data-structures/largestRectangleArea.cpp diff --git a/data-structures/largestRectangleArea.cpp b/data-structures/largestRectangleArea.cpp new file mode 100644 index 00000000..294b0c4b --- /dev/null +++ b/data-structures/largestRectangleArea.cpp @@ -0,0 +1,61 @@ +/** + * + *@gaurav yadav + + Maintain a stack + a. If stack is empty heights[stack.top()] <= heights[i]) + push this i into stack. + b. Else keep popooing from stack till value at i at top of stack is + less than value at current index. + c. While popping calculate area + if stack is empty + area = i * heights[top]; + it means that till this point value just removed has to be smallest element + if stack is not empty + area = heights[top] * (i - stack.top() - 1); + + * Finally return maxArea + * Time complexity is O(n) + * Space complexity is O(n) + */ +class Solution { +public: + + int largestRectangleArea(vector& heights) { + int area = 0; + int maxArea = 0; + stack s; + int i; + for (i = 0; i < heights.size();) { + if (s.empty() || heights[s.top()] <= heights[i]) { + s.push(i++); + } + else { + int top = s.top(); + s.pop(); + if (s.empty()) { + area = i * heights[top]; + } + else { + area = heights[top] * (i- s.top() -1); + } + if (area > maxArea) + maxArea = area; + } + } + + while (!s.empty()) { + int top = s.top(); + s.pop(); + if (s.empty()) { + area = i * heights[top]; + } + else { + area = heights[top] * (i- s.top() -1); + } + if (area > maxArea) + maxArea = area; + } + return maxArea; + } +}; From 1915561804853e4a32e9b6b33c341b23bd6b5465 Mon Sep 17 00:00:00 2001 From: korostenskyi Date: Mon, 8 Oct 2018 15:55:15 +0300 Subject: [PATCH 062/285] Added factorial algorithm implemented by using loop instead of recursive algorithm --- math/factorial_loop.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 math/factorial_loop.cpp diff --git a/math/factorial_loop.cpp b/math/factorial_loop.cpp new file mode 100644 index 00000000..5ed5bf6d --- /dev/null +++ b/math/factorial_loop.cpp @@ -0,0 +1,15 @@ +/* + @author Roman Korostenskyi + @date 08.10.2018 + + Simple factorial algorithm based on loop +*/ +int factorial_loop(int n) { + int output = 1; + + for (int i = n; i >= 1; i--) { + output *= i; + } + + return output; +} \ No newline at end of file From cdd9d43dc609dc1cb410d5447c12ce8554c81277 Mon Sep 17 00:00:00 2001 From: korostenskyi Date: Mon, 8 Oct 2018 16:10:04 +0300 Subject: [PATCH 063/285] Added simple algorithm based on loop for calculating Fibonacci numbers --- math/fibonacci_loop.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 math/fibonacci_loop.cpp diff --git a/math/fibonacci_loop.cpp b/math/fibonacci_loop.cpp new file mode 100644 index 00000000..9f7edb9b --- /dev/null +++ b/math/fibonacci_loop.cpp @@ -0,0 +1,23 @@ +/* + @author Roman Korostenskyi + @date 08.10.2018 + + Simple algorithm based on loop for calculating Fibonacci numbers +*/ + +unsigned long fibonacci(int n) { + if (n <= 1){ + return n; + } + + long previous = 0; + long current = 1; + + for (long i = 2; i <= n; i++){ + long new_current = previous + current; + previous = current; + current = new_current; + } + + return current; +} \ No newline at end of file From c6c787a182b5687e21a263bcbf4ff322362400b8 Mon Sep 17 00:00:00 2001 From: zackforbes <32631108+zackforbes@users.noreply.github.com> Date: Mon, 8 Oct 2018 19:31:20 +0530 Subject: [PATCH 064/285] Create represent linear equation in form of matrix --- represent linear equation in form of matrix | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 represent linear equation in form of matrix diff --git a/represent linear equation in form of matrix b/represent linear equation in form of matrix new file mode 100644 index 00000000..a8bf7041 --- /dev/null +++ b/represent linear equation in form of matrix @@ -0,0 +1,37 @@ +#include +#include + +using namespace std; + +int main(void) +{ + char var[] = { 'x', 'y', 'z', 'w' }; + cout << "Enter the number of variables in the equations: "; + int n; + cin >> n; + cout << "\nEnter the coefficients of each variable for each equations"; + cout << "\nax + by + cz + ... = d"; + int mat[n][n]; + int constants[n][1]; + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + cin >> mat[i][j]; + } + cin >> constants[i][0]; + } + + cout << "Matrix representation is: "; + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + cout << " " << mat[i][j]; + } + cout << " " << var[i]; + cout << " = " << constants[i][0]; + cout << "\n"; + } + return 0; +} From 59e4eb0c1b8e1cfbabd1c027606fe6e0ccdd29c0 Mon Sep 17 00:00:00 2001 From: chandana akriti Date: Mon, 8 Oct 2018 19:39:15 +0530 Subject: [PATCH 065/285] added trivial hashing it searches if some number is present in the array or not in O(1) time. --- data-structures/Trivial Hashing | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 data-structures/Trivial Hashing diff --git a/data-structures/Trivial Hashing b/data-structures/Trivial Hashing new file mode 100644 index 00000000..530abaa8 --- /dev/null +++ b/data-structures/Trivial Hashing @@ -0,0 +1,52 @@ +// CPP program to implement direct index mapping +// with negative values allowed. +#include +using namespace std; +#define MAX 1000 + +// Since array is global, it is initialized as 0. +bool has[MAX + 1][2]; + +// searching if X is Present in the given array +// or not. +bool search(int X) +{ + if (X >= 0) { + if (has[X][0] == 1) + return true; + else + return false; + } + + // if X is negative take the absolute + // value of X. + X = abs(X); + if (has[X][1] == 1) + return true; + + return false; +} + +void insert(int a[], int n) +{ + for (int i = 0; i < n; i++) { + if (a[i] >= 0) + has[a[i]][0] = 1; + else + has[abs(a[i])][1] = 1; + } +} + +// Driver code +int main() +{ + int a[] = { -1, 9, -5, -8, -5, -2 }; + int n = sizeof(a)/sizeof(a[0]); + insert(a, n); + int X = -5; + if (search(X) == true) + cout << "Present"; + else + cout << "Not Present"; + return 0; +} From 049095b2739befa8f3d1272c0948f627c7de7884 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Mon, 8 Oct 2018 20:53:13 +0530 Subject: [PATCH 066/285] Add files via upload --- math/prime_or_not.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 math/prime_or_not.cpp diff --git a/math/prime_or_not.cpp b/math/prime_or_not.cpp new file mode 100644 index 00000000..02503c82 --- /dev/null +++ b/math/prime_or_not.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +int main() +{ + int n, i; + bool isPrime = true; + + cout << "Enter a positive integer: "; + cin >> n; + + for(i = 2; i <= n / 2; ++i) + { + if(n % i == 0) + { + isPrime = false; + break; + } + } + if (isPrime) + cout << "This is a prime number"; + else + cout << "This is not a prime number"; + + return 0; +} \ No newline at end of file From ce61dd78e8e2807fdad81f874103371d4682acf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lim=20U=C4=9Fur?= Date: Mon, 8 Oct 2018 22:10:51 +0300 Subject: [PATCH 067/285] Implement Euler's Totient function for a given int --- math/eulers_totient.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 math/eulers_totient.cpp diff --git a/math/eulers_totient.cpp b/math/eulers_totient.cpp new file mode 100644 index 00000000..ec1bcdb8 --- /dev/null +++ b/math/eulers_totient.cpp @@ -0,0 +1,33 @@ +#include + +using namespace std; + +int gcd(int a, int b) +{ + return (b > 0 ? gcd(b, a%b) : a); +} + +unsigned int phi(unsigned int n) +{ + unsigned int result = 1; + for (int i = 2; i < n; ++i) + { + if (gcd(i, n) == 1) + { + result++; + } + } + + return result; +} + +int main() +{ + int n; + cin >> n; + assert(n <= 1000000); // Assertion to ensure execution time is reasonable ( < 1second) + + cout << "Value of Euler's totient function for n is " << phi(n) << endl; + + return 0; +} From 979bb6883384bbda3fc960f308572084947e94ca Mon Sep 17 00:00:00 2001 From: shubham_abhang77 Date: Tue, 9 Oct 2018 11:37:46 +0530 Subject: [PATCH 068/285] gnome sorting added --- sorting/gnome_sort.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sorting/gnome_sort.cpp diff --git a/sorting/gnome_sort.cpp b/sorting/gnome_sort.cpp new file mode 100644 index 00000000..4ed05e5c --- /dev/null +++ b/sorting/gnome_sort.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; + +void gnomeSort(int arr[], int n) +{ + int index = 0; + + while (index < n) { + if (index == 0) + index++; + if (arr[index] >= arr[index - 1]) + index++; + else { + swap(arr[index], arr[index - 1]); + index--; + } + } + return; +} + +void printArray(int arr[], int n) +{ + cout << "Sorted sequence after Gnome sort: "; + for (int i = 0; i < n; i++) + cout << arr[i] << " "; + cout << "\n"; +} + +int main() +{ + int arr[] = { 34, 2, 10, -9 }; + int n = sizeof(arr) / sizeof(arr[0]); + + gnomeSort(arr, n); + printArray(arr, n); + + return (0); +} From 490e9b8c8cf87bfceda497989b065021c7daab73 Mon Sep 17 00:00:00 2001 From: Ronak Doshi <33517942+ronak66@users.noreply.github.com> Date: Tue, 9 Oct 2018 14:02:22 +0530 Subject: [PATCH 069/285] Adding Kruskal Algorithm (Graph Theory) --- graphs/Kruskal.cpp | 125 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 graphs/Kruskal.cpp diff --git a/graphs/Kruskal.cpp b/graphs/Kruskal.cpp new file mode 100644 index 00000000..8d08874e --- /dev/null +++ b/graphs/Kruskal.cpp @@ -0,0 +1,125 @@ +// #include +// #include +// #include +// #include +// #include +// #include +#include +#define pu push_back +#define m make_pair +using namespace std; + +// Functor to compare by the Mth element +template class F = std::less> +struct TupleCompare +{ + template + bool operator()(T const &t1, T const &t2) + { + return F::type>()(std::get(t1), std::get(t2)); + } +}; + +void addEdge(vector < pair > adj[],int u,int v,int key) +{ + adj[u].pu(m(v,key)); + adj[v].pu(m(u,key)); +} + +int main() +{ + int n; + int q; + cin>>n>>q; + vector < pair > adj[n]; + vector < tuple > v; + for(int h=0;h>a>>b>>key; + a-=1;b-=1; + // addEdge(a,b,key,adj); + v.pu(make_tuple(a,b,key)); + } + sort(begin(v),end(v), TupleCompare<2>()); + int colour[n]; + int number[n]; + list refer[n]; + list :: iterator it; + int countcolour = n; + for(int i=0;i(v[i]), b = get<1>(v[i]), c = get<2>(v[i]); + int d = colour[a],e = colour[b]; + if(d==e) continue; + else if(number[d]>number[e]) + { + // for(int j=0;j> v; + v.push_back(make_tuple(1, "Hello")); + v.push_back(make_tuple(2, "Aha")); + a.splice(a.end(), b); // extends the list a by moving the elements from b to the end of a + std::sort(begin(v), end(v), TupleCompare<0>()); + return 0; + 8 11 +1 2 50 +2 3 35 +3 4 30 +3 5 25 +2 4 95 +0 2 60 +2 6 40 +0 6 20 +0 7 10 +6 7 20 +4 6 45 + +Kruskal.cpp87:37 +LF +I +UTF-8C++ +master104 files + +} +*/ From c83f8e9fe6376e89af186f3e5e832a21d4b45518 Mon Sep 17 00:00:00 2001 From: ns98 <43982656+ns98@users.noreply.github.com> Date: Tue, 9 Oct 2018 14:08:04 +0530 Subject: [PATCH 070/285] Create BITOBYT_OCT_LONG.cpp This file contains the program of the problem : https://www.codechef.com/OCT18B/problems/BITOBYT --- math/BITOBYT_OCT_LONG.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 math/BITOBYT_OCT_LONG.cpp diff --git a/math/BITOBYT_OCT_LONG.cpp b/math/BITOBYT_OCT_LONG.cpp new file mode 100644 index 00000000..8def5ee9 --- /dev/null +++ b/math/BITOBYT_OCT_LONG.cpp @@ -0,0 +1,21 @@ +#include +using namespace std; +int main(){ +int t; +cin>>t; +while(t--){ +int n; +cin>>n; +int r = n%26; +int q = n/26; +if(r>=1&&r<=2) +cout<<(long long)pow(2,q)<<"\t"<<0<<"\t"<<0<<"\n"; +else if(r>2&&r<=10) +cout<<0<<"\t"<<(long long)pow(2,q)<<"\t"<<0<<"\n"; +else if(r>10&&r<=25) +cout<<0<<"\t"<<0<<"\t"<<(long long)pow(2,q)<<"\n"; +else if(r==0) +cout<<0<<"\t"<<0<<"\t"<<(long long)pow(2,q-1)<<"\n"; +} +return 0; +} From 3c439859443350e24bf28708442ea6928a64f50e Mon Sep 17 00:00:00 2001 From: ns98 <43982656+ns98@users.noreply.github.com> Date: Tue, 9 Oct 2018 14:12:08 +0530 Subject: [PATCH 071/285] Create CHSERVE_OCT_LONG.cpp This file contains the program of the code : https://www.codechef.com/OCT18B/problems/CHSERVE --- math/CHSERVE_OCT_LONG.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 math/CHSERVE_OCT_LONG.cpp diff --git a/math/CHSERVE_OCT_LONG.cpp b/math/CHSERVE_OCT_LONG.cpp new file mode 100644 index 00000000..3872442a --- /dev/null +++ b/math/CHSERVE_OCT_LONG.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; +int main(){ +int t; +cin>>t; +while(t--){ +long long p1,p2,k; +cin>>p1>>p2>>k; +long long r = (p1+p2)%(2*k); +if(r>=0&&r Date: Tue, 9 Oct 2018 20:12:34 +0530 Subject: [PATCH 072/285] Create Matrix Chain Multiplication This programme give us minimum number of multiplication for matrix chain multiplication. --- .../Matrix Chain Multiplication | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 dynamic-programming/Matrix Chain Multiplication diff --git a/dynamic-programming/Matrix Chain Multiplication b/dynamic-programming/Matrix Chain Multiplication new file mode 100644 index 00000000..28f68e97 --- /dev/null +++ b/dynamic-programming/Matrix Chain Multiplication @@ -0,0 +1,58 @@ +#include +#include + +using namespace std; + + +int MatrixChainMultiplication(int p[], int n) +{ + int m[n][n]; + int i, j, k, L, q; + + for (i=1; i>n; + + + int arr[n]; + + cout<<"Enter dimensions \n"; + + for(i=0;i>arr[i]; + } + + int size = sizeof(arr)/sizeof(arr[0]); + + cout<<"Minimum number of multiplications is "< Date: Tue, 9 Oct 2018 20:26:36 +0530 Subject: [PATCH 073/285] Create Magic Square Helps us to find out this matrix is magic square or not. --- math/Magic Square | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 math/Magic Square diff --git a/math/Magic Square b/math/Magic Square new file mode 100644 index 00000000..ce3e92a5 --- /dev/null +++ b/math/Magic Square @@ -0,0 +1,54 @@ +#include + +#define N 3 +using namespace std; + + +bool isMagicSquare(int mat[][N]) +{ + + int sum = 0; + for (int i = 0; i < N; i++) + sum = sum + mat[i][i]; + + + for (int i = 0; i < N; i++) { + + int rowSum = 0; + for (int j = 0; j < N; j++) + rowSum += mat[i][j]; + + + if (rowSum != sum) + return false; + } + + + for (int i = 0; i < N; i++) { + + int colSum = 0; + for (int j = 0; j < N; j++) + colSum += mat[j][i]; + + + if (sum != colSum) + return false; + } + + return true; +} + + +int main() +{ + int mat[][N] = {{ 2, 7, 6 }, + { 9, 5, 1 }, + { 4, 3, 8 }}; + + if (isMagicSquare(mat)) + cout << "Magic Square"; + else + cout << "Not a magic Square"; + + return 0; +} From f2973de41605a090afe2a91e46b7430730ca5d8d Mon Sep 17 00:00:00 2001 From: Ankit2598 <36604725+Ankit2598@users.noreply.github.com> Date: Tue, 9 Oct 2018 20:40:10 +0530 Subject: [PATCH 074/285] Create MST using Kruskals Algorithm Helps us to find out the minimum spanning tree using Kruskals Algorithm. --- graphs/MST using Kruskals Algorithm | 136 ++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 graphs/MST using Kruskals Algorithm diff --git a/graphs/MST using Kruskals Algorithm b/graphs/MST using Kruskals Algorithm new file mode 100644 index 00000000..f602081f --- /dev/null +++ b/graphs/MST using Kruskals Algorithm @@ -0,0 +1,136 @@ +#include +#include +using namespace std; +int flag = 0, v[3]; +struct node_info +{ + int no; +}*q = NULL, *r = NULL; +struct node +{ + node_info *pt; + node *next; +}*top = NULL, *p = NULL, *np = NULL; +void push(node_info *ptr) +{ + np = new node; + np->pt = ptr; + np->next = NULL; + if (top == NULL) + { + top = np; + } + else + { + np->next = top; + top = np; + } +} + node_info *pop() +{ + if (top == NULL) + { + cout<<"underflow\n"; + } + else + { + p = top; + top = top->next; + return(p->pt); + delete(p); + } + return 0; +} +int back_edges(int *v,int am[][3],int i,int k) +{ + q = new node_info; + q->no = i; + push(q); + v[i] = 1; + for (int j = 0; j < 3; j++) + { + if (am[i][j] == 1 && v[j] == 0) + { + back_edges(v, am, j, i); + } + else if (am[i][j] == 0) + continue; + else if ((j == k) && (am[i][k] == 1 && v[j] == 1)) + continue; + else + { + flag = -1; + } + } + r = pop(); + return(flag); +} +void init() +{ + for (int i = 0; i < 3; i++) + v[i] = 0; + while (top != NULL) + { + pop(); + } +} +void kruskals(int am[][3], int wm[][3]) +{ + int ve = 1, min, temp, temp1; + cout<<"/n/nEDGES CREATED AS FOLLOWS:-/n/n"; + while (ve <= 6) + { + min = 999, temp = 0, temp1 = 0; + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + if ((wm[i][j] < min) && wm[i][j]!=0) + { + min = wm[i][j]; + temp = i; + temp1 = j; + } + else if (wm[i][j] == 0) + continue; + } + } + wm[temp][temp1]=wm[temp1][temp] = 999; + am[temp][temp1]=am[temp1][temp] = 1; + init(); + if (back_edges(v, am, temp, 0) < 0) + { + am[temp][temp1]=am[temp1][temp] = 0; + flag = 0; + continue; + } + else + { + cout<<"edge created between "<>wm[i][j]; + } + } + kruskals(am,wm); + return 0; +} From 2110b6328457322f173ac771cb997a8ad9073cd9 Mon Sep 17 00:00:00 2001 From: Shashank Sharma <34400090+shashank3395@users.noreply.github.com> Date: Tue, 9 Oct 2018 21:18:30 +0530 Subject: [PATCH 075/285] Create BSHUFFLL.cpp --- math/BSHUFFLL.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 math/BSHUFFLL.cpp diff --git a/math/BSHUFFLL.cpp b/math/BSHUFFLL.cpp new file mode 100644 index 00000000..10283ca0 --- /dev/null +++ b/math/BSHUFFLL.cpp @@ -0,0 +1,30 @@ +#include +#include + +using namespace std; + +int main() +{ + int n; + cin>>n; + if(n==1) + { cout<<1<<"\n"<<1;} + else if(n%2==0) + { + for(int i=1;i<=n;i++) + cout<=1;i--) + cout<=1;i--) + cout< Date: Tue, 9 Oct 2018 21:33:51 +0530 Subject: [PATCH 076/285] code_for CHEFRES problem this is the proper code for https://www.codechef.com/LTIME64B/problems/CHEFRES --- math/CHEFRES.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 math/CHEFRES.cpp diff --git a/math/CHEFRES.cpp b/math/CHEFRES.cpp new file mode 100644 index 00000000..3000d9ec --- /dev/null +++ b/math/CHEFRES.cpp @@ -0,0 +1,48 @@ +#include +#include + +using namespace std; + +int main() +{ + int t,n,m; + cin>>t; + while(t--) + { + cin>>n>>m; + int a[n],b[n],c[n]={0},f; + for(int i=0;i>a[i]>>b[i]; + } + for(int j=0;j>f; + int flag1=0; + for(int k=0;k=a[k]&&f=0) + {cout< Date: Tue, 9 Oct 2018 21:54:59 +0530 Subject: [PATCH 077/285] Adds Shortest Job First scheduling --- scheduling-algorithms/sjf.cpp | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 scheduling-algorithms/sjf.cpp diff --git a/scheduling-algorithms/sjf.cpp b/scheduling-algorithms/sjf.cpp new file mode 100644 index 00000000..136fddb2 --- /dev/null +++ b/scheduling-algorithms/sjf.cpp @@ -0,0 +1,89 @@ + +// C++ program to implement Shortest Job first +#include +using namespace std; + +struct Process +{ + int pid; // Process ID + int bt; // Burst Time +}; + +// This function is used for sorting all +// processes in increasing order of burst +// time +bool comparison(Process a, Process b) +{ + return (a.bt < b.bt); +} + +// Function to find the waiting time for all +// processes +void findWaitingTime(Process proc[], int n, int wt[]) +{ + // waiting time for first process is 0 + wt[0] = 0; + + // calculating waiting time + for (int i = 1; i < n ; i++ ) + wt[i] = proc[i-1].bt + wt[i-1] ; +} + +// Function to calculate turn around time +void findTurnAroundTime(Process proc[], int n, + int wt[], int tat[]) +{ + // calculating turnaround time by adding + // bt[i] + wt[i] + for (int i = 0; i < n ; i++) + tat[i] = proc[i].bt + wt[i]; +} + +//Function to calculate average time +void findavgTime(Process proc[], int n) +{ + int wt[n], tat[n], total_wt = 0, total_tat = 0; + + // Function to find waiting time of all processes + findWaitingTime(proc, n, wt); + + // Function to find turn around time for all processes + findTurnAroundTime(proc, n, wt, tat); + + // Display processes along with all details + cout << "\nProcesses "<< " Burst time " + << " Waiting time " << " Turn around time\n"; + + // Calculate total waiting time and total turn + // around time + for (int i = 0; i < n; i++) + { + total_wt = total_wt + wt[i]; + total_tat = total_tat + tat[i]; + cout << " " << proc[i].pid << "\t\t" + << proc[i].bt << "\t " << wt[i] + << "\t\t " << tat[i] < Date: Wed, 10 Oct 2018 01:39:49 -0400 Subject: [PATCH 078/285] contribution guide + cleanup + new readme --- .editorconfig | 19 ++ .github/code-of-conduct.md | 40 ++++ .github/contributing.md | 140 ++++++++++++ .github/issue_template.md | 21 ++ .github/pull_request_template.md | 23 ++ LICENSE | 3 +- README.md | 119 ++++++++-- data-structures/Queue.cpp | 61 ----- data-structures/queue/circular_buffer.cpp | 65 ++++++ data-structures/queue/queue.cpp | 86 +++++++ .../{Stack.cpp => stack/stack.cpp} | 12 + dynamic-programming/coin_change.cpp | 76 ++++--- dynamic-programming/edit-distance.cpp | 60 ----- dynamic-programming/edit_distance.cpp | 70 ++++++ dynamic-programming/knapsack.cpp | 81 ++++--- dynamic-programming/lcs.cpp | 99 ++++---- dynamic-programming/longest_path.cpp | 146 ++++++------ dynamic-programming/ways_to_cover.cpp | 63 +++--- graphs/bellman_ford.cpp | 211 +++++++++--------- graphs/bfs.cpp | 181 ++++++++------- graphs/count_diconnected_components.cpp | 115 +++++----- graphs/dfs.cpp | 121 +++++----- graphs/dijkstra.cpp | 155 +++++++------ graphs/floyd_warshall.cpp | 123 +++++----- graphs/prims_adjacency_list.cpp | 42 ++-- math/collatz.cpp | 15 +- math/euclids_gcd.cpp | 31 +++ math/euclids_gcd_algo.cpp | 23 -- math/factorial.cpp | 15 +- math/gcd_of_array.cpp | 64 +++--- math/lcm_of_array.cpp | 77 ++++--- math/lucky_numbers.cpp | 19 +- math/modular_exponentiation.cpp | 31 ++- searches/binary_search.cpp | 25 ++- searches/jump_search.cpp | 110 ++++----- searches/linear_search.cpp | 18 +- sorting/bubble_sort.cpp | 21 +- sorting/heap_sort.cpp | 19 +- sorting/insertion_sort.cpp | 82 +++---- sorting/merge_sort.cpp | 26 ++- sorting/quick_sort.cpp | 24 +- sorting/selection_sort.cpp | 11 +- sorting/sort_vector.cpp | 98 ++++---- strings/anagram-check.cpp | 90 -------- strings/anagram_check.cpp | 101 +++++++++ strings/lexicographic-ranking.cpp | 53 ----- strings/lexicographic_ranking.cpp | 64 ++++++ strings/longest-palindrome-subset.cpp | 84 ------- strings/longest_palindrome_subset.cpp | 94 ++++++++ strings/naive-search.cpp | 43 ---- strings/naive_search.cpp | 53 +++++ strings/permutations-of-string.cpp | 71 ------ strings/permutations_of_string.cpp | 81 +++++++ strings/print-duplicate-string.cpp | 37 --- strings/print_duplicate_string.cpp | 47 ++++ strings/rabin-karp.cpp | 77 ------- strings/rabin_karp.cpp | 87 ++++++++ strings/remove-adjacent-duplicates.cpp | 65 ------ strings/remove-duplicates-O(n2).cpp | 37 --- strings/remove-duplicates-O(nLogN).cpp | 29 --- strings/remove_adjacent_duplicates.cpp | 75 +++++++ strings/remove_duplicates.cpp | 47 ++++ strings/reverse-string.cpp | 51 ----- strings/reverse_string.cpp | 62 +++++ 64 files changed, 2473 insertions(+), 1716 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/code-of-conduct.md create mode 100644 .github/contributing.md create mode 100644 .github/issue_template.md create mode 100644 .github/pull_request_template.md delete mode 100644 data-structures/Queue.cpp create mode 100644 data-structures/queue/circular_buffer.cpp create mode 100644 data-structures/queue/queue.cpp rename data-structures/{Stack.cpp => stack/stack.cpp} (77%) delete mode 100644 dynamic-programming/edit-distance.cpp create mode 100644 dynamic-programming/edit_distance.cpp create mode 100644 math/euclids_gcd.cpp delete mode 100644 math/euclids_gcd_algo.cpp delete mode 100644 strings/anagram-check.cpp create mode 100644 strings/anagram_check.cpp delete mode 100644 strings/lexicographic-ranking.cpp create mode 100644 strings/lexicographic_ranking.cpp delete mode 100644 strings/longest-palindrome-subset.cpp create mode 100644 strings/longest_palindrome_subset.cpp delete mode 100644 strings/naive-search.cpp create mode 100644 strings/naive_search.cpp delete mode 100644 strings/permutations-of-string.cpp create mode 100644 strings/permutations_of_string.cpp delete mode 100644 strings/print-duplicate-string.cpp create mode 100644 strings/print_duplicate_string.cpp delete mode 100644 strings/rabin-karp.cpp create mode 100644 strings/rabin_karp.cpp delete mode 100644 strings/remove-adjacent-duplicates.cpp delete mode 100644 strings/remove-duplicates-O(n2).cpp delete mode 100644 strings/remove-duplicates-O(nLogN).cpp create mode 100644 strings/remove_adjacent_duplicates.cpp create mode 100644 strings/remove_duplicates.cpp delete mode 100644 strings/reverse-string.cpp create mode 100644 strings/reverse_string.cpp diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3e4ba08e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig +# https://EditorConfig.org +# +# Build with init-editorconfig +# https://github.com/abranhe/init-editorconfig + +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.github/code-of-conduct.md b/.github/code-of-conduct.md new file mode 100644 index 00000000..f809c8b0 --- /dev/null +++ b/.github/code-of-conduct.md @@ -0,0 +1,40 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 00000000..4ba1d04a --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,140 @@ +## Contributing + +> Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to abide by its terms. + +## See + +- [General Rules](#general-rules) +- [All ▲lgorithms Structure](#all-▲lgorithms-structure) +- [Adding new algorithms](adding-new-algorithms) +- [Style](#style) +- [Adding Documentation](#adding-documentation) +- [Run it online](#run-it-online) + +### General Rules + +- As much as possible, try to follow the existing format of markdown and code. + +### All ▲lgorithms Structure + +> We follow this structure + +- Directories and files are all in lower case letter. +- Directories are separated by a minus or hyphen (`-`) following `kebeab-case` style. In libraries this may change to follow the standards of the programming language +- Files are separated by an underscore (`_`) following the `snake_case` style. This could change to follow style standards on some languages like Java where we are using `CamelCase` style. + +``` +├── sorting +│ │── merge_sort.cpp +│ └── insertion_sort.cpp +├── searches +│ │── binary_search.cpp +│ └── linear_search.cpp +└── math + ├── third-algorithm + ├── third_algorithm.js + └── fourth_algorithm.js +``` + +### Adding new algorithms + +- Make your pull requests to be **specific** and **focused**. Instead of contributing "several algorithms" all at once contribute them all one by one separately (i.e. one pull request for "Binary Search", another one +for "Bubble Sort" and so on). +- Describe what you do in code using **comments**. + +### Style + +We are following the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), make sure you use it in your algorithms implementations. + +If you are lazy to read the Google C++ Style Guide, we already tough about you. You must use the [Tutorial Point Formatter](https://www.tutorialspoint.com/online_c_formatter.htm). **This is only to help you get started, you should double check it again**. See the below example: + +##### Important + +Use: + +```c++ +if() +{ +} +``` + +Instead of: + +```c++ +if() { +} +``` + +Each `.cpp` file should have the following header + +```cpp +// +// Binary search works for a sorted array. +// More documentation about the algorithm +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/cpp/category/algorithm +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham Hernandez +// Github: @abranhe +// +#include +``` + +If the algorithm is modified, this should be included there also. + +```cpp +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham Hernandez +// Github: @abranhe +// +// Modified by: Your Name +// Github: @yourgithubusername +// +``` + +If the algorithm have been modified by multiple contributors, that should be included as follow. + +```cpp +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham Hernandez +// Github: @abranhe +// +// Modifiers: +// Your Name, @yourgithubusername +// Your friend's name, @yourfriendongithub +// +... +``` + +C style should be on the [C repository](https://github.com/allalgorithms/c) so: + +```cpp +#include +``` + +Should not be included, use instead + +```cpp +#include +``` + +### Adding Documentation + +Please make sure if you add an algorithm, you also add the required documentation for it on [github.com/abranhe/algorithms](https://github.com/abranhe/algorithms), following the [template](https://github.com/abranhe/algorithms/blob/master/.github/category-template/algorithm-template/readme.md). + + +### Run it online + +On the documentation make sure you add a run it online [Repl.it](https://repl.it/). + +If you are modifying an algorithm make sure you add a benchmark using [Repl.it](https://repl.it/). + + +#### Lastly and not less important: + +Make sure you start ⭐️ and follow [@abranhe](https://git.io/abranhe) diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 00000000..9bfede26 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,21 @@ + + +This issue is: + + + +- [ ] A new Algorithm +- [ ] An update to an existing algorithm. +- [ ] An error found +- [ ] A proposal +- [ ] A question +- [ ] Other (Describe below*) + +**Description:** + + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..b85077b8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ + + +This pull request is: + + + +- [ ] A new Algorithm +- [ ] An update to an existing algorithm. +- [ ] An error fix +- [ ] Other (Describe below*) + +This pull request fixes: + + + +**Changes:** + + diff --git a/LICENSE b/LICENSE index 3ced2b5e..d7c82849 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2018 Abraham Hernandez (abraham@abranhe.com) +Copyright (c) 2018 All Algorithms and its contributors (allalgorithms.com) +Copyright (c) 2018 Abraham Hernandez (abranhe.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6886d0f2..c0d804c8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@
- C Plus Plus Logo +



-

All ▲lgorithms implemented in C Plus Plus

- +

All ▲lgorithms implemented in C++

+ @@ -19,28 +19,109 @@ ## Contents -- [Arithmetic Analysis](arithmetic-analysis) -- [File Transfer Protocol](file-transfer-protocol) -- [Greedy Algorithms](greedy-algorithms) -- [Graphs](graphs) -- [Math](math) -- [Neutral Network](neutral-network) -- [Ciphers](ciphers) -- [Data Structures](data-structures) -- [Dynamic Programming](dynamic-programming) -- [Hashes](hashes) -- [Searches](searches) -- [Sorting](sorting) -- [Strings](strings) -- [Traversals](traversals) +- [Artificial Intelligence](#artificial-intelligence) +- [Backtracking](#backtracking) +- [Bit Manipulation](#bit-manipulation) +- [Cellular Automaton](#cellular-automaton) +- [Ciphers](#ciphers) +- [Computational Geometry](#computational-geometry) +- [Cryptography](#cryptography) +- [Data Structures](#data-structures) +- [Divide and conquer](#divide-and-conquer) +- [Dynamic Programming](#dynamic-programming) +- [Gaming Theory](#gaming-theory) +- [Graphs](#graphs) +- [Greedy Algorithms](#greedy-algorithms) +- [Math](#math) +- [Networking](#networking) +- [Numerical Analysis](#numerical-analysis) +- [Operating system](#operating-system) +- [Randomized Algorithms](#randomized-algorithms) +- [Searches](#searches) +- [Selections Algorithms](#selections-algorithms) +- [Sorting](#sorting) +- [Strings](#strings) +- [Online Challenges](#online-challenges) +- [Others](#others) + +## Data Structures + +- Queue + - [Circular Buffer](data-structures/queue/circular_buffer.cpp) + - [Queue](data-structures/queue/queue.cpp) +- Stack + - [Stack](data-structures/stack/stack.cpp) + +## Dynamic Programming + +- [Coin Change](dynamic-programming/coin_change.cpp) +- [Edit Distance](dynamic-programming/edit_distance.cpp) +- [Knapsack](dynamic-programming/knapsack.cpp) +- [Longest common subsequence](dynamic-programming/lcs.cpp) +- [Longest Path](dynamic-programming/longest_path.cpp) +- [Ways to Cover](dynamic-programming/ways_to_cover.cpp) + +## Graphs + +- [Bellman Ford](graphs/bellman_ford.cpp) +- [Breadth-first search](graphs/bfs.cpp) +- [Count Disconnected Components](graphs/count_disconnected_components.cpp) +- [Depth-first search](graphs/dfs.cpp) +- [Dijkstra](graphs/dijkstra.cpp) +- [Floyed Warshall](graphs/floyd_warshall.cpp) +- [Prims Adjacency List](graphs/prims_adjacency_list.cpp) + +## Math + +- [Collatz](math/collatz.cpp) +- [Euclids Greatest common divisor](math/euclids_gcd.cpp) +- [Factorial](math/factorial.cpp) +- [Greatest common divisor of array](math/gcd_of_array.cpp) +- [Least common multiple of array](math/lcm_of_array.cpp) +- [Lucky Numbers](math/lucky_numbers.cpp) +- [Modular Exponentiations](math/modular_exponentiations.cpp) + +## Searches + +- [Binary Search](searches/binary_search.cpp) +- [Jump Search](searches/jump_search.cpp) +- [Linear Search](searches/linear_search.cpp) + +## Sorting + +- [Bubble Sort](sorting/bubble_sort.cpp) +- [Heap Sort](sorting/heap_sort.cpp) +- [Insertion Sort](sorting/insertion_sort.cpp) +- [Merge Sort](sorting/merge_sort.cpp) +- [Quick Sort](sorting/quick_sort.cpp) +- [Selection Sort](sorting/selection_sort.cpp) +- [Sort Vector](sorting/sort_vector.cpp) + +## Strings + +- [Anagram Check](strings/anagram_check.cpp) +- [Lexicographic Ranking](strings/lexicographic_ranking.cpp) +- [Longest Palindrome Subset](strings/longest_palindrome_subset.cpp) +- [Naive Search](strings/naive_search.cpp) +- [Permutations of string](strings/permutations_of_string.cpp) +- [Print duplicate string](strings/print_duplicate_string.cpp) +- [Rabin Karp](strings/rabin_karp.cpp) +- [Remove Adjacent Duplicates](strings/remove_adjacent_duplicates.cpp) +- [Remove Duplicates](strings/remove_duplicates.cpp) +- [Reverse String](strings/reverse_string.cpp) ## License This work is licensed under a [MIT License](https://github.com/abranhe/algorithms/blob/master/LICENSE) -[![MIT IMG][mit-license]]((https://github.com/abranhe/algorithms/blob/master/LICENSE)) +[![MIT IMG](https://cdn.abraham.gq/projects/algorithms/mit-license.png)](https://github.com/abranhe/algorithms/blob/master/LICENSE) To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. -[mit-license]: https://cdn.abraham.gq/projects/algorithms/mit-license.png +
+ + + +
+
diff --git a/data-structures/Queue.cpp b/data-structures/Queue.cpp deleted file mode 100644 index 1a67df4c..00000000 --- a/data-structures/Queue.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#define qsize 5 -struct queue -{ - int arr[qsize]; - int f,r; -}; -typedef struct queue Queue; -void enqueue(Queue *q, int x) -{ - if(q->r==qsize-1) - printf("QUEUE OVERFLOW\n"); - else - q->arr[++q->r]=x; -} -int dequeue(Queue *q) -{ - if(q->f-q->r==1) - printf("Queue Underflow"); - else - return(q->arr[q->f++]); -} -int main() -{ - Queue q; - q.f=0; - q.r=-1; - while(1) - { - printf("Enter 1 to Enqueue\nEnter 2 to Dequeue\nEnter 3 to Display All Elements\nEnter 0 to Exit\n"); - int c; - scanf("%d",&c); - switch(c) - { - case 0: printf("Ended\n"); return 0; - case 1: printf("Enter Element to Enqueue\n"); - int x; - scanf("%d",&x); - enqueue(&q,x); - break; - case 2: if(q.f-q.r==1) - printf("Queue Undeflow\n"); - else - printf("Dequeued Element is %d\n",dequeue(&q)); - break; - case 3: printf("Elements of Queue Are\n"); - if(q.f-q.r==1) - { - printf("Queue is Empty\n"); - break; - } - int i; - for(i=q.f;i<=q.r;i++) - printf("%d ",q.arr[i]); - printf("\n"); - break; - default: printf("Wrong Choice\n"); - } - } - return 0; -} diff --git a/data-structures/queue/circular_buffer.cpp b/data-structures/queue/circular_buffer.cpp new file mode 100644 index 00000000..dc4e8c54 --- /dev/null +++ b/data-structures/queue/circular_buffer.cpp @@ -0,0 +1,65 @@ +// +// Queue: the entities in the collection are kept in +// order and the principal (or only) operations on the +// collection are the addition of entities to the rear +// terminal position +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/data-scructures/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham +// Github: @abranhe +// +#include +#include + +template +class circular_buffer +{ +private: + T* m_buffer; + long m_index; + +public: + circular_buffer() + : m_buffer {new T[SZ]()} + , m_index {0} + { + } + + ~circular_buffer() + { + delete m_buffer; + } + + std::vector get_ordered() noexcept + { + std::vector vec; + for (long i = 0; i < SZ; ++i) + vec.push_back(m_buffer[(i + m_index) % SZ]); + return vec; + } + + void push(T x) noexcept + { + m_buffer[m_index] = x; + m_index = (m_index + 1) % SZ; + } +}; + +int main() +{ + circular_buffer buf; + + buf.push(1); + buf.push(2); + buf.push(3); + buf.push(4); + buf.push(5); + buf.push(6); + + for (auto x : buf.get_ordered()) + std::cout << x << std::endl; +} diff --git a/data-structures/queue/queue.cpp b/data-structures/queue/queue.cpp new file mode 100644 index 00000000..5a07ef27 --- /dev/null +++ b/data-structures/queue/queue.cpp @@ -0,0 +1,86 @@ +// +// Queue: the entities in the collection are kept in +// order and the principal (or only) operations on the +// collection are the addition of entities to the rear +// terminal position +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/data-scructures/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: ANUJ MODI +// Github: @descifrado +// +#include +#define qsize 5 +struct queue +{ + int arr[qsize]; + int f, r; +}; +typedef struct queue Queue; +void +enqueue (Queue * q, int x) +{ + if (q->r == qsize - 1) + printf ("QUEUE OVERFLOW\n"); + else + q->arr[++q->r] = x; +} + +int +dequeue (Queue * q) +{ + if (q->f - q->r == 1) + printf ("Queue Underflow"); + else + return (q->arr[q->f++]); +} + +int +main () +{ + Queue q; + q.f = 0; + q.r = -1; + while (1) + { + printf("Enter 1 to Enqueue\nEnter 2 to Dequeue\nEnter 3 to Display All Elements\nEnter 0 to Exit\n"); + int c; + scanf ("%d", &c); + switch (c) + { + case 0: + printf("Ended\n"); + return 0; + case 1: + printf ("Enter Element to Enqueue\n"); + int x; + scanf ("%d", &x); + enqueue (&q, x); + break; + case 2: + if (q.f - q.r == 1) + printf ("Queue Undeflow\n"); + else + printf ("Dequeued Element is %d\n", dequeue (&q)); + break; + case 3: + printf ("Elements of Queue Are\n"); + if (q.f - q.r == 1) + { + printf ("Queue is Empty\n"); + break; + } + int i; + for (i = q.f; i <= q.r; i++) + printf ("%d ", q.arr[i]); + printf ("\n"); + break; + default: + printf ("Wrong Choice\n"); + } + } + return 0; +} diff --git a/data-structures/Stack.cpp b/data-structures/stack/stack.cpp similarity index 77% rename from data-structures/Stack.cpp rename to data-structures/stack/stack.cpp index b3a488cb..878a4526 100644 --- a/data-structures/Stack.cpp +++ b/data-structures/stack/stack.cpp @@ -1,3 +1,15 @@ +// +// A Stack is an abstract data type that serves as a collection +// of elements, with two principal operations are push & pop +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/data-scructures/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: ANUJ MODI +// Github: @descifrado +// #include #define max 50 struct stack diff --git a/dynamic-programming/coin_change.cpp b/dynamic-programming/coin_change.cpp index 39a45f73..ee965577 100644 --- a/dynamic-programming/coin_change.cpp +++ b/dynamic-programming/coin_change.cpp @@ -1,41 +1,53 @@ -#include +// +// A Stack is an abstract data type that serves as a collection +// of elements, with two principal operations are push & pop +// +// The All ▲lgorithms library for python +// +// https://allalgorithms.com/dynamic-programming/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include using namespace std; - -int count( int S[], int m, int n ) -{ - int i, j, x, y; - - // We need n+1 rows as the table is constructed - // in bottom up manner using the base case 0 - // value case (n = 0) + +int count( int S[], int m, int n ) +{ + int i, j, x, y; + + // We need n+1 rows as the table is constructed + // in bottom up manner using the base case 0 + // value case (n = 0) int table[n+1][m]; - - // Fill the enteries for 0 value case (n = 0) - for (i=0; i= 0)? table[i - S[j]][j]: 0; - // Count of solutions excluding S[j] + // Fill the enteries for 0 value case (n = 0) + for (i=0; i= 0)? table[i - S[j]][j]: 0; + // Count of solutions excluding S[j] y = (j >= 1)? table[i][j-1]: 0; - table[i][j] = x + y; - } - } - return table[n][m-1]; -} + table[i][j] = x + y; + } + } + return table[n][m-1]; +} -int main() -{ - int coins[] = {1, 2, 3}; - int m = sizeof(coins)/sizeof(int); +int main() +{ + int coins[] = {1, 2, 3}; + int m = sizeof(coins)/sizeof(int); int n = 5; - cout << count(coins, m, n); + cout << count(coins, m, n); return 0; } diff --git a/dynamic-programming/edit-distance.cpp b/dynamic-programming/edit-distance.cpp deleted file mode 100644 index 09190183..00000000 --- a/dynamic-programming/edit-distance.cpp +++ /dev/null @@ -1,60 +0,0 @@ - -// A Dynamic Programming based C++ program to find minimum -// number operations to convert str1 to str2 -#include -using namespace std; - -// Utility function to find the minimum of three numbers -int min(int x, int y, int z) -{ - return min(min(x, y), z); -} - -int editDistDP(string str1, string str2, int m, int n) -{ - // Create a table to store results of subproblems - int dp[m+1][n+1]; - - // Fill d[][] in bottom up manner - for (int i=0; i<=m; i++) - { - for (int j=0; j<=n; j++) - { - // If first string is empty, only option is to - // isnert all characters of second string - if (i==0) - dp[i][j] = j; // Min. operations = j - - // If second string is empty, only option is to - // remove all characters of second string - else if (j==0) - dp[i][j] = i; // Min. operations = i - - // If last characters are same, ignore last char - // and recur for remaining string - else if (str1[i-1] == str2[j-1]) - dp[i][j] = dp[i-1][j-1]; - - // If the last character is different, consider all - // possibilities and find the minimum - else - dp[i][j] = 1 + min(dp[i][j-1], // Insert - dp[i-1][j], // Remove - dp[i-1][j-1]); // Replace - } - } - - return dp[m][n]; -} - -// Driver program -int main() -{ - // your code goes here - string str1 = "sunday"; - string str2 = "saturday"; - - cout << editDistDP(str1, str2, str1.length(), str2.length()); - - return 0; -} diff --git a/dynamic-programming/edit_distance.cpp b/dynamic-programming/edit_distance.cpp new file mode 100644 index 00000000..cdc96d23 --- /dev/null +++ b/dynamic-programming/edit_distance.cpp @@ -0,0 +1,70 @@ +// +// A Dynamic Programming based C++ program to find minimum +// number operations to convert str1 to str2 +// +// The All ▲lgorithms library for python +// +// https://allalgorithms.com/dynamic-programming/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham +// Github: @abranhe +// + +#include +using namespace std; + +// Utility function to find the minimum of three numbers +int min(int x, int y, int z) +{ + return min(min(x, y), z); +} + +int editDistDP(string str1, string str2, int m, int n) +{ + // Create a table to store results of subproblems + int dp[m+1][n+1]; + + // Fill d[][] in bottom up manner + for (int i=0; i<=m; i++) + { + for (int j=0; j<=n; j++) + { + // If first string is empty, only option is to + // isnert all characters of second string + if (i==0) + dp[i][j] = j; // Min. operations = j + + // If second string is empty, only option is to + // remove all characters of second string + else if (j==0) + dp[i][j] = i; // Min. operations = i + + // If last characters are same, ignore last char + // and recur for remaining string + else if (str1[i-1] == str2[j-1]) + dp[i][j] = dp[i-1][j-1]; + + // If the last character is different, consider all + // possibilities and find the minimum + else + dp[i][j] = 1 + min(dp[i][j-1], // Insert + dp[i-1][j], // Remove + dp[i-1][j-1]); // Replace + } + } + + return dp[m][n]; +} + +// Driver program +int main() +{ + // your code goes here + string str1 = "sunday"; + string str2 = "saturday"; + + cout << editDistDP(str1, str2, str1.length(), str2.length()); + + return 0; +} diff --git a/dynamic-programming/knapsack.cpp b/dynamic-programming/knapsack.cpp index dc0c188a..a6754ae9 100644 --- a/dynamic-programming/knapsack.cpp +++ b/dynamic-programming/knapsack.cpp @@ -1,39 +1,48 @@ +// +// A Dynamic Programming based solution for 0-1 Knapsack problem +// +// The All ▲lgorithms library for python +// +// https://allalgorithms.com/dynamic-programming/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Unknown +// Github: Unknown +// +#include -// A Dynamic Programming based solution for 0-1 Knapsack problem -#include - -// A utility function that returns maximum of two integers -int max(int a, int b) { return (a > b)? a : b; } - -// Returns the maximum value that can be put in a knapsack of capacity W -int knapSack(int W, int wt[], int val[], int n) -{ - int i, w; - int K[n+1][W+1]; - - // Build table K[][] in bottom up manner - for (i = 0; i <= n; i++) - { - for (w = 0; w <= W; w++) - { - if (i==0 || w==0) - K[i][w] = 0; - else if (wt[i-1] <= w) - K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w]); +// A utility function that returns maximum of two integers +int max(int a, int b) { return (a > b)? a : b; } + +// Returns the maximum value that can be put in a knapsack of capacity W +int knapSack(int W, int wt[], int val[], int n) +{ + int i, w; + int K[n+1][W+1]; + + // Build table K[][] in bottom up manner + for (i = 0; i <= n; i++) + { + for (w = 0; w <= W; w++) + { + if (i==0 || w==0) + K[i][w] = 0; + else if (wt[i-1] <= w) + K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w]); else - K[i][w] = K[i-1][w]; - } - } - - return K[n][W]; -} - -int main() -{ - int val[] = {60, 100, 120}; - int wt[] = {10, 20, 30}; - int W = 50; - int n = sizeof(val)/sizeof(val[0]); - cout << knapSack(W, wt, val, n); - return 0; + K[i][w] = K[i-1][w]; + } + } + + return K[n][W]; +} + +int main() +{ + int val[] = {60, 100, 120}; + int wt[] = {10, 20, 30}; + int W = 50; + int n = sizeof(val)/sizeof(val[0]); + cout << knapSack(W, wt, val, n); + return 0; } diff --git a/dynamic-programming/lcs.cpp b/dynamic-programming/lcs.cpp index bad7d889..f3c7aada 100644 --- a/dynamic-programming/lcs.cpp +++ b/dynamic-programming/lcs.cpp @@ -1,52 +1,61 @@ +// +// Dynamic Programming C/C++ implementation of LCS problem +// +// The All ▲lgorithms library for python +// +// https://allalgorithms.com/dynamic-programming/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Unknown +// Github: Unknown +// +#include + +int max(int a, int b); -/* Dynamic Programming C/C++ implementation of LCS problem */ -#include - -int max(int a, int b); - /* Returns length of LCS for X[0..m-1], Y[0..n-1] */ -int lcs( char *X, char *Y, int m, int n ) -{ - int L[m+1][n+1]; - int i, j; - - /* Following steps build L[m+1][n+1] in bottom up fashion. Note +int lcs( char *X, char *Y, int m, int n ) +{ + int L[m+1][n+1]; + int i, j; + + /* Following steps build L[m+1][n+1] in bottom up fashion. Note that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] */ - for (i=0; i<=m; i++) - { - for (j=0; j<=n; j++) - { - if (i == 0 || j == 0) - L[i][j] = 0; - - else if (X[i-1] == Y[j-1]) - L[i][j] = L[i-1][j-1] + 1; - + for (i=0; i<=m; i++) + { + for (j=0; j<=n; j++) + { + if (i == 0 || j == 0) + L[i][j] = 0; + + else if (X[i-1] == Y[j-1]) + L[i][j] = L[i-1][j-1] + 1; + else - L[i][j] = max(L[i-1][j], L[i][j-1]); - } - } - + L[i][j] = max(L[i-1][j], L[i][j-1]); + } + } + /* L[m][n] contains length of LCS for X[0..n-1] and Y[0..m-1] */ - return L[m][n]; -} - + return L[m][n]; +} + /* Utility function to get max of 2 integers */ -int max(int a, int b) -{ - return (a > b)? a : b; -} - +int max(int a, int b) +{ + return (a > b)? a : b; +} + /* Driver program to test above function */ -int main() -{ - char X[] = "AGGTAB"; - char Y[] = "GXTXAYB"; - - int m = strlen(X); - int n = strlen(Y); - - cout << "Length of LCS is " << lcs( X, Y, m, n ) ; - - return 0; -} +int main() +{ + char X[] = "AGGTAB"; + char Y[] = "GXTXAYB"; + + int m = strlen(X); + int n = strlen(Y); + + cout << "Length of LCS is " << lcs( X, Y, m, n ) ; + + return 0; +} diff --git a/dynamic-programming/longest_path.cpp b/dynamic-programming/longest_path.cpp index 7d458d73..a0cd4678 100644 --- a/dynamic-programming/longest_path.cpp +++ b/dynamic-programming/longest_path.cpp @@ -1,70 +1,80 @@ +// +// Dynamic Programming C/C++ implementation of Longest Path problem +// +// The All ▲lgorithms library for python +// +// https://allalgorithms.com/dynamic-programming/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Unknown +// Github: Unknown +// +#include +#define n 3 +using namespace std; -#include -#define n 3 -using namespace std; - -// Returns length of the longest path beginning with mat[i][j]. -// This function mainly uses lookup table dp[n][n] -int findLongestFromACell(int i, int j, int mat[n][n], int dp[n][n]) -{ - // Base case - if (i<0 || i>=n || j<0 || j>=n) - return 0; - - // If this subproblem is already solved - if (dp[i][j] != -1) - return dp[i][j]; - - // Since all numbers are unique and in range from 1 to n*n, - // there is atmost one possible direction from any cell - if (j0 && (mat[i][j] +1 == mat[i][j-1])) - return dp[i][j] = 1 + findLongestFromACell(i,j-1,mat,dp); - - if (i>0 && (mat[i][j] +1 == mat[i-1][j])) - return dp[i][j] = 1 + findLongestFromACell(i-1,j,mat,dp); - - if (i=n || j<0 || j>=n) + return 0; + + // If this subproblem is already solved + if (dp[i][j] != -1) + return dp[i][j]; + + // Since all numbers are unique and in range from 1 to n*n, + // there is atmost one possible direction from any cell + if (j0 && (mat[i][j] +1 == mat[i][j-1])) + return dp[i][j] = 1 + findLongestFromACell(i,j-1,mat,dp); + + if (i>0 && (mat[i][j] +1 == mat[i-1][j])) + return dp[i][j] = 1 + findLongestFromACell(i-1,j,mat,dp); + + if (i +using namespace std; -// A Dynamic Programming based C++ program to count number of ways -// to cover a distance with 1, 2 and 3 steps -#include -using namespace std; - -int printCountDP(int dist) -{ - int count[dist+1]; - - // Initialize base values. There is one way to cover 0 and 1 - // distances and two ways to cover 2 distance - count[0] = 1, count[1] = 1, count[2] = 2; - - // Fill the count array in bottom up manner - for (int i=3; i<=dist; i++) - count[i] = count[i-1] + count[i-2] + count[i-3]; - - return count[dist]; -} - -// driver program -int main() -{ - int dist = 4; - cout << printCountDP(dist); - return 0; -} +int printCountDP(int dist) +{ + int count[dist+1]; + + // Initialize base values. There is one way to cover 0 and 1 + // distances and two ways to cover 2 distance + count[0] = 1, count[1] = 1, count[2] = 2; + + // Fill the count array in bottom up manner + for (int i=3; i<=dist; i++) + count[i] = count[i-1] + count[i-2] + count[i-3]; + + return count[dist]; +} + +// driver program +int main() +{ + int dist = 4; + cout << printCountDP(dist); + return 0; +} diff --git a/graphs/bellman_ford.cpp b/graphs/bellman_ford.cpp index 340cc6a4..6bdf1c71 100644 --- a/graphs/bellman_ford.cpp +++ b/graphs/bellman_ford.cpp @@ -1,106 +1,117 @@ -#include +// +// BellmanFord algorithm implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/cpp/graphs/bellman-ford/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include -struct Edge -{ - int src, dest, weight; -}; +struct Edge +{ + int src, dest, weight; +}; -struct Graph -{ - // V-> Number of vertices, E-> Number of edges - int V, E; - // graph is represented as an array of edges. - struct Edge* edge; -}; - -struct Graph* createGraph(int V, int E) -{ - struct Graph* graph = new Graph; - graph->V = V; - graph->E = E; - graph->edge = new Edge[E]; - return graph; -} - -void printArr(int dist[], int n) -{ - printf("Vertex Distance from Source\n"); - for (int i = 0; i < n; ++i) - printf("%d \t\t %d\n", i, dist[i]); +struct Graph +{ + // V-> Number of vertices, E-> Number of edges + int V, E; + // graph is represented as an array of edges. + struct Edge* edge; +}; + +struct Graph* createGraph(int V, int E) +{ + struct Graph* graph = new Graph; + graph->V = V; + graph->E = E; + graph->edge = new Edge[E]; + return graph; +} + +void printArr(int dist[], int n) +{ + printf("Vertex Distance from Source\n"); + for (int i = 0; i < n; ++i) + printf("%d \t\t %d\n", i, dist[i]); } -void BellmanFord(struct Graph* graph, int src) -{ - int V = graph->V; - int E = graph->E; - int dist[V]; - - // Step 1: Initialize distances from src to all other vertices - // as INFINITE - for (int i = 0; i < V; i++) - dist[i] = INT_MAX; - dist[src] = 0; - - // Step 2: Relax all edges |V| - 1 times. A simple shortest - // path from src to any other vertex can have at-most |V| - 1 - // edges - for (int i = 1; i <= V-1; i++) - { - for (int j = 0; j < E; j++) - { - int u = graph->edge[j].src; - int v = graph->edge[j].dest; - int weight = graph->edge[j].weight; - if (dist[u] != INT_MAX && dist[u] + weight < dist[v]) - dist[v] = dist[u] + weight; - } - } - - // Step 3: check for negative-weight cycles. The above step - // guarantees shortest distances if graph doesn't contain - // negative weight cycle. If we get a shorter path, then there - // is a cycle. - for (int i = 0; i < E; i++) - { - int u = graph->edge[i].src; - int v = graph->edge[i].dest; - int weight = graph->edge[i].weight; - if (dist[u] != INT_MAX && dist[u] + weight < dist[v]) - printf("Graph contains negative weight cycle"); - } - printArr(dist, V); - return; -} -int main() -{ +void BellmanFord(struct Graph* graph, int src) +{ + int V = graph->V; + int E = graph->E; + int dist[V]; + + // Step 1: Initialize distances from src to all other vertices + // as INFINITE + for (int i = 0; i < V; i++) + dist[i] = INT_MAX; + dist[src] = 0; + + // Step 2: Relax all edges |V| - 1 times. A simple shortest + // path from src to any other vertex can have at-most |V| - 1 + // edges + for (int i = 1; i <= V-1; i++) + { + for (int j = 0; j < E; j++) + { + int u = graph->edge[j].src; + int v = graph->edge[j].dest; + int weight = graph->edge[j].weight; + if (dist[u] != INT_MAX && dist[u] + weight < dist[v]) + dist[v] = dist[u] + weight; + } + } + + // Step 3: check for negative-weight cycles. The above step + // guarantees shortest distances if graph doesn't contain + // negative weight cycle. If we get a shorter path, then there + // is a cycle. + for (int i = 0; i < E; i++) + { + int u = graph->edge[i].src; + int v = graph->edge[i].dest; + int weight = graph->edge[i].weight; + if (dist[u] != INT_MAX && dist[u] + weight < dist[v]) + printf("Graph contains negative weight cycle"); + } + printArr(dist, V); + return; +} +int main() +{ /* Sample graph */ - int V = 5; - int E = 8; - struct Graph* graph = createGraph(V, E); - graph->edge[0].src = 0; - graph->edge[0].dest = 1; - graph->edge[0].weight = -1; - graph->edge[1].src = 0; - graph->edge[1].dest = 2; - graph->edge[1].weight = 4; - graph->edge[2].src = 1; - graph->edge[2].dest = 2; - graph->edge[2].weight = 3; - graph->edge[3].src = 1; - graph->edge[3].dest = 3; - graph->edge[3].weight = 2; - graph->edge[4].src = 1; - graph->edge[4].dest = 4; - graph->edge[4].weight = 2; - graph->edge[5].src = 3; - graph->edge[5].dest = 2; - graph->edge[5].weight = 5; - graph->edge[6].src = 3; - graph->edge[6].dest = 1; - graph->edge[6].weight = 1; - graph->edge[7].src = 4; - graph->edge[7].dest = 3; - graph->edge[7].weight = -3; - BellmanFord(graph, 0); - return 0; + int V = 5; + int E = 8; + struct Graph* graph = createGraph(V, E); + graph->edge[0].src = 0; + graph->edge[0].dest = 1; + graph->edge[0].weight = -1; + graph->edge[1].src = 0; + graph->edge[1].dest = 2; + graph->edge[1].weight = 4; + graph->edge[2].src = 1; + graph->edge[2].dest = 2; + graph->edge[2].weight = 3; + graph->edge[3].src = 1; + graph->edge[3].dest = 3; + graph->edge[3].weight = 2; + graph->edge[4].src = 1; + graph->edge[4].dest = 4; + graph->edge[4].weight = 2; + graph->edge[5].src = 3; + graph->edge[5].dest = 2; + graph->edge[5].weight = 5; + graph->edge[6].src = 3; + graph->edge[6].dest = 1; + graph->edge[6].weight = 1; + graph->edge[7].src = 4; + graph->edge[7].dest = 3; + graph->edge[7].weight = -3; + BellmanFord(graph, 0); + return 0; } diff --git a/graphs/bfs.cpp b/graphs/bfs.cpp index a2480464..5b82036d 100644 --- a/graphs/bfs.cpp +++ b/graphs/bfs.cpp @@ -1,87 +1,98 @@ -#include -#include - -using namespace std; - -class Graph -{ - int V; // No. of vertices - - // Pointer to an array containing adjacency - // lists - list *adj; -public: - Graph(int V); // Constructor - - // function to add an edge to graph - void addEdge(int v, int w); - - // prints BFS traversal from a given source s - void BFS(int s); -}; - -Graph::Graph(int V) -{ - this->V = V; - adj = new list[V]; -} - -void Graph::addEdge(int v, int w) -{ - adj[v].push_back(w); // Add w to v’s list. -} - -void Graph::BFS(int s) -{ - // Mark all the vertices as not visited - bool *visited = new bool[V]; - for(int i = 0; i < V; i++) - visited[i] = false; - - // Create a queue for BFS - list queue; - - // Mark the current node as visited and enqueue it - visited[s] = true; - queue.push_back(s); - - // 'i' will be used to get all adjacent - // vertices of a vertex - list::iterator i; - - while(!queue.empty()) - { - // Dequeue a vertex from queue and print it - s = queue.front(); - cout << s << " "; - queue.pop_front(); - - // Get all adjacent vertices of the dequeued - // vertex s. If a adjacent has not been visited, - // then mark it visited and enqueue it - for (i = adj[s].begin(); i != adj[s].end(); ++i) - { - if (!visited[*i]) - { - visited[*i] = true; - queue.push_back(*i); - } - } - } -} - -int main() -{ - // Sample graph - Graph g(4); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); - g.addEdge(3, 3); +// +// Breadth-first search implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include +#include + +using namespace std; + +class Graph +{ + int V; // No. of vertices + + // Pointer to an array containing adjacency + // lists + list *adj; +public: + Graph(int V); // Constructor + + // function to add an edge to graph + void addEdge(int v, int w); + + // prints BFS traversal from a given source s + void BFS(int s); +}; + +Graph::Graph(int V) +{ + this->V = V; + adj = new list[V]; +} + +void Graph::addEdge(int v, int w) +{ + adj[v].push_back(w); // Add w to v’s list. +} + +void Graph::BFS(int s) +{ + // Mark all the vertices as not visited + bool *visited = new bool[V]; + for(int i = 0; i < V; i++) + visited[i] = false; + + // Create a queue for BFS + list queue; + + // Mark the current node as visited and enqueue it + visited[s] = true; + queue.push_back(s); + + // 'i' will be used to get all adjacent + // vertices of a vertex + list::iterator i; + + while(!queue.empty()) + { + // Dequeue a vertex from queue and print it + s = queue.front(); + cout << s << " "; + queue.pop_front(); + + // Get all adjacent vertices of the dequeued + // vertex s. If a adjacent has not been visited, + // then mark it visited and enqueue it + for (i = adj[s].begin(); i != adj[s].end(); ++i) + { + if (!visited[*i]) + { + visited[*i] = true; + queue.push_back(*i); + } + } + } +} + +int main() +{ + // Sample graph + Graph g(4); + g.addEdge(0, 1); + g.addEdge(0, 2); + g.addEdge(1, 2); + g.addEdge(2, 0); + g.addEdge(2, 3); + g.addEdge(3, 3); cout << "Following is Breadth First Traversal " - << "(starting from vertex 2) \n"; - g.BFS(2); - return 0; + << "(starting from vertex 2) \n"; + g.BFS(2); + return 0; } diff --git a/graphs/count_diconnected_components.cpp b/graphs/count_diconnected_components.cpp index 0ee61601..5c71c96d 100644 --- a/graphs/count_diconnected_components.cpp +++ b/graphs/count_diconnected_components.cpp @@ -1,69 +1,80 @@ -#include -#include -using namespace std; +// +// Count disconnected components implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs +// https://github.com/allalgorithms/cpp +// +// Contributed by: Rituparno Biswas +// Github: @roopbiswas +// +#include +#include +using namespace std; int count=1; -// Graph class represents a directed graph -// using adjacency list representation -class Graph -{ +// Graph class represents a directed graph +// using adjacency list representation +class Graph +{ int V; - list *adj; - void DFSUtil(int v, bool visited[]); -public: - Graph(int V); - void addEdge(int v, int w); - void DFS(int v); -}; - -Graph::Graph(int V) -{ - this->V = V; - adj = new list[V]; -} - -void Graph::addEdge(int v, int w) -{ - adj[v].push_back(w); // Add w to v’s list. -} - -void Graph::DFSUtil(int v, bool visited[]) -{ + list *adj; + void DFSUtil(int v, bool visited[]); +public: + Graph(int V); + void addEdge(int v, int w); + void DFS(int v); +}; + +Graph::Graph(int V) +{ + this->V = V; + adj = new list[V]; +} + +void Graph::addEdge(int v, int w) +{ + adj[v].push_back(w); // Add w to v’s list. +} + +void Graph::DFSUtil(int v, bool visited[]) +{ visited[v] = true; - list::iterator i; - for (i = adj[v].begin(); i != adj[v].end(); ++i) - if (!visited[*i]) - DFSUtil(*i, visited); -} -void Graph::DFS(int v) -{ - bool *visited = new bool[V]; - for (int i = 0; i < V; i++) + list::iterator i; + for (i = adj[v].begin(); i != adj[v].end(); ++i) + if (!visited[*i]) + DFSUtil(*i, visited); +} +void Graph::DFS(int v) +{ + bool *visited = new bool[V]; + for (int i = 0; i < V; i++) visited[i] = false; DFSUtil(v, visited); - for (int i = 0; i < V; i++) + for (int i = 0; i < V; i++) if(visited[i] == false) { count++; DFSUtil(i, visited); } -} - -int main() -{ - Graph g(9); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); +} + +int main() +{ + Graph g(9); + g.addEdge(0, 1); + g.addEdge(0, 2); + g.addEdge(1, 2); + g.addEdge(2, 0); + g.addEdge(2, 3); g.addEdge(3, 3); g.addEdge(4, 5); g.addEdge(6, 7); g.addEdge(6, 8); - + g.DFS(2); - cout << "Number of disconnected components in the given graph is : " < -#include -using namespace std; - -// Graph class represents a directed graph -// using adjacency list representation -class Graph -{ +// +// Depth-first search algorithm implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include +#include +using namespace std; + +// Graph class represents a directed graph +// using adjacency list representation +class Graph +{ int V; - list *adj; - void DFSUtil(int v, bool visited[]); -public: - Graph(int V); - void addEdge(int v, int w); - void DFS(int v); -}; - -Graph::Graph(int V) -{ - this->V = V; - adj = new list[V]; -} - -void Graph::addEdge(int v, int w) -{ - adj[v].push_back(w); // Add w to v’s list. -} - -void Graph::DFSUtil(int v, bool visited[]) -{ - visited[v] = true; - cout << v << " "; - list::iterator i; - for (i = adj[v].begin(); i != adj[v].end(); ++i) - if (!visited[*i]) - DFSUtil(*i, visited); -} -void Graph::DFS(int v) -{ - bool *visited = new bool[V]; - for (int i = 0; i < V; i++) + list *adj; + void DFSUtil(int v, bool visited[]); +public: + Graph(int V); + void addEdge(int v, int w); + void DFS(int v); +}; + +Graph::Graph(int V) +{ + this->V = V; + adj = new list[V]; +} + +void Graph::addEdge(int v, int w) +{ + adj[v].push_back(w); // Add w to v’s list. +} + +void Graph::DFSUtil(int v, bool visited[]) +{ + visited[v] = true; + cout << v << " "; + list::iterator i; + for (i = adj[v].begin(); i != adj[v].end(); ++i) + if (!visited[*i]) + DFSUtil(*i, visited); +} +void Graph::DFS(int v) +{ + bool *visited = new bool[V]; + for (int i = 0; i < V; i++) visited[i] = false; - DFSUtil(v, visited); -} - -int main() -{ - Graph g(4); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); - g.addEdge(3, 3); - cout << "Following is Depth First Traversal (starting from vertex 2)\n"; - g.DFS(2); - return 0; + DFSUtil(v, visited); +} + +int main() +{ + Graph g(4); + g.addEdge(0, 1); + g.addEdge(0, 2); + g.addEdge(1, 2); + g.addEdge(2, 0); + g.addEdge(2, 3); + g.addEdge(3, 3); + cout << "Following is Depth First Traversal (starting from vertex 2)\n"; + g.DFS(2); + return 0; } diff --git a/graphs/dijkstra.cpp b/graphs/dijkstra.cpp index 571850fb..e41a8785 100644 --- a/graphs/dijkstra.cpp +++ b/graphs/dijkstra.cpp @@ -1,78 +1,89 @@ -#include -#include - -// Number of vertices in the graph -#define V 9 -int minDistance(int dist[], bool sptSet[]) -{ - // Initialize min value - int min = INT_MAX, min_index; - - for (int v = 0; v < V; v++) - if (sptSet[v] == false && dist[v] <= min) - min = dist[v], min_index = v; - - return min_index; -} - -void printSolution(int dist[], int n) -{ - printf("Vertex Distance from Source\n"); - for (int i = 0; i < V; i++) - printf("%d tt %d\n", i, dist[i]); -} - -void dijkstra(int graph[V][V], int src) -{ - int dist[V]; // The output array. dist[i] will hold the shortest - // distance from src to i - - bool sptSet[V]; // sptSet[i] will true if vertex i is included in shortest - // path tree or shortest distance from src to i is finalized - - // Initialize all distances as INFINITE and stpSet[] as false - for (int i = 0; i < V; i++) - dist[i] = INT_MAX, sptSet[i] = false; - - // Distance of source vertex from itself is always 0 - dist[src] = 0; - - // Find shortest path for all vertices - for (int count = 0; count < V-1; count++) - { - // Pick the minimum distance vertex from the set of vertices not - // yet processed. u is always equal to src in the first iteration. - int u = minDistance(dist, sptSet); - - // Mark the picked vertex as processed - sptSet[u] = true; - - // Update dist value of the adjacent vertices of the picked vertex. - for (int v = 0; v < V; v++) - - // Update dist[v] only if is not in sptSet, there is an edge from - // u to v, and total weight of path from src to v through u is - // smaller than current value of dist[v] - if (!sptSet[v] && graph[u][v] && dist[u] != INT_MAX - && dist[u]+graph[u][v] < dist[v]) - dist[v] = dist[u] + graph[u][v]; +// +// Dijkstra search algorithm implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include +#include + +// Number of vertices in the graph +#define V 9 +int minDistance(int dist[], bool sptSet[]) +{ + // Initialize min value + int min = INT_MAX, min_index; + + for (int v = 0; v < V; v++) + if (sptSet[v] == false && dist[v] <= min) + min = dist[v], min_index = v; + + return min_index; +} + +void printSolution(int dist[], int n) +{ + printf("Vertex Distance from Source\n"); + for (int i = 0; i < V; i++) + printf("%d tt %d\n", i, dist[i]); +} + +void dijkstra(int graph[V][V], int src) +{ + int dist[V]; // The output array. dist[i] will hold the shortest + // distance from src to i + + bool sptSet[V]; // sptSet[i] will true if vertex i is included in shortest + // path tree or shortest distance from src to i is finalized + + // Initialize all distances as INFINITE and stpSet[] as false + for (int i = 0; i < V; i++) + dist[i] = INT_MAX, sptSet[i] = false; + + // Distance of source vertex from itself is always 0 + dist[src] = 0; + + // Find shortest path for all vertices + for (int count = 0; count < V-1; count++) + { + // Pick the minimum distance vertex from the set of vertices not + // yet processed. u is always equal to src in the first iteration. + int u = minDistance(dist, sptSet); + + // Mark the picked vertex as processed + sptSet[u] = true; + + // Update dist value of the adjacent vertices of the picked vertex. + for (int v = 0; v < V; v++) + + // Update dist[v] only if is not in sptSet, there is an edge from + // u to v, and total weight of path from src to v through u is + // smaller than current value of dist[v] + if (!sptSet[v] && graph[u][v] && dist[u] != INT_MAX + && dist[u]+graph[u][v] < dist[v]) + dist[v] = dist[u] + graph[u][v]; } - printSolution(dist, V); -} + printSolution(dist, V); +} -int main() -{ +int main() +{ /* Sample graph */ - int graph[V][V] = {{0, 4, 0, 0, 0, 0, 0, 8, 0}, - {4, 0, 8, 0, 0, 0, 0, 11, 0}, - {0, 8, 0, 7, 0, 4, 0, 0, 2}, - {0, 0, 7, 0, 9, 14, 0, 0, 0}, - {0, 0, 0, 9, 0, 10, 0, 0, 0}, - {0, 0, 4, 14, 10, 0, 2, 0, 0}, - {0, 0, 0, 0, 0, 2, 0, 1, 6}, - {8, 11, 0, 0, 0, 0, 1, 0, 7}, - {0, 0, 2, 0, 0, 0, 6, 7, 0} + int graph[V][V] = {{0, 4, 0, 0, 0, 0, 0, 8, 0}, + {4, 0, 8, 0, 0, 0, 0, 11, 0}, + {0, 8, 0, 7, 0, 4, 0, 0, 2}, + {0, 0, 7, 0, 9, 14, 0, 0, 0}, + {0, 0, 0, 9, 0, 10, 0, 0, 0}, + {0, 0, 4, 14, 10, 0, 2, 0, 0}, + {0, 0, 0, 0, 0, 2, 0, 1, 6}, + {8, 11, 0, 0, 0, 0, 1, 0, 7}, + {0, 0, 2, 0, 0, 0, 6, 7, 0} }; dijkstra(graph, 0); - return 0; + return 0; } diff --git a/graphs/floyd_warshall.cpp b/graphs/floyd_warshall.cpp index 2c326d10..74e6b0d3 100644 --- a/graphs/floyd_warshall.cpp +++ b/graphs/floyd_warshall.cpp @@ -1,69 +1,80 @@ -#include +// +// Floyd Warshall algorithm implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// +#include #define V 4 // Number of vertices in the graph #define INF 1e7 -void printSolution(int dist[][V]); -void floydWarshall (int graph[][V]) -{ - int dist[V][V], i, j, k; - /* Initialize the solution matrix same as input graph matrix. Or - we can say the initial values of shortest distances are based +void printSolution(int dist[][V]); +void floydWarshall (int graph[][V]) +{ + int dist[V][V], i, j, k; + /* Initialize the solution matrix same as input graph matrix. Or + we can say the initial values of shortest distances are based on shortest paths considering no intermediate vertex. */ - for (i = 0; i < V; i++) - for (j = 0; j < V; j++) - dist[i][j] = graph[i][j]; - /* Add all vertices one by one to the set of intermediate vertices. - ---> Before start of an iteration, we have shortest distances between all - pairs of vertices such that the shortest distances consider only the - vertices in set {0, 1, 2, .. k-1} as intermediate vertices. - ----> After the end of an iteration, vertex no. k is added to the set of + for (i = 0; i < V; i++) + for (j = 0; j < V; j++) + dist[i][j] = graph[i][j]; + /* Add all vertices one by one to the set of intermediate vertices. + ---> Before start of an iteration, we have shortest distances between all + pairs of vertices such that the shortest distances consider only the + vertices in set {0, 1, 2, .. k-1} as intermediate vertices. + ----> After the end of an iteration, vertex no. k is added to the set of intermediate vertices and the set becomes {0, 1, 2, .. k} */ - for (k = 0; k < V; k++) - { - // Pick all vertices as source one by one - for (i = 0; i < V; i++) - { - // Pick all vertices as destination for the - // above picked source - for (j = 0; j < V; j++) - { - // If vertex k is on the shortest path from - // i to j, then update the value of dist[i][j] - if (dist[i][k] + dist[k][j] < dist[i][j]) - dist[i][j] = dist[i][k] + dist[k][j]; - } - } - } - // Print the shortest distance matrix - printSolution(dist); -} + for (k = 0; k < V; k++) + { + // Pick all vertices as source one by one + for (i = 0; i < V; i++) + { + // Pick all vertices as destination for the + // above picked source + for (j = 0; j < V; j++) + { + // If vertex k is on the shortest path from + // i to j, then update the value of dist[i][j] + if (dist[i][k] + dist[k][j] < dist[i][j]) + dist[i][j] = dist[i][k] + dist[k][j]; + } + } + } + // Print the shortest distance matrix + printSolution(dist); +} -void printSolution(int dist[][V]) -{ +void printSolution(int dist[][V]) +{ printf ("The following matrix shows the shortest distances" - " between every pair of vertices \n"); - for (int i = 0; i < V; i++) - { - for (int j = 0; j < V; j++) - { - if (dist[i][j] == INF) - printf("%7s", "INF"); + " between every pair of vertices \n"); + for (int i = 0; i < V; i++) + { + for (int j = 0; j < V; j++) + { + if (dist[i][j] == INF) + printf("%7s", "INF"); else - printf ("%7d", dist[i][j]); - } - printf("\n"); - } -} - -int main() + printf ("%7d", dist[i][j]); + } + printf("\n"); + } +} + +int main() { // Sample graph - int graph[V][V] = { {0, 5, INF, 10}, - {INF, 0, 3, INF}, - {INF, INF, 0, 1}, - {INF, INF, INF, 0} + int graph[V][V] = { {0, 5, INF, 10}, + {INF, 0, 3, INF}, + {INF, INF, 0, 1}, + {INF, INF, INF, 0} }; - floydWarshall(graph); - return 0; + floydWarshall(graph); + return 0; } diff --git a/graphs/prims_adjacency_list.cpp b/graphs/prims_adjacency_list.cpp index b12c8137..6c126d5f 100644 --- a/graphs/prims_adjacency_list.cpp +++ b/graphs/prims_adjacency_list.cpp @@ -1,20 +1,28 @@ - -/* The following is an implementation of Prim's algorithm - using adjacency list representation of a graph. The data structure - min heap is used for this. There are, again, two implementations - in this, the min heap code can be written differently in a class, or - the priority_queue present in STL can be used. Here, it's the - latter. - Now, a priority_queue is essentially a max heap, but can be used - as given below to form a min heap. The loop statements execute - v+e times, in addition to log(v) time for adding to priority_queue. - Overall, O(v+e)*O(log(v)) = O((e+v)*log(v)) - e = O(v^2) for dense graphs, because e <= v*(v-1)/2 for any connected graph. - And e = O(v), or, v = O(e) for sparsely connected graphs. - Hence, O((e+v)*log(v)) = O(e*log(v)). - The pop() and top() operations take O(log(v)) and O(1) time - respectively. -*/ +// +// The following is an implementation of Prim's algorithm +// using adjacency list representation of a graph. The data structure +// min heap is used for this. There are, again, two implementations +// in this, the min heap code can be written differently in a class, or +// the priority_queue present in STL can be used. Here, it's the +// latter. +// Now, a priority_queue is essentially a max heap, but can be used +// as given below to form a min heap. The loop statements execute +// v+e times, in addition to log(v) time for adding to priority_queue. +// Overall, O(v+e)*O(log(v)) = O((e+v)*log(v)) +// e = O(v^2) for dense graphs, because e <= v*(v-1)/2 for any connected graph. +// And e = O(v), or, v = O(e) for sparsely connected graphs. +// Hence, O((e+v)*log(v)) = O(e*log(v)). +// The pop() and top() operations take O(log(v)) and O(1) time +// respectively. +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Pritam Negi +// Github: @pritamnegi +// #include #define INF INT_MAX diff --git a/math/collatz.cpp b/math/collatz.cpp index c46b99fb..0327dff0 100644 --- a/math/collatz.cpp +++ b/math/collatz.cpp @@ -1,7 +1,14 @@ -/* Collatz sequenge -Author: Pablo Trinidad -*/ - +// +// Collatz sequenge algorithm implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/cpp/math/collatz-sequenge +// https://github.com/allalgorithms/cpp +// +// Contributed by: Pablo Trinidad +// Github: @pablotrinidad +// #include using namespace std; diff --git a/math/euclids_gcd.cpp b/math/euclids_gcd.cpp new file mode 100644 index 00000000..1241b00b --- /dev/null +++ b/math/euclids_gcd.cpp @@ -0,0 +1,31 @@ +// +// C++ program to demonstrate Basic Euclidean Algorithm +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Bharat Reddy +// Github: @Bharat-Reddy +// +#include +using namespace std; + + +int gcd(int a, int b) +{ + if (a == 0) + return b; + return gcd(b % a, a); +} + +int main() +{ + int a,b; + cout<<"Enter 2 numbers : "; + cin>>a>>b; + int g_c_d = gcd(a,b); + cout<<"GCD is < -using namespace std; - - -int gcd(int a, int b) -{ - if (a == 0) - return b; - return gcd(b % a, a); -} - -int main() -{ - int a,b; - cout<<"Enter 2 numbers : "; - cin>>a>>b; - int g_c_d = gcd(a,b); - cout<<"GCD is < -*/ +// +// C++ program to demonstrate Factorial Algorithm +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Pablo Trinidad +// Github: @pablotrinidad +// #include using namespace std; diff --git a/math/gcd_of_array.cpp b/math/gcd_of_array.cpp index eb83a224..8211ebab 100644 --- a/math/gcd_of_array.cpp +++ b/math/gcd_of_array.cpp @@ -1,36 +1,44 @@ +// // C++ program to find GCD of an array of integers -//Author Bharat Reddy +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Bharat Reddy +// Github: @Bharat-Reddy +// +#include +using namespace std; -#include -using namespace std; - -int gcd(int a, int b) -{ - if (a == 0) - return b; - return gcd(b % a, a); -} - - -int findGCD(int arr[], int n) -{ - int result = arr[0]; - for (int i = 1; i < n; i++) - result = gcd(arr[i], result); - - return result; -} - -int main() -{ +int gcd(int a, int b) +{ + if (a == 0) + return b; + return gcd(b % a, a); +} + + +int findGCD(int arr[], int n) +{ + int result = arr[0]; + for (int i = 1; i < n; i++) + result = gcd(arr[i], result); + + return result; +} + +int main() +{ int n; cout<<"Enter size of array : "; - cin>>n; + cin>>n; int a[n]; cout<<"Enter elements of array"<>a[i]; - cout << findGCD(a, n) << endl; - return 0; -} \ No newline at end of file + cin>>a[i]; + cout << findGCD(a, n) << endl; + return 0; +} diff --git a/math/lcm_of_array.cpp b/math/lcm_of_array.cpp index a59439fb..face395d 100644 --- a/math/lcm_of_array.cpp +++ b/math/lcm_of_array.cpp @@ -1,42 +1,51 @@ +// // C++ program to find LCM of n elements -// Author Bharat Reddy - -#include -using namespace std; - -typedef long long int ll; - - -int gcd(int a, int b) -{ - if (b == 0) - return a; - return gcd(b, a % b); -} - -// Returns LCM of array elements -ll findlcm(int arr[], int n) -{ - - ll ans = arr[0]; - - for (int i = 1; i < n; i++) - ans = (((arr[i] * ans)) / - (gcd(arr[i], ans))); - - return ans; -} - -int main() -{ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Bharat Reddy +// Github: @Bharat-Reddy +// + +#include +using namespace std; + +typedef long long int ll; + + +int gcd(int a, int b) +{ + if (b == 0) + return a; + return gcd(b, a % b); +} + +// Returns LCM of array elements +ll findlcm(int arr[], int n) +{ + + ll ans = arr[0]; + + for (int i = 1; i < n; i++) + ans = (((arr[i] * ans)) / + (gcd(arr[i], ans))); + + return ans; +} + +int main() +{ int n; cout<<"Enter size of array : "; - cin>>n; + cin>>n; int a[n]; cout<<"Enter elements of array"<>a[i]; - printf("%lld\n", findlcm(a, n)); - return 0; -} \ No newline at end of file + printf("%lld\n", findlcm(a, n)); + return 0; +} diff --git a/math/lucky_numbers.cpp b/math/lucky_numbers.cpp index 1d161c63..6b74f47f 100644 --- a/math/lucky_numbers.cpp +++ b/math/lucky_numbers.cpp @@ -1,9 +1,14 @@ -/* -* Lucky Numbers Implementation in C++ -* Author: Sathwik Matsa -* Github: @sathwikmatsa -*/ - +// +// Lucky Numbers Implementation in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Sathwik Matsa +// Github: @sathwikmatsa +// #include #include #include @@ -12,7 +17,7 @@ using namespace std; // returns a vector of int containing lucky numbers in range [1,n] vector lucky_numbers(int n){ - + vector seive; // store numbers from 1 to n in the vector diff --git a/math/modular_exponentiation.cpp b/math/modular_exponentiation.cpp index 5acf9a30..c57a633d 100644 --- a/math/modular_exponentiation.cpp +++ b/math/modular_exponentiation.cpp @@ -1,9 +1,16 @@ -// modular exponentiation implemented in C++ -//Author : Rituparno Biswas - -//Given three numbers x, y and p, compute (power(x,y)) % p. where power(a,b) calculates a to power of b - - +// Modular exponentiation implemented in C++ +// Given three numbers x, y and p, compute +// (power(x,y)) % p. where power(a,b) calculates a +// to power of b +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/math +// https://github.com/allalgorithms/cpp +// +// Contributed by: Rituparno Biswas +// Github: @roopbiswas +// #include using namespace std; @@ -27,9 +34,9 @@ ll power(ll x, ll y, ll p) } } -int main() -{ - ll x = 2,y = 5, p = 13; - printf("Power is %lld", power(x, y, p)); - return 0; -} \ No newline at end of file +int main() +{ + ll x = 2,y = 5, p = 13; + printf("Power is %lld", power(x, y, p)); + return 0; +} diff --git a/searches/binary_search.cpp b/searches/binary_search.cpp index fae0d170..8c148ca7 100644 --- a/searches/binary_search.cpp +++ b/searches/binary_search.cpp @@ -1,8 +1,15 @@ +// // Binary Search implemented in C++ -// Carlos Abraham Hernandez -// algorithms.abranhe.com/searches/binary-search -// repl.it/@abranhe/Binary-Search - +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/searches/binary-search +// https://github.com/allalgorithms/cpp +// https://repl.it/@abranhe/Binary-Search +// +// Contributed by: Carlos Abraham Hernandez +// Github: @abranhe +// #include using namespace std; @@ -29,16 +36,16 @@ int main(int argc, char const *argv[]) cin >> n; cout << "Enter array elements: "; int a[n]; - + for (int i = 0; i < n; ++i) { - cin>>a[i]; + cin>>a[i]; } cout << "Enter search key: "; - cin>>key; - + cin>>key; + int res = binary_search(a, 0, n-1, key); - + if(res != -1) cout<< key << " found at index " << res << endl; else diff --git a/searches/jump_search.cpp b/searches/jump_search.cpp index 203bd78e..ae62119a 100644 --- a/searches/jump_search.cpp +++ b/searches/jump_search.cpp @@ -1,46 +1,54 @@ -// C++ program to implement Jump Search -//Author Bharat Reddy - -#include -using namespace std; - -int jumpSearch(int arr[], int x, int n) -{ - // Finding block size to be jumped - int step = sqrt(n); - - // Finding the block where element is - // present (if it is present) - int prev = 0; - while (arr[min(step, n)-1] < x) - { - prev = step; - step += sqrt(n); - if (prev >= n) - return -1; - } - - // Doing a linear search for x in block - // beginning with prev. - while (arr[prev] < x) - { - prev++; - - // If we reached next block or end of - // array, element is not present. - if (prev == min(step, n)) - return -1; - } - // If element is found - if (arr[prev] == x) - return prev; - - return -1; -} - -// Driver program to test function -int main() -{ +// +// C++ program to implement Jump Search +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/searches/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Bharat Reddy +// Github: @Bharat-Reddy +// +#include +using namespace std; + +int jumpSearch(int arr[], int x, int n) +{ + // Finding block size to be jumped + int step = sqrt(n); + + // Finding the block where element is + // present (if it is present) + int prev = 0; + while (arr[min(step, n)-1] < x) + { + prev = step; + step += sqrt(n); + if (prev >= n) + return -1; + } + + // Doing a linear search for x in block + // beginning with prev. + while (arr[prev] < x) + { + prev++; + + // If we reached next block or end of + // array, element is not present. + if (prev == min(step, n)) + return -1; + } + // If element is found + if (arr[prev] == x) + return prev; + + return -1; +} + +// Driver program to test function +int main() +{ int n,i; cout<<"Eneter size of array : "; cin>>n; @@ -52,11 +60,11 @@ int main() cout<<"Enter key to be searched : "; int key; cin>>key; - - // Find the index of 'x' using Jump Search - int index = jumpSearch(a, key, n); - - // Print the index where 'x' is located - cout << "\nNumber " << key << " is at index " << index; - return 0; -} \ No newline at end of file + + // Find the index of 'x' using Jump Search + int index = jumpSearch(a, key, n); + + // Print the index where 'x' is located + cout << "\nNumber " << key << " is at index " << index; + return 0; +} diff --git a/searches/linear_search.cpp b/searches/linear_search.cpp index 61d3ee91..8ea36504 100644 --- a/searches/linear_search.cpp +++ b/searches/linear_search.cpp @@ -1,6 +1,14 @@ -// Binary Search implemented in C++ -//Author : Bharat Reddy - +// +// C++ program to implement Linear Search +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/searches/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Bharat Reddy +// Github: @Bharat-Reddy +// #include using namespace std; @@ -32,8 +40,8 @@ int main() cout< // Swap elements @@ -28,15 +35,15 @@ void bubble_sort(int arr[], size_t n) } } -// A utility function to print an array of size n -void print_array(int arr[], int n) -{ +// A utility function to print an array of size n +void print_array(int arr[], int n) +{ for (size_t i = 0; i < n; i++) { std::cout << arr[i] << " "; } - std::cout << std::endl; -} + std::cout << std::endl; +} int main() { diff --git a/sorting/heap_sort.cpp b/sorting/heap_sort.cpp index 4c480179..02c8d580 100644 --- a/sorting/heap_sort.cpp +++ b/sorting/heap_sort.cpp @@ -1,5 +1,14 @@ +// // HeapSorted Implementation (based on CLRS Introduction to Algoithms). - +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Swapnil Rustagi +// Github: @Swapnilr1 +// #include #include using namespace std; @@ -13,11 +22,11 @@ int main() vector A = {9,4,5,6,5,3,2,10,200,1}; // Random test data cout << "UNSORTED:" << endl; for(int i=0; i& A, int low, int i, int HeapSize) @@ -64,7 +73,3 @@ void heapSort(vector& A, int low, int high) MaxHeapify(A,low, 0, HeapSize); } } - - - - diff --git a/sorting/insertion_sort.cpp b/sorting/insertion_sort.cpp index b6cec71d..18a32d78 100644 --- a/sorting/insertion_sort.cpp +++ b/sorting/insertion_sort.cpp @@ -1,53 +1,59 @@ +// // C++ implementation of insertion sort // -// Author: Andres Langberg - - +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Andres Langberg +// Github: Unknown +// #include /* Function to sort an array using insertion sort*/ -void insertion_sort(int arr[], int n) -{ +void insertion_sort(int arr[], int n) +{ int key; size_t j; - for (size_t i = 1; i < n; i++) - { - key = arr[i]; - j = i - 1; - - /* Move elements of arr[0..i-1], that are - greater than key, to one position ahead + for (size_t i = 1; i < n; i++) + { + key = arr[i]; + j = i - 1; + + /* Move elements of arr[0..i-1], that are + greater than key, to one position ahead of their current position */ - while (j >= 0 && arr[j] > key) - { - arr[j + 1] = arr[j]; - j--; - } - arr[j + 1] = key; - } -} - -// A utility function to print an array of size n -void print_array(int arr[], int n) -{ + while (j >= 0 && arr[j] > key) + { + arr[j + 1] = arr[j]; + j--; + } + arr[j + 1] = key; + } +} + +// A utility function to print an array of size n +void print_array(int arr[], int n) +{ for (size_t i = 0; i < n; i++) { std::cout << arr[i] << " "; } - std::cout << std::endl; -} - - - + std::cout << std::endl; +} + + + /* Driver program to test insertion sort */ -int main() -{ - int arr[] = {12, 11, 13, 5, 6}; - size_t n = sizeof(arr) / sizeof(arr[0]); +int main() +{ + int arr[] = {12, 11, 13, 5, 6}; + size_t n = sizeof(arr) / sizeof(arr[0]); std::cout << "Unsorted array:" << std::endl; - print_array(arr, n); - insertion_sort(arr, n); + print_array(arr, n); + insertion_sort(arr, n); std::cout << "Sorted array:" << std::endl; - print_array(arr, n); - return 0; -} + print_array(arr, n); + return 0; +} diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp index 3865c2b9..a841877a 100644 --- a/sorting/merge_sort.cpp +++ b/sorting/merge_sort.cpp @@ -1,10 +1,14 @@ -//**************************************** +// // C++ implementation of merge sort // -// Author: Carlos Abraham Hernandez -// abraham@abranhe.com -//**************************************** - +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Carlos Abraham Hernandez +// Github: @abranhe (abraham@abranhe.com) +// #include // Merge the two half into a sorted data. @@ -60,7 +64,7 @@ void merge(int arr[], int l, int m, int r) k++; } delete[] L; - delete[] R; + delete[] R; } /* l is for left index and r is right index of the @@ -82,15 +86,15 @@ void merge_sort(int arr[], int l, int r) } /* UTILITY FUNCTIONS */ -// A utility function to print an array of size n -void print_array(int arr[], int n) -{ +// A utility function to print an array of size n +void print_array(int arr[], int n) +{ for (size_t i = 0; i < n; i++) { std::cout << arr[i] << " "; } - std::cout << std::endl; -} + std::cout << std::endl; +} /* Driver program to test above functions */ int main() diff --git a/sorting/quick_sort.cpp b/sorting/quick_sort.cpp index 91407403..4e97d86b 100644 --- a/sorting/quick_sort.cpp +++ b/sorting/quick_sort.cpp @@ -1,3 +1,14 @@ +// +// C++ implementation of quick sort +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Nikunj Taneja +// Github: @underscoreorcus +// #include #include @@ -9,7 +20,7 @@ void quick_sort(std::vector& arr, size_t start, size_t end) if(start < end) { int pivot = partition(arr, start, end); - quick_sort(arr, start, pivot); + quick_sort(arr, start, pivot); quick_sort(arr, pivot + 1, end); } } @@ -21,7 +32,7 @@ int partition(std::vector& arr, size_t start, size_t end) int i = start; for(size_t j = start + 1; j < end; j++) { - if(arr[j]<=x) + if(arr[j]<=x) { i=i+1; std::swap(arr[i], arr[j]); @@ -32,14 +43,14 @@ int partition(std::vector& arr, size_t start, size_t end) } -void print_vector(std::vector& arr) -{ +void print_vector(std::vector& arr) +{ for (size_t i = 0; i < arr.size(); i++) { std::cout << arr[i] << " "; } - std::cout << std::endl; -} + std::cout << std::endl; +} int main() @@ -53,4 +64,3 @@ int main() std::cout << "Sorted array:" << std::endl; print_vector(arr); } - diff --git a/sorting/selection_sort.cpp b/sorting/selection_sort.cpp index 0ba110d0..110f7671 100644 --- a/sorting/selection_sort.cpp +++ b/sorting/selection_sort.cpp @@ -1,7 +1,14 @@ +// // C++ implementation of selection sort // -// Author: Rituparno Biswas - +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Rituparno Biswas +// Github: @roopbiswas +// #include // Swap elements diff --git a/sorting/sort_vector.cpp b/sorting/sort_vector.cpp index 9216947a..d521b02e 100644 --- a/sorting/sort_vector.cpp +++ b/sorting/sort_vector.cpp @@ -1,45 +1,55 @@ -// A C++ program to demonstrate working of sort(), -// reverse() -#include -#include -#include -#include //For accumulate operation -using namespace std; - -int main() -{ - // Initializing vector with array values - int arr[] = {10, 20, 5, 23 ,42 , 15}; - int n = sizeof(arr)/sizeof(arr[0]); - vector vect(arr, arr+n); - - cout << "Vector is: "; - for (int i=0; i +#include +#include +#include //For accumulate operation +using namespace std; + +int main() +{ + // Initializing vector with array values + int arr[] = {10, 20, 5, 23 ,42 , 15}; + int n = sizeof(arr)/sizeof(arr[0]); + vector vect(arr, arr+n); + + cout << "Vector is: "; + for (int i=0; i -#include - -/* Function prototype for string a given string using - quick sort */ -void quickSort(char *arr, int si, int ei); - -/* function to check whether two strings are anagram of - each other */ -bool areAnagram(char *str1, char *str2) -{ - // Get lenghts of both strings - int n1 = strlen(str1); - int n2 = strlen(str2); - - // If length of both strings is not same, then they - // cannot be anagram - if (n1 != n2) - return false; - - // Sort both strings - quickSort(str1, 0, n1 - 1); - quickSort(str2, 0, n2 - 1); - - // Compare sorted strings - for (int i = 0; i < n1; i++) - if (str1[i] != str2[i]) - return false; - - return true; -} - -// Following functions (exchange and partition are needed -// for quickSort) -void exchange(char *a, char *b) -{ - char temp; - temp = *a; - *a = *b; - *b = temp; -} - -int partition(char A[], int si, int ei) -{ - char x = A[ei]; - int i = (si - 1); - int j; - - for (j = si; j <= ei - 1; j++) - { - if(A[j] <= x) - { - i++; - exchange(&A[i], &A[j]); - } - } - exchange (&A[i + 1], &A[ei]); - return (i + 1); -} - -/* Implementation of Quick Sort -A[] --> Array to be sorted -si --> Starting index -ei --> Ending index -*/ -void quickSort(char A[], int si, int ei) -{ - int pi; /* Partitioning index */ - if(si < ei) - { - pi = partition(A, si, ei); - quickSort(A, si, pi - 1); - quickSort(A, pi + 1, ei); - } -} - -/* Driver program to test to print printDups*/ -int main() -{ - char str1[] = ""; //String 1 - char str2[] = ""; //String 2 - if (areAnagram(str1, str2)) - printf("The two strings are anagram of each other"); - else - printf("The two strings are not anagram of each other"); - - return 0; -} \ No newline at end of file diff --git a/strings/anagram_check.cpp b/strings/anagram_check.cpp new file mode 100644 index 00000000..f4298f34 --- /dev/null +++ b/strings/anagram_check.cpp @@ -0,0 +1,101 @@ +// +// C/C++ program to check whether two strings are anagrams +// of each other +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// + +#include +#include + +/* Function prototype for string a given string using + quick sort */ +void quickSort(char *arr, int si, int ei); + +/* function to check whether two strings are anagram of + each other */ +bool areAnagram(char *str1, char *str2) +{ + // Get lenghts of both strings + int n1 = strlen(str1); + int n2 = strlen(str2); + + // If length of both strings is not same, then they + // cannot be anagram + if (n1 != n2) + return false; + + // Sort both strings + quickSort(str1, 0, n1 - 1); + quickSort(str2, 0, n2 - 1); + + // Compare sorted strings + for (int i = 0; i < n1; i++) + if (str1[i] != str2[i]) + return false; + + return true; +} + +// Following functions (exchange and partition are needed +// for quickSort) +void exchange(char *a, char *b) +{ + char temp; + temp = *a; + *a = *b; + *b = temp; +} + +int partition(char A[], int si, int ei) +{ + char x = A[ei]; + int i = (si - 1); + int j; + + for (j = si; j <= ei - 1; j++) + { + if(A[j] <= x) + { + i++; + exchange(&A[i], &A[j]); + } + } + exchange (&A[i + 1], &A[ei]); + return (i + 1); +} + +/* Implementation of Quick Sort +A[] --> Array to be sorted +si --> Starting index +ei --> Ending index +*/ +void quickSort(char A[], int si, int ei) +{ + int pi; /* Partitioning index */ + if(si < ei) + { + pi = partition(A, si, ei); + quickSort(A, si, pi - 1); + quickSort(A, pi + 1, ei); + } +} + +/* Driver program to test to print printDups*/ +int main() +{ + char str1[] = ""; //String 1 + char str2[] = ""; //String 2 + if (areAnagram(str1, str2)) + printf("The two strings are anagram of each other"); + else + printf("The two strings are not anagram of each other"); + + return 0; +} diff --git a/strings/lexicographic-ranking.cpp b/strings/lexicographic-ranking.cpp deleted file mode 100644 index 125a2c59..00000000 --- a/strings/lexicographic-ranking.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include - -// A utility function to find factorial of n -int fact(int n) -{ - return (n <= 1)? 1 :n * fact(n-1); -} - -// A utility function to count smaller characters on right -// of arr[low] -int findSmallerInRight(char* str, int low, int high) -{ - int countRight = 0, i; - - for (i = low+1; i <= high; ++i) - if (str[i] < str[low]) - ++countRight; - - return countRight; -} - -// A function to find rank of a string in all permutations -// of characters -int findRank (char* str) -{ - int len = strlen(str); - int mul = fact(len); - int rank = 1; - int countRight; - - int i; - for (i = 0; i < len; ++i) - { - mul /= len - i; - - // count number of chars smaller than str[i] - // fron str[i+1] to str[len-1] - countRight = findSmallerInRight(str, i, len-1); - - rank += countRight * mul ; - } - - return rank; -} - -// Driver program to test above function -int main() -{ - char str[] = ""; //Enter string here - printf ("%d", findRank(str)); - return 0; -} \ No newline at end of file diff --git a/strings/lexicographic_ranking.cpp b/strings/lexicographic_ranking.cpp new file mode 100644 index 00000000..0d20da19 --- /dev/null +++ b/strings/lexicographic_ranking.cpp @@ -0,0 +1,64 @@ +// +// Lexicographic ranking algorithm Implementation +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +#include + +// A utility function to find factorial of n +int fact(int n) +{ + return (n <= 1)? 1 :n * fact(n-1); +} + +// A utility function to count smaller characters on right +// of arr[low] +int findSmallerInRight(char* str, int low, int high) +{ + int countRight = 0, i; + + for (i = low+1; i <= high; ++i) + if (str[i] < str[low]) + ++countRight; + + return countRight; +} + +// A function to find rank of a string in all permutations +// of characters +int findRank (char* str) +{ + int len = strlen(str); + int mul = fact(len); + int rank = 1; + int countRight; + + int i; + for (i = 0; i < len; ++i) + { + mul /= len - i; + + // count number of chars smaller than str[i] + // fron str[i+1] to str[len-1] + countRight = findSmallerInRight(str, i, len-1); + + rank += countRight * mul ; + } + + return rank; +} + +// Driver program to test above function +int main() +{ + char str[] = ""; //Enter string here + printf ("%d", findRank(str)); + return 0; +} diff --git a/strings/longest-palindrome-subset.cpp b/strings/longest-palindrome-subset.cpp deleted file mode 100644 index 78777e1c..00000000 --- a/strings/longest-palindrome-subset.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// A dynamic programming solution for longest palindr. -// This code is adopted from following link -// http://www.leetcode.com/2011/11/longest-palindromic-substring-part-i.html - -#include -#include - -// A utility function to print a substring str[low..high] -void printSubStr( char* str, int low, int high ) -{ - for( int i = low; i <= high; ++i ) - printf("%c", str[i]); -} - -// This function prints the longest palindrome substring -// of str[]. -// It also returns the length of the longest palindrome -int longestPalSubstr( char *str ) -{ - int n = strlen( str ); // get length of input string - - // table[i][j] will be false if substring str[i..j] - // is not palindrome. - // Else table[i][j] will be true - bool table[n][n]; - memset(table, 0, sizeof(table)); - - // All substrings of length 1 are palindromes - int maxLength = 1; - for (int i = 0; i < n; ++i) - table[i][i] = true; - - // check for sub-string of length 2. - int start = 0; - for (int i = 0; i < n-1; ++i) - { - if (str[i] == str[i+1]) - { - table[i][i+1] = true; - start = i; - maxLength = 2; - } - } - - // Check for lengths greater than 2. k is length - // of substring - for (int k = 3; k <= n; ++k) - { - // Fix the starting index - for (int i = 0; i < n-k+1 ; ++i) - { - // Get the ending index of substring from - // starting index i and length k - int j = i + k - 1; - - // checking for sub-string from ith index to - // jth index iff str[i+1] to str[j-1] is a - // palindrome - if (table[i+1][j-1] && str[i] == str[j]) - { - table[i][j] = true; - - if (k > maxLength) - { - start = i; - maxLength = k; - } - } - } - } - - printf("Longest palindrome substring is: "); - printSubStr( str, start, start + maxLength - 1 ); - - return maxLength; // return length of LPS -} - -// Driver program to test above functions -int main() -{ - char str[] = ""; //Enter string here - printf("\nLength is: %d\n", longestPalSubstr( str ) ); - return 0; -} \ No newline at end of file diff --git a/strings/longest_palindrome_subset.cpp b/strings/longest_palindrome_subset.cpp new file mode 100644 index 00000000..6d47333e --- /dev/null +++ b/strings/longest_palindrome_subset.cpp @@ -0,0 +1,94 @@ +// +// A dynamic programming solution for longest palindr. +// This code is adopted from following link +// http://www.leetcode.com/2011/11/longest-palindromic-substring-part-i.html +// +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +#include + +// A utility function to print a substring str[low..high] +void printSubStr( char* str, int low, int high ) +{ + for( int i = low; i <= high; ++i ) + printf("%c", str[i]); +} + +// This function prints the longest palindrome substring +// of str[]. +// It also returns the length of the longest palindrome +int longestPalSubstr( char *str ) +{ + int n = strlen( str ); // get length of input string + + // table[i][j] will be false if substring str[i..j] + // is not palindrome. + // Else table[i][j] will be true + bool table[n][n]; + memset(table, 0, sizeof(table)); + + // All substrings of length 1 are palindromes + int maxLength = 1; + for (int i = 0; i < n; ++i) + table[i][i] = true; + + // check for sub-string of length 2. + int start = 0; + for (int i = 0; i < n-1; ++i) + { + if (str[i] == str[i+1]) + { + table[i][i+1] = true; + start = i; + maxLength = 2; + } + } + + // Check for lengths greater than 2. k is length + // of substring + for (int k = 3; k <= n; ++k) + { + // Fix the starting index + for (int i = 0; i < n-k+1 ; ++i) + { + // Get the ending index of substring from + // starting index i and length k + int j = i + k - 1; + + // checking for sub-string from ith index to + // jth index iff str[i+1] to str[j-1] is a + // palindrome + if (table[i+1][j-1] && str[i] == str[j]) + { + table[i][j] = true; + + if (k > maxLength) + { + start = i; + maxLength = k; + } + } + } + } + + printf("Longest palindrome substring is: "); + printSubStr( str, start, start + maxLength - 1 ); + + return maxLength; // return length of LPS +} + +// Driver program to test above functions +int main() +{ + char str[] = ""; //Enter string here + printf("\nLength is: %d\n", longestPalSubstr( str ) ); + return 0; +} diff --git a/strings/naive-search.cpp b/strings/naive-search.cpp deleted file mode 100644 index 0f00e1fe..00000000 --- a/strings/naive-search.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* C program for A modified Naive Pattern Searching - algorithm that is optimized for the cases when all - characters of pattern are different */ -#include -#include - -/* A modified Naive Pettern Searching algorithn that is optimized - for the cases when all characters of pattern are different */ -void search(char pat[], char txt[]) -{ - int M = strlen(pat); - int N = strlen(txt); - int i = 0; - - while (i <= N - M) - { - int j; - - /* For current index i, check for pattern match */ - for (j = 0; j < M; j++) - if (txt[i+j] != pat[j]) - break; - - if (j == M) // if pat[0...M-1] = txt[i, i+1, ...i+M-1] - { - printf("Pattern found at index %d \n", i); - i = i + M; - } - else if (j == 0) - i = i + 1; - else - i = i + j; // slide the pattern by j - } -} - -/* Driver program to test above function */ -int main() -{ - char txt[] = ""; //Enter the entire string here - char pat[] = ""; //Enter the string to be searched here - search(pat, txt); - return 0; -} \ No newline at end of file diff --git a/strings/naive_search.cpp b/strings/naive_search.cpp new file mode 100644 index 00000000..ecb376e1 --- /dev/null +++ b/strings/naive_search.cpp @@ -0,0 +1,53 @@ +// +// C program for A modified Naive Pattern Searching +// algorithm that is optimized for the cases when all +// characters of pattern are different +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +#include + +/* A modified Naive Pettern Searching algorithn that is optimized + for the cases when all characters of pattern are different */ +void search(char pat[], char txt[]) +{ + int M = strlen(pat); + int N = strlen(txt); + int i = 0; + + while (i <= N - M) + { + int j; + + /* For current index i, check for pattern match */ + for (j = 0; j < M; j++) + if (txt[i+j] != pat[j]) + break; + + if (j == M) // if pat[0...M-1] = txt[i, i+1, ...i+M-1] + { + printf("Pattern found at index %d \n", i); + i = i + M; + } + else if (j == 0) + i = i + 1; + else + i = i + j; // slide the pattern by j + } +} + +/* Driver program to test above function */ +int main() +{ + char txt[] = ""; //Enter the entire string here + char pat[] = ""; //Enter the string to be searched here + search(pat, txt); + return 0; +} diff --git a/strings/permutations-of-string.cpp b/strings/permutations-of-string.cpp deleted file mode 100644 index b49aa044..00000000 --- a/strings/permutations-of-string.cpp +++ /dev/null @@ -1,71 +0,0 @@ -# C program to print all permutations with repetition -# of characters -#include -#include -#include - -/* Following function is used by the library qsort() function - to sort an array of chars */ -int compare (const void * a, const void * b); - -/* The main function that recursively prints all repeated - permutations of the given string. It uses data[] to store all - permutations one by one */ -void allLexicographicRecur (char *str, char* data, int last, int index) -{ - int i, len = strlen(str); - - // One by one fix all characters at the given index and recur for - // the/ subsequent indexes - for ( i=0; i +#include +#include + +/* Following function is used by the library qsort() function + to sort an array of chars */ +int compare (const void * a, const void * b); + +/* The main function that recursively prints all repeated + permutations of the given string. It uses data[] to store all + permutations one by one */ +void allLexicographicRecur (char *str, char* data, int last, int index) +{ + int i, len = strlen(str); + + // One by one fix all characters at the given index and recur for + // the/ subsequent indexes + for ( i=0; i -# include -# define NO_OF_CHARS 256 - -/* Fills count array with frequency of characters */ -void fillCharCounts(char *str, int *count) -{ - int i; - for (i = 0; *(str+i); i++) - count[*(str+i)]++; -} - -/* Print duplicates present in the passed string */ -void printDups(char *str) -{ - // Create an array of size 256 and fill count of every character in it - int *count = (int *)calloc(NO_OF_CHARS, sizeof(int)); - fillCharCounts(str, count); - - // Print characters having count more than 0 - int i; - for (i = 0; i < NO_OF_CHARS; i++) - if(count[i] > 1) - printf("%c, count = %d \n", i, count[i]); - - free(count); -} - -/* Driver program to test to pront printDups*/ -int main() -{ - char str[] = ""; //Enter string here - printDups(str); - getchar(); - return 0; -} \ No newline at end of file diff --git a/strings/print_duplicate_string.cpp b/strings/print_duplicate_string.cpp new file mode 100644 index 00000000..a39030c9 --- /dev/null +++ b/strings/print_duplicate_string.cpp @@ -0,0 +1,47 @@ +// +// C++ program to count all duplicates from string using hashing +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +# include +# include +# define NO_OF_CHARS 256 + +/* Fills count array with frequency of characters */ +void fillCharCounts(char *str, int *count) +{ + int i; + for (i = 0; *(str+i); i++) + count[*(str+i)]++; +} + +/* Print duplicates present in the passed string */ +void printDups(char *str) +{ + // Create an array of size 256 and fill count of every character in it + int *count = (int *)calloc(NO_OF_CHARS, sizeof(int)); + fillCharCounts(str, count); + + // Print characters having count more than 0 + int i; + for (i = 0; i < NO_OF_CHARS; i++) + if(count[i] > 1) + printf("%c, count = %d \n", i, count[i]); + + free(count); +} + +/* Driver program to test to pront printDups*/ +int main() +{ + char str[] = ""; //Enter string here + printDups(str); + getchar(); + return 0; +} diff --git a/strings/rabin-karp.cpp b/strings/rabin-karp.cpp deleted file mode 100644 index e0c36ef6..00000000 --- a/strings/rabin-karp.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* Following program is a C implementation of Rabin Karp -Algorithm given in the CLRS book */ -#include -#include - -// d is the number of characters in the input alphabet -#define d 256 - -/* pat -> pattern - txt -> text - q -> A prime number -*/ -void search(char pat[], char txt[], int q) -{ - int M = strlen(pat); - int N = strlen(txt); - int i, j; - int p = 0; // hash value for pattern - int t = 0; // hash value for txt - int h = 1; - - // The value of h would be "pow(d, M-1)%q" - for (i = 0; i < M-1; i++) - h = (h*d)%q; - - // Calculate the hash value of pattern and first - // window of text - for (i = 0; i < M; i++) - { - p = (d*p + pat[i])%q; - t = (d*t + txt[i])%q; - } - - // Slide the pattern over text one by one - for (i = 0; i <= N - M; i++) - { - - // Check the hash values of current window of text - // and pattern. If the hash values match then only - // check for characters on by one - if ( p == t ) - { - /* Check for characters one by one */ - for (j = 0; j < M; j++) - { - if (txt[i+j] != pat[j]) - break; - } - - // if p == t and pat[0...M-1] = txt[i, i+1, ...i+M-1] - if (j == M) - printf("Pattern found at index %d \n", i); - } - - // Calculate hash value for next window of text: Remove - // leading digit, add trailing digit - if ( i < N-M ) - { - t = (d*(t - txt[i]*h) + txt[i+M])%q; - - // We might get negative value of t, converting it - // to positive - if (t < 0) - t = (t + q); - } - } -} - -/* Driver program to test above function */ -int main() -{ - char txt[] = ""; //Enter the entire text here - char pat[] = ""; //Enter the string to be searched here - int q = 101; // A prime number - search(pat, txt, q); - return 0; -} \ No newline at end of file diff --git a/strings/rabin_karp.cpp b/strings/rabin_karp.cpp new file mode 100644 index 00000000..48d1a937 --- /dev/null +++ b/strings/rabin_karp.cpp @@ -0,0 +1,87 @@ +// +// Following program is a C implementation of Rabin Karp +// Algorithm given in the CLRS book +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +#include + +// d is the number of characters in the input alphabet +#define d 256 + +/* pat -> pattern + txt -> text + q -> A prime number +*/ +void search(char pat[], char txt[], int q) +{ + int M = strlen(pat); + int N = strlen(txt); + int i, j; + int p = 0; // hash value for pattern + int t = 0; // hash value for txt + int h = 1; + + // The value of h would be "pow(d, M-1)%q" + for (i = 0; i < M-1; i++) + h = (h*d)%q; + + // Calculate the hash value of pattern and first + // window of text + for (i = 0; i < M; i++) + { + p = (d*p + pat[i])%q; + t = (d*t + txt[i])%q; + } + + // Slide the pattern over text one by one + for (i = 0; i <= N - M; i++) + { + + // Check the hash values of current window of text + // and pattern. If the hash values match then only + // check for characters on by one + if ( p == t ) + { + /* Check for characters one by one */ + for (j = 0; j < M; j++) + { + if (txt[i+j] != pat[j]) + break; + } + + // if p == t and pat[0...M-1] = txt[i, i+1, ...i+M-1] + if (j == M) + printf("Pattern found at index %d \n", i); + } + + // Calculate hash value for next window of text: Remove + // leading digit, add trailing digit + if ( i < N-M ) + { + t = (d*(t - txt[i]*h) + txt[i+M])%q; + + // We might get negative value of t, converting it + // to positive + if (t < 0) + t = (t + q); + } + } +} + +/* Driver program to test above function */ +int main() +{ + char txt[] = ""; //Enter the entire text here + char pat[] = ""; //Enter the string to be searched here + int q = 101; // A prime number + search(pat, txt, q); + return 0; +} diff --git a/strings/remove-adjacent-duplicates.cpp b/strings/remove-adjacent-duplicates.cpp deleted file mode 100644 index 766e5568..00000000 --- a/strings/remove-adjacent-duplicates.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// C/C++ program to remove all adjacent duplicates from a string -#include -#include -using namespace std; - -// Recursively removes adjacent duplicates from str and returns -// new string. las_removed is a pointer to last_removed character -char* removeUtil(char *str, char *last_removed) -{ - // If length of string is 1 or 0 - if (str[0] == '\0' || str[1] == '\0') - return str; - - // Remove leftmost same characters and recur for remaining - // string - if (str[0] == str[1]) - { - *last_removed = str[0]; - while (str[1] && str[0] == str[1]) - str++; - str++; - return removeUtil(str, last_removed); - } - - // At this point, the first character is definiotely different - // from its adjacent. Ignore first character and recursively - // remove characters from remaining string - char* rem_str = removeUtil(str+1, last_removed); - - // Check if the first character of the rem_string matches with - // the first character of the original string - if (rem_str[0] && rem_str[0] == str[0]) - { - *last_removed = str[0]; - return (rem_str+1); // Remove first character - } - - // If remaining string becomes empty and last removed character - // is same as first character of original string. This is needed - // for a string like "acbbcddc" - if (rem_str[0] == '\0' && *last_removed == str[0]) - return rem_str; - - // If the two first characters of str and rem_str don't match, - // append first character of str before the first character of - // rem_str. - rem_str--; - rem_str[0] = str[0]; - return rem_str; -} - -char *remove(char *str) -{ - char last_removed = '\0'; - return removeUtil(str, &last_removed); -} - -// Driver program to test above functions -int main() -{ - char str1[] = ""; //Enter string - cout << remove(str1) << endl; - - return 0; -} \ No newline at end of file diff --git a/strings/remove-duplicates-O(n2).cpp b/strings/remove-duplicates-O(n2).cpp deleted file mode 100644 index 5e798f56..00000000 --- a/strings/remove-duplicates-O(n2).cpp +++ /dev/null @@ -1,37 +0,0 @@ -// CPP program to remove duplicate character -// from character array and print in sorted -// order -#include -using namespace std; - -char *removeDuplicate(char str[], int n) -{ - // Used as index in the modified string - int index = 0; - - // Traverse through all characters - for (int i=0; i -using namespace std; - -char *removeDuplicate(char str[], int n) -{ - // create a set using string characters - // excluding '\0' - sets (str, str+n-1); - - // print content of the set - int i = 0; - for (auto x : s) - str[i++] = x; - str[i] = '\0'; - - return str; -} - -// Driver code -int main() -{ - char str[]= ""; //Enter string here - int n = sizeof(str) / sizeof(str[0]); - cout << removeDuplicate(str, n); - return 0; -} \ No newline at end of file diff --git a/strings/remove_adjacent_duplicates.cpp b/strings/remove_adjacent_duplicates.cpp new file mode 100644 index 00000000..967e531b --- /dev/null +++ b/strings/remove_adjacent_duplicates.cpp @@ -0,0 +1,75 @@ +// +// C/C++ program to remove all adjacent duplicates from a string +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +#include +using namespace std; + +// Recursively removes adjacent duplicates from str and returns +// new string. las_removed is a pointer to last_removed character +char* removeUtil(char *str, char *last_removed) +{ + // If length of string is 1 or 0 + if (str[0] == '\0' || str[1] == '\0') + return str; + + // Remove leftmost same characters and recur for remaining + // string + if (str[0] == str[1]) + { + *last_removed = str[0]; + while (str[1] && str[0] == str[1]) + str++; + str++; + return removeUtil(str, last_removed); + } + + // At this point, the first character is definiotely different + // from its adjacent. Ignore first character and recursively + // remove characters from remaining string + char* rem_str = removeUtil(str+1, last_removed); + + // Check if the first character of the rem_string matches with + // the first character of the original string + if (rem_str[0] && rem_str[0] == str[0]) + { + *last_removed = str[0]; + return (rem_str+1); // Remove first character + } + + // If remaining string becomes empty and last removed character + // is same as first character of original string. This is needed + // for a string like "acbbcddc" + if (rem_str[0] == '\0' && *last_removed == str[0]) + return rem_str; + + // If the two first characters of str and rem_str don't match, + // append first character of str before the first character of + // rem_str. + rem_str--; + rem_str[0] = str[0]; + return rem_str; +} + +char *remove(char *str) +{ + char last_removed = '\0'; + return removeUtil(str, &last_removed); +} + +// Driver program to test above functions +int main() +{ + char str1[] = ""; //Enter string + cout << remove(str1) << endl; + + return 0; +} diff --git a/strings/remove_duplicates.cpp b/strings/remove_duplicates.cpp new file mode 100644 index 00000000..46da1cae --- /dev/null +++ b/strings/remove_duplicates.cpp @@ -0,0 +1,47 @@ +// +// CPP program to remove duplicate character +// from character array and print in sorted +// order +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include +using namespace std; + +char *removeDuplicate(char str[], int n) +{ + // Used as index in the modified string + int index = 0; + + // Traverse through all characters + for (int i=0; i - -/* function prototype for utility function to - reverse a string from begin to end */ -void reverse(char* begin, char* end); - -/*Function to reverse words*/ -void reverseWords(char* s) -{ - char* word_begin = s; - char* temp = s; /* temp is for word boundry */ - - /*STEP 1 of the above algorithm */ - while (*temp) { - temp++; - if (*temp == '\0') { - reverse(word_begin, temp - 1); - } - else if (*temp == ' ') { - reverse(word_begin, temp - 1); - word_begin = temp + 1; - } - } /* End of while */ - - /*STEP 2 of the above algorithm */ - reverse(s, temp - 1); -} - -/* UTILITY FUNCTIONS */ -/*Function to reverse any sequence starting with pointer - begin and ending with pointer end */ -void reverse(char* begin, char* end) -{ - char temp; - while (begin < end) { - temp = *begin; - *begin++ = *end; - *end-- = temp; - } -} - -/* Driver function to test above functions */ -int main() -{ - char s[] = ""; //Enter string here - char* temp = s; - reverseWords(s); - printf("%s", s); - getchar(); - return 0; -} \ No newline at end of file diff --git a/strings/reverse_string.cpp b/strings/reverse_string.cpp new file mode 100644 index 00000000..598b8da6 --- /dev/null +++ b/strings/reverse_string.cpp @@ -0,0 +1,62 @@ +// +// Reverse String in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Tushar Kanakagiri +// Github: @tusharkanakagiri +// +#include + +/* function prototype for utility function to + reverse a string from begin to end */ +void reverse(char* begin, char* end); + +/*Function to reverse words*/ +void reverseWords(char* s) +{ + char* word_begin = s; + char* temp = s; /* temp is for word boundry */ + + /*STEP 1 of the above algorithm */ + while (*temp) { + temp++; + if (*temp == '\0') { + reverse(word_begin, temp - 1); + } + else if (*temp == ' ') { + reverse(word_begin, temp - 1); + word_begin = temp + 1; + } + } /* End of while */ + + /*STEP 2 of the above algorithm */ + reverse(s, temp - 1); +} + +/* UTILITY FUNCTIONS */ +/*Function to reverse any sequence starting with pointer + begin and ending with pointer end */ +void reverse(char* begin, char* end) +{ + char temp; + while (begin < end) { + temp = *begin; + *begin++ = *end; + *end-- = temp; + } +} + +/* Driver function to test above functions */ +int main() +{ + char s[] = ""; //Enter string here + char* temp = s; + reverseWords(s); + printf("%s", s); + getchar(); + return 0; +} From a609eabbeef02f45b3f0c216712547fd1301d8ca Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 10 Oct 2018 12:33:04 -0400 Subject: [PATCH 079/285] little broken link fix --- .github/contributing.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/contributing.md b/.github/contributing.md index 4ba1d04a..fc608f0b 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -5,8 +5,8 @@ ## See - [General Rules](#general-rules) -- [All ▲lgorithms Structure](#all-▲lgorithms-structure) -- [Adding new algorithms](adding-new-algorithms) +- [All ▲lgorithms Structure](#all-lgorithms-structure) +- [Adding new algorithms](#adding-new-algorithms) - [Style](#style) - [Adding Documentation](#adding-documentation) - [Run it online](#run-it-online) @@ -31,9 +31,8 @@ │ │── binary_search.cpp │ └── linear_search.cpp └── math - ├── third-algorithm - ├── third_algorithm.js - └── fourth_algorithm.js + ├── third-algorithm.cpp + └── fourth_algorithm.cpp ``` ### Adding new algorithms From 6b26b2bcf31c7600d384b9a354d88021010b1472 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 10 Oct 2018 18:45:29 -0400 Subject: [PATCH 080/285] lower case for readme --- README.md => readme.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => readme.md (100%) diff --git a/README.md b/readme.md similarity index 100% rename from README.md rename to readme.md From 25485c50ac31eaba4d5dffefd6abde7fda5cda07 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 10 Oct 2018 18:45:54 -0400 Subject: [PATCH 081/285] license lower case --- LICENSE => license | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE => license (100%) diff --git a/LICENSE b/license similarity index 100% rename from LICENSE rename to license From 5e02a51e001752f8129d6105454c5ef2d5362a81 Mon Sep 17 00:00:00 2001 From: KtlTheBest Date: Thu, 11 Oct 2018 15:53:31 +0600 Subject: [PATCH 082/285] Wrote a solution for Longest Increasing Sequence, O(NlogN) --- dynamic-programming/lis.cpp | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 dynamic-programming/lis.cpp diff --git a/dynamic-programming/lis.cpp b/dynamic-programming/lis.cpp new file mode 100644 index 00000000..25839f17 --- /dev/null +++ b/dynamic-programming/lis.cpp @@ -0,0 +1,45 @@ +#include +#include + +const int INF = 2e9 + 10; + +int arraySize(int arr[]){ + return 6; +} + +void printArray(int arr[]){ + std :: cout << '['; + const int n = arraySize(arr); + for(int i = 0; i != n; ++ i){ + if(i) std :: cout << ", "; + std :: cout << arr[i]; + } + std :: cout << ']'; +} + +int LIS(int arr[]){ + const int n = arraySize(arr) + 1; + int dp[n]; + dp[0] = -INF; + for(int i = 1; i != n; ++ i){ + dp[i] = INF; + } + int pos = 0; + for(int i = 0; i != n - 1; ++ i){ + int cur = std :: upper_bound(dp, dp + n, arr[i]) - dp; + if(dp[cur] > arr[i]) dp[cur] = arr[i]; + } + for(int i = 0; i != n; ++ i){ + if(dp[i] == INF) break; + pos = i; + } + return pos; +} + +int main(){ + int array[6] = {3, 4, 5, 2, 6, 7}; + std :: cout << "The Longest Increasing sequence of "; + printArray(array); + std :: cout << " is " << LIS(array); + return 0; +} From 06b7a09594def1a37bbd9865070768c010e77200 Mon Sep 17 00:00:00 2001 From: KtlTheBest Date: Thu, 11 Oct 2018 17:38:49 +0600 Subject: [PATCH 083/285] Update lis.cpp --- dynamic-programming/lis.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/dynamic-programming/lis.cpp b/dynamic-programming/lis.cpp index 25839f17..879925b3 100644 --- a/dynamic-programming/lis.cpp +++ b/dynamic-programming/lis.cpp @@ -1,15 +1,12 @@ #include #include +#include const int INF = 2e9 + 10; -int arraySize(int arr[]){ - return 6; -} - -void printArray(int arr[]){ +void printArray(std :: vector arr){ std :: cout << '['; - const int n = arraySize(arr); + const int n = arr.size(); for(int i = 0; i != n; ++ i){ if(i) std :: cout << ", "; std :: cout << arr[i]; @@ -17,11 +14,11 @@ void printArray(int arr[]){ std :: cout << ']'; } -int LIS(int arr[]){ - const int n = arraySize(arr) + 1; +int LIS(std :: vector arr){ + const int n = arr.size() + 1; int dp[n]; dp[0] = -INF; - for(int i = 1; i != n; ++ i){ + for(int i = 1; i < n; ++ i){ dp[i] = INF; } int pos = 0; @@ -37,7 +34,7 @@ int LIS(int arr[]){ } int main(){ - int array[6] = {3, 4, 5, 2, 6, 7}; + std :: vector array = {3, 4, 5, 2, 6, 7}; std :: cout << "The Longest Increasing sequence of "; printArray(array); std :: cout << " is " << LIS(array); From c3fa3326ad0d8d96f25b97dcd090c623e0eb7d14 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 15:37:46 -0400 Subject: [PATCH 084/285] all algorithms header --- searches/ternary_search.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/searches/ternary_search.cpp b/searches/ternary_search.cpp index bdd4042d..ab6bd404 100644 --- a/searches/ternary_search.cpp +++ b/searches/ternary_search.cpp @@ -1,6 +1,16 @@ // Ternary Search implemented in C++ -//Sriram Desai - +// +// Binary search works for a sorted array. +// More documentation about the algorithm +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/cpp/category/algorithm +// https://github.com/allalgorithms/cpp +// +// Contributed by: Sriram Desai +// Github: @desai10 +// #include #include using namespace std; From e6a292ddb8529fad45db5cc1be9023cad0637e85 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 15:54:07 -0400 Subject: [PATCH 085/285] fixes on fib using golden ratio - removed - added header --- math/nth_fibonacci_using_goldenratio.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/math/nth_fibonacci_using_goldenratio.cpp b/math/nth_fibonacci_using_goldenratio.cpp index 09e676b1..f66c0761 100644 --- a/math/nth_fibonacci_using_goldenratio.cpp +++ b/math/nth_fibonacci_using_goldenratio.cpp @@ -1,6 +1,18 @@ - +// // CPP program to find n-th Fibonacci number -#include +// More documentation about the algorithm +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Mohbius +// Github: @mohbius +// +#include +#include +#include using namespace std; // Approximate value of golden ratio @@ -31,9 +43,8 @@ int fib (int n) int main() { - int fibNo; - fibNo = fib(9); //RETURNS 34 - fibNo = fib(8); //RETURNS 21 - fibNo = fib(7); //RETURNS 13 + std::cout << fib(9) << std::endl; // 34 + std::cout << fib(8) << std::endl; // 21 + std::cout << fib(7) << std::endl; // 13 return 0; } From d8091699f66dcf60f28482578d7fa429da73952c Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 16:19:06 -0400 Subject: [PATCH 086/285] added header and added snake_case style --- sorting/{Heap_sort.cpp => heap_sort.cpp} | 10 ++++++++++ 1 file changed, 10 insertions(+) rename sorting/{Heap_sort.cpp => heap_sort.cpp} (82%) diff --git a/sorting/Heap_sort.cpp b/sorting/heap_sort.cpp similarity index 82% rename from sorting/Heap_sort.cpp rename to sorting/heap_sort.cpp index 08d25508..9cf042db 100644 --- a/sorting/Heap_sort.cpp +++ b/sorting/heap_sort.cpp @@ -1,4 +1,14 @@ +// // C++ program for implementation of Heap Sort +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Kaushlendra Pratap +// Github: @kaushl1998 +// #include using namespace std; From 695123e729586cb8a1844ed12e9ece0bb35d7738 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 16:21:15 -0400 Subject: [PATCH 087/285] fixed website in comments --- .github/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/contributing.md b/.github/contributing.md index fc608f0b..def0aa77 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -73,7 +73,7 @@ Each `.cpp` file should have the following header // // The All ▲lgorithms Project // -// https://allalgorithms.com/cpp/category/algorithm +// https://allalgorithms.com/ // https://github.com/allalgorithms/cpp // // Contributed by: Carlos Abraham Hernandez From 8b947a82e79dc1d633404a8714dbaa975701bb6f Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 16:23:42 -0400 Subject: [PATCH 088/285] Rename heap_sort.cpp to heap_sort_without_vectors.cpp --- sorting/{heap_sort.cpp => heap_sort_without_vectors.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sorting/{heap_sort.cpp => heap_sort_without_vectors.cpp} (100%) diff --git a/sorting/heap_sort.cpp b/sorting/heap_sort_without_vectors.cpp similarity index 100% rename from sorting/heap_sort.cpp rename to sorting/heap_sort_without_vectors.cpp From d9927b02f6e044bfd92355163211c19678c51b8d Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 11 Oct 2018 16:31:10 -0400 Subject: [PATCH 089/285] add new algorithms on readme, change website --- readme.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c0d804c8..894d3ebf 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@

- algorithms.abranhe.com + allalgorithms.com
@@ -80,22 +80,26 @@ - [Least common multiple of array](math/lcm_of_array.cpp) - [Lucky Numbers](math/lucky_numbers.cpp) - [Modular Exponentiations](math/modular_exponentiations.cpp) +- [nth Fibonacci Number using Goldenratio](math/nth_fibonacci_using_goldenratio.cpp) ## Searches - [Binary Search](searches/binary_search.cpp) - [Jump Search](searches/jump_search.cpp) - [Linear Search](searches/linear_search.cpp) +- [Ternary Search](searches/ternary_search.cpp) ## Sorting - [Bubble Sort](sorting/bubble_sort.cpp) - [Heap Sort](sorting/heap_sort.cpp) +- [Heap Sort without vectors](sorting/heap_sort_without_vectors.cpp) - [Insertion Sort](sorting/insertion_sort.cpp) - [Merge Sort](sorting/merge_sort.cpp) - [Quick Sort](sorting/quick_sort.cpp) - [Selection Sort](sorting/selection_sort.cpp) - [Sort Vector](sorting/sort_vector.cpp) +- [Tree Sort](sorting/tree_sort.cpp) ## Strings From 751212684fd455fb8f36ebf4f6532f1bad899afd Mon Sep 17 00:00:00 2001 From: Gaurav Yadav Date: Sat, 13 Oct 2018 01:16:35 +0530 Subject: [PATCH 090/285] Signed-off-by: Gaurav Yadav fixes #97 #hacktoberfest --- data-structures/linkedlist/linkedlist_adt.cpp | 193 ++++++++++++++++++ data-structures/linkedlist/linkedlist_adt.h | 44 ++++ 2 files changed, 237 insertions(+) create mode 100644 data-structures/linkedlist/linkedlist_adt.cpp create mode 100644 data-structures/linkedlist/linkedlist_adt.h diff --git a/data-structures/linkedlist/linkedlist_adt.cpp b/data-structures/linkedlist/linkedlist_adt.cpp new file mode 100644 index 00000000..09a10f67 --- /dev/null +++ b/data-structures/linkedlist/linkedlist_adt.cpp @@ -0,0 +1,193 @@ +#include +#include +#include "linkedlist_adt.h" +using namespace std; + +/* + Constructor for Node class +*/ +Node::Node(int value) +{ + this->data = value; + this->next = NULL; +} + +/* + Constructor for LinkedList Class +*/ +LinkedList::LinkedList() +{ + this->length = 0; + this->head = NULL; +} + +/* + Destructor for LinkedList class +*/ +LinkedList::~LinkedList() +{ + Node *next_node=NULL; + for (Node *node_ptr=this->head; node_ptr != NULL; node_ptr=next_node) { + next_node = node_ptr->next; + delete node_ptr; + } +} + +/* + Returns curret size of linkedList +*/ +int LinkedList::size() const +{ + return(this->length); +} + +bool LinkedList::empty() const +{ + return(this->length == 0); +} + +/* + Prints content of Linked List +*/ +void LinkedList::print() const +{ + Node *curr = head; + while (curr != NULL) { + cout << curr->data << endl; + curr = curr->next; + } +} + +int& LinkedList::at(int index) +{ + if(index < 0 || index >= this->length) { + throw out_of_range("index out of bounds"); } + Node *node_ptr; + for (node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { + if (index == 0) { + break; + } + index--; + } + return node_ptr->data; +} + +/* + Find the node with given value +*/ +Node* LinkedList::find(int value) const { + Node *node_ptr; + for (node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { + if (value == node_ptr->data) + return node_ptr; + } + return NULL; +} + +bool LinkedList::contains(int value) const{ + Node* node_ptr = find(value); + return node_ptr != NULL; +} + +/* + Add a node at last in list +*/ +void LinkedList::append(int value) { + Node *new_node = NULL; + if (this->head == NULL) { + new_node = new Node(value); + this->head = new_node; + } + else { + Node *last_node = NULL; + for (Node *node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { + last_node = node_ptr; + } + new_node = new Node(value); + last_node->next = new_node; + } + this->length++; +} + +/* + Add a node in list from head +*/ +void LinkedList::prepend(int value) { + Node *first_node = new Node(value);; + first_node->next = this->head; + this->head = first_node; + this->length++; +} + +/* + Remove target node from linked list +*/ +void LinkedList::remove(Node* target_node_ptr) { + Node* prev_ptr=NULL; + Node *node_ptr; + for (node_ptr = this->head; node_ptr != NULL && node_ptr != target_node_ptr; node_ptr = node_ptr->next) { + prev_ptr = node_ptr; + } + if (node_ptr == NULL) { + throw target_node_ptr; + } + else if (prev_ptr == NULL) { + this->head = target_node_ptr->next; + delete target_node_ptr; + } + else { + prev_ptr->next = target_node_ptr->next; + delete target_node_ptr; + Node *prev_ptr = this->head; + } +} + +/* + Erase node at index from List +*/ +void LinkedList::erase(int index){ + if (index < 0 || index >= this->length) + throw out_of_range ("index out of bounds"); + Node *prev_ptr = NULL; + Node *node_ptr; + for (node_ptr = this->head; node_ptr != NULL; node_ptr = node_ptr->next) { + if (index == 0) + break; + index--; + prev_ptr = node_ptr; + } + if (prev_ptr == NULL) { + this->head = node_ptr->next; + delete node_ptr; + } + else { + prev_ptr->next = node_ptr->next; + delete node_ptr; + } +} +/* +int main() +{ + LinkedList* list = new LinkedList(); + cout << "Empty = " << boolalpha << list->empty() << endl; + for(int i=0; i < 6; i++) { + list->append(i); + cout << "List size = " << list->size() << endl; + list->print(); + } + for(int j=11; j > 6; j--) { + list->prepend(j); + cout << "List size = " << list->size() << endl; + list->print(); + } + cout << "Empty = " << boolalpha << list->empty() << endl; + cout << "list->at(5) = " << list->at(5) << endl; + cout << "list->at(1) = " << list->at(1) << endl; + cout << "contains(55) = " << list->contains(55) << endl; + cout << "contains(4) = " << list->contains(4) << endl; + list->erase(0); + list->print(); + list->erase(5); + list->print(); +} +*/ \ No newline at end of file diff --git a/data-structures/linkedlist/linkedlist_adt.h b/data-structures/linkedlist/linkedlist_adt.h new file mode 100644 index 00000000..0295664a --- /dev/null +++ b/data-structures/linkedlist/linkedlist_adt.h @@ -0,0 +1,44 @@ +/* + @Gaurav YadavCS-11 Asn 2, linkedlist_adt.h + Purpose: Implements Linkedlist class + + @author Gaurav Yadav + @email gauravyug@gmai.com + @version 1.1 + @date 13-Oct-18 +*/ + +#ifndef ADT_LINKEDLIST_H_ +#define ADT_LINKEDLIST_H_ + +/* + Linked List Node +*/ +class Node +{ + public: + int data; + Node* next; + public: + Node(int value); +}; + +class LinkedList +{ + private: + Node* head; + int length; + public: + LinkedList(); + ~LinkedList(); + int size() const; + bool empty() const; + void print() const; + int& at(int index); + Node* find(int value) const; + bool contains(int value) const; + void append(int value); + void prepend(int value); + void remove(Node* node_ptr); void erase(int index); +}; +#endif \ No newline at end of file From 76a2c6f97b039fb555076a82b055cd03126028d7 Mon Sep 17 00:00:00 2001 From: Anand Shekhar Date: Sat, 13 Oct 2018 01:44:36 +0530 Subject: [PATCH 091/285] Kadence Algorithm --- math/kadence.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 math/kadence.cpp diff --git a/math/kadence.cpp b/math/kadence.cpp new file mode 100644 index 00000000..edf9e85a --- /dev/null +++ b/math/kadence.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +int maxSubArraySum(int a[], int size) +{ + int max_so_far = INT_MIN, max_ending_here = 0; + + for (int i = 0; i < size; i++) + { + max_ending_here = max_ending_here + a[i]; + if (max_so_far < max_ending_here) + max_so_far = max_ending_here; + + if (max_ending_here < 0) + max_ending_here = 0; + } + return max_so_far; +} + +int main() +{ + int a[] = {-2, -3, 4, -1, -2, 1, 5, -3}; + int n = sizeof(a)/sizeof(a[0]); + int max_sum = maxSubArraySum(a, n); + cout << "Maximum contiguous sum is " << max_sum; + return 0; +} \ No newline at end of file From 81675c5f786b81620da83def5f7cea94783f37db Mon Sep 17 00:00:00 2001 From: VirtualRcoder Date: Sat, 13 Oct 2018 09:16:11 +0530 Subject: [PATCH 092/285] palindrome.cpp added to a seperate folder --- palindrome_number => palindrome/palindrome_number.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) rename palindrome_number => palindrome/palindrome_number.cpp (70%) diff --git a/palindrome_number b/palindrome/palindrome_number.cpp similarity index 70% rename from palindrome_number rename to palindrome/palindrome_number.cpp index 64841a3f..67503512 100644 --- a/palindrome_number +++ b/palindrome/palindrome_number.cpp @@ -1,3 +1,14 @@ +// +// Palindrome Checker implemented in C++ +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: SHUBHAM SHARMA +// Github: @VirtualRcoder + #include using namespace std; From e02654403ad79045f5f2bedb1ce0c0d5571ba2a3 Mon Sep 17 00:00:00 2001 From: korostenskyi Date: Sat, 13 Oct 2018 19:28:12 +0300 Subject: [PATCH 093/285] Added loop based fibonacci algorithm --- .DS_Store | Bin 0 -> 6148 bytes math/fibonacci_loop.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e2c62656d5c7ec830b911a08f9e48d3094c3ef59 GIT binary patch literal 6148 zcmeHK&2G~`5S~p#;{;G6QK>!pg2W+3>5nQZgcQ=`5D5^%2o8W+I}VAZ)Q)VYQ3*l0 z@D9Km@F<)(@*q3_e6zct*a;jFf*oo1ThD&8wm;AAdWlFh$Nnx+m53}9#$pB43gdn* zOIFaHD?lN~*r9|{ifK&UCAM)G1&jiJn*uy{H^?U!^VX%s`I}-E$JC>wGmN_4F!I3U zW#TrBD#j?3knf^Mgivi4vi2OQ6Dw?*c(zmH_FG{DC?R(qCx(SV(WKYZ<37k z(|z(r!yrlP^)I5ZR=l)cvaE_#xmtPQ45EpXy6HG+y74om(8vh#(oeb`9+Lwy9p_FQ z4x_LSKlhdB9(CxL+Vp@NYG*YUZ^2mnaz%U_{_cYu?`w`%rbig@F16@B@Ft@CY(&A$ zMOfGedKf!KJ`9#~sPH+*FM%I{ovzFk&bW6A8OLniWn^CEvxPXb7TLHowo(C|e%9rc zy~b%2Fbe$73h?@1qcAo!&K1g~1C=}i0E=)-Lz{mRIL6l4&^T9!9+*&}Kou(V5kshO z_-)N=Xq+ol;Ux6oL+CpTeL@lP?ik;ebP^4PrZx%~1+ogPsmm(w|LtF&|Fc2n$|ztI z_@@*Q#g@}*;+6E?y7Y3q*V-tjC~VA|E0iIq^mZ&8ycKVwNJF2^4PZm#Tp>I#^CKW- LFqKi@k1FsTRXNa! literal 0 HcmV?d00001 diff --git a/math/fibonacci_loop.cpp b/math/fibonacci_loop.cpp index 9f7edb9b..caadc1ae 100644 --- a/math/fibonacci_loop.cpp +++ b/math/fibonacci_loop.cpp @@ -20,4 +20,4 @@ unsigned long fibonacci(int n) { } return current; -} \ No newline at end of file +} From 8128524004a423b2f2d9ddf93960b61718954034 Mon Sep 17 00:00:00 2001 From: Alexius Adhitya K Date: Mon, 15 Oct 2018 14:37:10 +0700 Subject: [PATCH 094/285] Add TermoConv.cpp This program converts Celsius temperature into Fahrenheit, Reamur, and Kelvin temperature. --- math/TermoConv.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 math/TermoConv.cpp diff --git a/math/TermoConv.cpp b/math/TermoConv.cpp new file mode 100644 index 00000000..493a5a5e --- /dev/null +++ b/math/TermoConv.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; + +int main() +{ + float x; + // Convert temperature from Celsius to Fahrenheit, Reamur, and Kelvin + cout << "Temperature in Celsius = "; + cin >> x; + + float f,r,k; + f=1.8*x+32; + r=0.8*x; + k=273+x; + + cout << "Temperature in Fahrenheit= " << f << endl; + cout << "Temperature in Reamur = " << r << endl; + cout << "Temperature in Kelvin = " << k << endl; + + system("pause"); + return 0; +} \ No newline at end of file From 774d47904c3f6822ad0bbc8ca03736fe7adc81fe Mon Sep 17 00:00:00 2001 From: Tanya-marv Date: Tue, 16 Oct 2018 11:00:05 +0300 Subject: [PATCH 095/285] Added loop based factorial implementation --- math/euclids_gcd.cpp | 2 +- math/factorial_loop.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 math/factorial_loop.cpp diff --git a/math/euclids_gcd.cpp b/math/euclids_gcd.cpp index 1241b00b..850dbb5a 100644 --- a/math/euclids_gcd.cpp +++ b/math/euclids_gcd.cpp @@ -26,6 +26,6 @@ int main() cout<<"Enter 2 numbers : "; cin>>a>>b; int g_c_d = gcd(a,b); - cout<<"GCD is < 1; i++) { + out *= i; + } + + return out; + } From 61c6fe2eb99b0cc5bfa7be1949eec006b386f5d8 Mon Sep 17 00:00:00 2001 From: aditya dokhale Date: Wed, 17 Oct 2018 02:59:22 +0100 Subject: [PATCH 096/285] added code for sieve of eratosthenes --- math/sieveOfEratosthenes.cpp | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 math/sieveOfEratosthenes.cpp diff --git a/math/sieveOfEratosthenes.cpp b/math/sieveOfEratosthenes.cpp new file mode 100644 index 00000000..dd955121 --- /dev/null +++ b/math/sieveOfEratosthenes.cpp @@ -0,0 +1,49 @@ +// this is a program to implement sieve algorithm to generate prime numbers. + +//https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes + +#include +#define ll long long +#define pb push_back +#define endl '\n' +#define pii pair +#define vi vector +#define all(a) (a).begin(),(a).end() +#define F first +#define S second +#define hell 1000000007 +#define lbnd lower_bound +#define ubnd upper_bound +#define bs binary_search +#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); +using namespace std; +int prime[1000000]={0}; +void sieve(int n) +{ + for(int i=2;i<=n;i++) + { + if(prime[i]==0) + { + for(int j=2*i;j<=n;j+=i) + prime[j]=1; + } + } +} +int main() +{ + ios + + int x; + cin>>x; + + sieve(x); + + //now whichever i>1 has prime[i]==0 , is a prime. + + for(int i=2;i<=x;i++) + { + if(prime[i]==0) + cout< Date: Thu, 18 Oct 2018 14:41:24 +0530 Subject: [PATCH 097/285] update problem --- .../hashmaps/pairs_with_difference_K.cpp | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 data-structures/hashmaps/pairs_with_difference_K.cpp diff --git a/data-structures/hashmaps/pairs_with_difference_K.cpp b/data-structures/hashmaps/pairs_with_difference_K.cpp new file mode 100644 index 00000000..ddbcd552 --- /dev/null +++ b/data-structures/hashmaps/pairs_with_difference_K.cpp @@ -0,0 +1,48 @@ +/* + + You are given with an array of integers and an integer K. + Write a program to find and print all pairs which have difference K. + + Sample Input 1 : + 4 + 5 1 2 4 + 3 + Sample Output 1 : + 2 5 + 1 4 +*/ + + +#include +using namespace std; + + +void printPairs(int *input, int n, int k) { + + int hash[10000]; + for(int i = 0;i < n;i++) + { + for(int j = i+1; j < n;j++) + { + if((input[i] - input[j]) == k) + cout << input[j] << " " << input[i] << endl; + else if((input[j] - input[i]) == k) + cout << input[i] << " " << input[j] << endl; + } + } + +} + + +int main() { + int n; + cin >> n; + int *input = new int[n]; + for(int i = 0; i < n; i++){ + cin >> input[i]; + } + int k; + cin >> k; + printPairs(input, n, k); +} + From 875fa4904f73386bf0e1517b94c2a13dcd707da2 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 19 Oct 2018 14:55:20 -0400 Subject: [PATCH 098/285] rename it --- math/{BSHUFFLL.cpp => bshuffll.cpp} | 11 +++++++++++ 1 file changed, 11 insertions(+) rename math/{BSHUFFLL.cpp => bshuffll.cpp} (71%) diff --git a/math/BSHUFFLL.cpp b/math/bshuffll.cpp similarity index 71% rename from math/BSHUFFLL.cpp rename to math/bshuffll.cpp index 10283ca0..2de72867 100644 --- a/math/BSHUFFLL.cpp +++ b/math/bshuffll.cpp @@ -1,3 +1,14 @@ +// +// Bshuffll Implementation +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: shashank3395 +// Github: @shashank3395 +// #include #include From 562227cb9292b0aabbf91f42827e45f44dbcc66e Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 19 Oct 2018 15:03:32 -0400 Subject: [PATCH 099/285] rename all factors of a number --- ...ors_ofa_number.cpp => all_factors_of_a_number.cpp} | 11 +++++++++++ 1 file changed, 11 insertions(+) rename math/{all_factors_ofa_number.cpp => all_factors_of_a_number.cpp} (53%) diff --git a/math/all_factors_ofa_number.cpp b/math/all_factors_of_a_number.cpp similarity index 53% rename from math/all_factors_ofa_number.cpp rename to math/all_factors_of_a_number.cpp index 649c843b..c55a7e9b 100644 --- a/math/all_factors_ofa_number.cpp +++ b/math/all_factors_of_a_number.cpp @@ -1,3 +1,14 @@ +// +// All Factors of a number +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: divyanshu132 +// Github: @divyanshu132 +// #include #include using namespace std; From 0aa8240c41680da6b5f15dde86cf70c83b3c497d Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 19 Oct 2018 15:07:21 -0400 Subject: [PATCH 100/285] remove heap sort to add only radix sort --- sorting/heap_sort.cpp | 70 ------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 sorting/heap_sort.cpp diff --git a/sorting/heap_sort.cpp b/sorting/heap_sort.cpp deleted file mode 100644 index 9433aea6..00000000 --- a/sorting/heap_sort.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// C++ program for implementation of Heap Sort -#include - -using namespace std; - -// To heapify a subtree rooted with node i which is -// an index in arr[]. n is size of heap -void heapify(int arr[], int n, int i) -{ - int largest = i; // Initialize largest as root - int l = 2*i + 1; // left = 2*i + 1 - int r = 2*i + 2; // right = 2*i + 2 - - // If left child is larger than root - if (l < n && arr[l] > arr[largest]) - largest = l; - - // If right child is larger than largest so far - if (r < n && arr[r] > arr[largest]) - largest = r; - - // If largest is not root - if (largest != i) - { - swap(arr[i], arr[largest]); - - // Recursively heapify the affected sub-tree - heapify(arr, n, largest); - } -} - -// main function to do heap sort -void heapSort(int arr[], int n) -{ - // Build heap (rearrange array) - for (int i = n / 2 - 1; i >= 0; i--) - heapify(arr, n, i); - - // One by one extract an element from heap - for (int i=n-1; i>=0; i--) - { - // Move current root to end - swap(arr[0], arr[i]); - - // call max heapify on the reduced heap - heapify(arr, i, 0); - } -} - -/* A utility function to print array of size n */ -void printArray(int arr[], int n) -{ - for (int i=0; i Date: Fri, 19 Oct 2018 15:28:54 -0400 Subject: [PATCH 101/285] fix broken imgs links on readme --- readme.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 894d3ebf..423c337c 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,24 @@
- +

+
+
+ +
+
+
+
+



All ▲lgorithms implemented in C++

- - - - + + + +

allalgorithms.com @@ -116,9 +124,9 @@ ## License -This work is licensed under a [MIT License](https://github.com/abranhe/algorithms/blob/master/LICENSE) +This work is released under [MIT License](https://github.com/abranhe/algorithms/blob/master/liceense) -[![MIT IMG](https://cdn.abraham.gq/projects/algorithms/mit-license.png)](https://github.com/abranhe/algorithms/blob/master/LICENSE) +[![MIT IMG](https://cdn.abranhe.com/projects/algorithms/mit-license.png)](https://github.com/abranhe/algorithms/blob/master/license) To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. From fcc772bc73c3661aaef58d1b4658708568266daf Mon Sep 17 00:00:00 2001 From: Kavya <32064926+kavya98527@users.noreply.github.com> Date: Fri, 26 Oct 2018 15:30:41 +0530 Subject: [PATCH 102/285] Create counting_sort.cpp --- sorting/counting_sort.cpp | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sorting/counting_sort.cpp diff --git a/sorting/counting_sort.cpp b/sorting/counting_sort.cpp new file mode 100644 index 00000000..b869b69e --- /dev/null +++ b/sorting/counting_sort.cpp @@ -0,0 +1,57 @@ +#include + +using namespace std; + +// A function implementing Counter sort. +void CounterSort(int a[], int n, int r, int lower) +{ + int i, j = 0, counter[r] = {0}; + // Counting the number occurrence of each element. + for(i=0; i 0) + goto flag; + + i++; + } +} + +int main() +{ + int n, i, range, ulimit, llimit; + cout<<"\nEnter the number of data element to be sorted: "; + cin>>n; + + cout<<"\nEnter the lower and upper limit of the data to be entered: "; + cin>>llimit>>ulimit; + + // Range of the input data. + range = ulimit-llimit+1; + + int arr[n]; + for(i = 0; i < n; i++) + { + cout<<"Enter element "<>arr[i]; + } + + CounterSort(arr, n, range, llimit); + + // Printing the sorted data. + cout<<"\nSorted Data "; + for (i = 0; i < n; i++) + cout<<"->"< Date: Sat, 27 Oct 2018 18:53:34 +0530 Subject: [PATCH 103/285] Added Topological Sort --- graphs/toposort.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 graphs/toposort.cpp diff --git a/graphs/toposort.cpp b/graphs/toposort.cpp new file mode 100644 index 00000000..fea37a09 --- /dev/null +++ b/graphs/toposort.cpp @@ -0,0 +1,45 @@ +#include +using namespace std; +vector adj[10001]; +priority_queue,greater >q; +queuea; +bool visited[10001]; +int indegree[10001]; +int main() +{ + int n,m,u,v; + scanf("%d%d",&n,&m); + while(m--) + { + scanf("%d%d",&u,&v); + adj[u].push_back(v); + indegree[v]++; + } + for(int i=1;i<=n;i++) + if(!indegree[i]) + q.push(i); + int k=0; + while(!q.empty()) + { + int u=q.top(); + q.pop(); + a.push(u); + for(auto it:adj[u]) + { + indegree[it]--; + if(!indegree[it]) + q.push(it); + } + ++k; + } + if(k!=n) + printf("Sandro fails."); + else + { + while(!a.empty()) + { + printf("%d ",a.front()); + a.pop(); + } + } +} From a0c8485e46aeb9b9f4e67a934cfcc0a30c2c4e4b Mon Sep 17 00:00:00 2001 From: ajjuthekaal <44533038+ajjuthekaal@users.noreply.github.com> Date: Sun, 28 Oct 2018 12:44:14 +0530 Subject: [PATCH 104/285] Create Kosaraju_ALgorithm --- graphs/KosarajuALgorithm/Kosaraju_ALgorithm | 91 +++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 graphs/KosarajuALgorithm/Kosaraju_ALgorithm diff --git a/graphs/KosarajuALgorithm/Kosaraju_ALgorithm b/graphs/KosarajuALgorithm/Kosaraju_ALgorithm new file mode 100644 index 00000000..11699709 --- /dev/null +++ b/graphs/KosarajuALgorithm/Kosaraju_ALgorithm @@ -0,0 +1,91 @@ +#include +#include + +#define MAX_DEGREE 5 +#define MAX_NUM_VERTICES 20 + +struct vertices_s { + int visited; + int deg; + int adj[MAX_DEGREE]; /* < 0 if incoming edge */ +} vertices[] = { + {0, 3, {2, -3, 4}}, + {0, 2, {-1, 3}}, + {0, 3, {1, -2, 7}}, + {0, 3, {-1, -5, 6}}, + {0, 2, {4, -7}}, + {0, 3, {-4, 7, -8}}, + {0, 4, {-3, 5, -6, -12}}, + {0, 3, {6, -9, 11}}, + {0, 2, {8, -10}}, + {0, 3, {9, -11, -12}}, + {0, 3, {-8, 10, 12}}, + {0, 3, {7, 10, -11}} +}; +int num_vertices = sizeof(vertices) / sizeof(vertices[0]); + +struct stack_s { + int top; + int items[MAX_NUM_VERTICES]; +} stack = {-1, {}}; + +void stack_push(int v) { + stack.top++; + if (stack.top < MAX_NUM_VERTICES) + stack.items[stack.top] = v; + else { + printf("Stack is full!\n"); + exit(1); + } +} + +int stack_pop() { + return stack.top < 0 ? -1 : stack.items[stack.top--]; +} + +void dfs(int v, int transpose) { + int i, c, n; + vertices[v].visited = 1; + for (i = 0, c = vertices[v].deg; i < c; ++i) { + n = vertices[v].adj[i] * transpose; + if (n > 0) + /* n - 1 because vertex indexing begins at 0 */ + if (!vertices[n - 1].visited) + dfs(n - 1, transpose); + } + if (transpose < 0) + stack_push(v); + else + printf("%d ", v + 1); +} + +void reset_visited() { + int i; + for (i = 0; i < num_vertices; ++i) + vertices[i].visited = 0; +} + +void order_pass() { + int i; + for (i = 0; i < num_vertices; ++i) + if (!vertices[i].visited) + dfs(i, -1); +} + +void scc_pass() { + int i = 0, v; + while((v = stack_pop()) != -1) { + if (!vertices[v].visited) { + printf("scc %d: ", ++i); + dfs(v, 1); + printf("\n"); + } + } +} + +int main(void) { + order_pass(); + reset_visited(); + scc_pass(); + return 0; +} From b1c7da15d1ea95fad84e1140e01ff966adf1d75d Mon Sep 17 00:00:00 2001 From: shradha27 Date: Wed, 31 Oct 2018 17:45:51 +0530 Subject: [PATCH 105/285] Add shell sort algorithm --- sorting/shell_sort.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sorting/shell_sort.cpp diff --git a/sorting/shell_sort.cpp b/sorting/shell_sort.cpp new file mode 100644 index 00000000..02ffa2cf --- /dev/null +++ b/sorting/shell_sort.cpp @@ -0,0 +1,62 @@ +// +// C++ implementation of shell sort +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/sorting +// https://github.com/allalgorithms/cpp +// +// Contributed by: Shradha Sharma +// Github: @shradha27 +// +#include + +using namespace std; + +// A function implementing Shell sort. +void ShellSort(int a[], int n) +{ + int i, j, k, temp; + // Gap 'i' between index of the element to be compared, initially n/2. + for(i = n/2; i > 0; i = i/2) + { + for(j = i; j < n; j++) + { + for(k = j-i; k >= 0; k = k-i) + { + // If value at higher index is greater, then break the loop. + if(a[k+i] >= a[k]) + break; + // Switch the values otherwise. + else + { + temp = a[k]; + a[k] = a[k+i]; + a[k+i] = temp; + } + } + } + } +} +int main() +{ + int n, i; + cout<<"\nEnter the number of data element to be sorted: "; + cin>>n; + + int arr[n]; + for(i = 0; i < n; i++) + { + cout<<"Enter element "<>arr[i]; + } + + ShellSort(arr, n); + + // Printing the sorted data. + cout<<"\nSorted Data "; + for (i = 0; i < n; i++) + cout<<"->"< Date: Fri, 2 Nov 2018 14:38:01 -0400 Subject: [PATCH 106/285] logos by `programming-languages-logos` cdn --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 423c337c..5501e373 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@


- +


From 3d47f0a14642fbd85cc26004fdce7d0d42df2325 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Mon, 31 Dec 2018 02:16:25 -0500 Subject: [PATCH 107/285] Create crossword_puzzle.cpp --- backtracking/crossword_puzzle.cpp | 171 ++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 backtracking/crossword_puzzle.cpp diff --git a/backtracking/crossword_puzzle.cpp b/backtracking/crossword_puzzle.cpp new file mode 100644 index 00000000..d8c200d1 --- /dev/null +++ b/backtracking/crossword_puzzle.cpp @@ -0,0 +1,171 @@ +#include +using namespace std; + +// ways are to calculate the number of +// possible ways to fill the grid +int ways = 0; + +// this function is used to print +// the resultant matrix +void printMatrix(vector& matrix, int n) +{ + for (int i = 0; i < n; i++) + cout << matrix[i] << endl; +} + +// this function checks for the current word +// if it can be placed horizontally or not +// x -> it represent index of row +// y -> it represent index of column +// currentWord -> it represent the +// current word in word array +vector checkHorizontal(int x, int y, + vector matrix, + string currentWord) +{ + int n = currentWord.length(); + + for (int i = 0; i < n; i++) { + if (matrix[x][y + i] == '#' || + matrix[x][y + i] == currentWord[i]) { + matrix[x][y + i] = currentWord[i]; + } + else { + + // this shows that word cannot + // be placed horizontally + matrix[0][0] = '@'; + return matrix; + } + } + + return matrix; +} + +// this function checks for the current word +// if it can be placed vertically or not +// x -> it represent index of row +// y -> it represent index of column +// currentWord -> it represent the +// current word in word array +vector checkVertical(int x, int y, + vector matrix, + string currentWord) +{ + int n = currentWord.length(); + + for (int i = 0; i < n; i++) { + if (matrix[x + i][y] == '#' || + matrix[x + i][y] == currentWord[i]) { + matrix[x + i][y] = currentWord[i]; + } + else { + + // this shows that word + // cannot be placed vertically + matrix[0][0] = '@'; + return matrix; + } + } + return matrix; +} + +// this function recursively checks for every +// word that can align vertically in one loop +// and in another loop it checks for those words +// that can align horizontally words -> it +// contains all the words to fill in a crossword +// puzzle matrix -> it contain the current +// state of crossword index -> it represent +// the index of current word n -> it represent +// the length of row or column of the square matrix +void solvePuzzle(vector& words, + vector matrix, + int index, int n) +{ + if (index < words.size()) { + string currentWord = words[index]; + int maxLen = n - currentWord.length(); + + // loop to check the words that can align vertically. + for (int i = 0; i < n; i++) { + for (int j = 0; j <= maxLen; j++) { + vector temp = checkVertical(j, i, + matrix, currentWord); + + if (temp[0][0] != '@') { + solvePuzzle(words, temp, index + 1, n); + } + } + } + + // loop to check the words that can align horizontally. + for (int i = 0; i < n; i++) { + for (int j = 0; j <= maxLen; j++) { + vector temp = checkHorizontal(i, j, + matrix, currentWord); + + if (temp[0][0] != '@') { + solvePuzzle(words, temp, index + 1, n); + } + } + } + } + else { + // calling of print function to + // print the crossword puzzle + cout << (ways + 1) << " way to solve the puzzle " + << endl; + printMatrix(matrix, n); + cout << endl; + + // increase the ways + ways++; + return; + } +} + +// Driver Code +int main() +{ + // length of grid + int n1 = 10; + + // matrix to hold the grid of puzzle + vector matrix; + + // take input of puzzle in matrix + // input of grid of size n1 x n1 + matrix.push_back("*#********"); + matrix.push_back("*#********"); + matrix.push_back("*#****#***"); + matrix.push_back("*##***##**"); + matrix.push_back("*#****#***"); + matrix.push_back("*#****#***"); + matrix.push_back("*#****#***"); + matrix.push_back("*#*######*"); + matrix.push_back("*#********"); + matrix.push_back("***#######"); + + vector words; + + // the words matrix will hold all + // the words need to be filled in the grid + words.push_back("PUNJAB"); + words.push_back("JHARKHAND"); + words.push_back("MIZORAM"); + words.push_back("MUMBAI"); + + // initialize the number of ways + // to solve the puzzle to zero + ways = 0; + + // recursive function to solve the puzzle + // Here 0 is the initial index of words array + // n1 is length of grid + solvePuzzle(words, matrix, 0, n1); + cout << "Number of ways to fill the grid is " + << ways << endl; + + return 0; +} From d0bc47f2cb44080208b241cdef26fdac875fca57 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Tue, 29 Jan 2019 01:17:30 -0500 Subject: [PATCH 108/285] Rename Matrix Chain Multiplication to matrix_chain_multiplication.cpp --- ...atrix Chain Multiplication => matrix_chain_multiplication.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dynamic-programming/{Matrix Chain Multiplication => matrix_chain_multiplication.cpp} (100%) diff --git a/dynamic-programming/Matrix Chain Multiplication b/dynamic-programming/matrix_chain_multiplication.cpp similarity index 100% rename from dynamic-programming/Matrix Chain Multiplication rename to dynamic-programming/matrix_chain_multiplication.cpp From ab460e2395fc8fadb69c474ee9a27ec3e625bda7 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 30 Jan 2019 13:16:12 -0500 Subject: [PATCH 109/285] Rename CHEFRES.cpp to chefres.cpp --- math/{CHEFRES.cpp => chefres.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename math/{CHEFRES.cpp => chefres.cpp} (100%) diff --git a/math/CHEFRES.cpp b/math/chefres.cpp similarity index 100% rename from math/CHEFRES.cpp rename to math/chefres.cpp From 8c519d9ced5a7b71901e4907ecf4de591d2b31fd Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 30 Jan 2019 13:21:22 -0500 Subject: [PATCH 110/285] Update and rename README.md to readme.md --- README.md | 46 ------------------ readme.md | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 46 deletions(-) delete mode 100644 README.md create mode 100644 readme.md diff --git a/README.md b/README.md deleted file mode 100644 index 178ab926..00000000 --- a/README.md +++ /dev/null @@ -1,46 +0,0 @@ -
- C Plus Plus Logo -
-
- -
-
-

All ▲lgorithms implemented in C Plus Plus

- - - - - -
-
- algorithms.abranhe.com -
- - -## Contents - -- [Arithmetic Analysis](arithmetic-analysis) -- [File Transfer Protocol](file-transfer-protocol) -- [Greedy Algorithms](greedy-algorithms) -- [Graphs](graphs) -- [Math](math) -- [Neutral Network](neutral-network) -- [Ciphers](ciphers) -- [Data Structures](data-structures) -- [Dynamic Programming](dynamic-programming) -- [Hashes](hashes) -- [Searches](searches) -- [Sorting](sorting) -- [Strings](https://github.com/AllAlgorithms/cpp/tree/master/Strings) -- [Traversals](traversals) - -## License - -This work is licensed under a [MIT License](https://github.com/abranhe/algorithms/blob/master/LICENSE) - -[![MIT IMG][mit-license]]((https://github.com/abranhe/algorithms/blob/master/LICENSE)) - -To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. - - -[mit-license]: https://cdn.abraham.gq/projects/algorithms/mit-license.png diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..5501e373 --- /dev/null +++ b/readme.md @@ -0,0 +1,139 @@ +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+

All ▲lgorithms implemented in C++

+ + + + + +
+
+ allalgorithms.com +
+ + +## Contents + +- [Artificial Intelligence](#artificial-intelligence) +- [Backtracking](#backtracking) +- [Bit Manipulation](#bit-manipulation) +- [Cellular Automaton](#cellular-automaton) +- [Ciphers](#ciphers) +- [Computational Geometry](#computational-geometry) +- [Cryptography](#cryptography) +- [Data Structures](#data-structures) +- [Divide and conquer](#divide-and-conquer) +- [Dynamic Programming](#dynamic-programming) +- [Gaming Theory](#gaming-theory) +- [Graphs](#graphs) +- [Greedy Algorithms](#greedy-algorithms) +- [Math](#math) +- [Networking](#networking) +- [Numerical Analysis](#numerical-analysis) +- [Operating system](#operating-system) +- [Randomized Algorithms](#randomized-algorithms) +- [Searches](#searches) +- [Selections Algorithms](#selections-algorithms) +- [Sorting](#sorting) +- [Strings](#strings) +- [Online Challenges](#online-challenges) +- [Others](#others) + +## Data Structures + +- Queue + - [Circular Buffer](data-structures/queue/circular_buffer.cpp) + - [Queue](data-structures/queue/queue.cpp) +- Stack + - [Stack](data-structures/stack/stack.cpp) + +## Dynamic Programming + +- [Coin Change](dynamic-programming/coin_change.cpp) +- [Edit Distance](dynamic-programming/edit_distance.cpp) +- [Knapsack](dynamic-programming/knapsack.cpp) +- [Longest common subsequence](dynamic-programming/lcs.cpp) +- [Longest Path](dynamic-programming/longest_path.cpp) +- [Ways to Cover](dynamic-programming/ways_to_cover.cpp) + +## Graphs + +- [Bellman Ford](graphs/bellman_ford.cpp) +- [Breadth-first search](graphs/bfs.cpp) +- [Count Disconnected Components](graphs/count_disconnected_components.cpp) +- [Depth-first search](graphs/dfs.cpp) +- [Dijkstra](graphs/dijkstra.cpp) +- [Floyed Warshall](graphs/floyd_warshall.cpp) +- [Prims Adjacency List](graphs/prims_adjacency_list.cpp) + +## Math + +- [Collatz](math/collatz.cpp) +- [Euclids Greatest common divisor](math/euclids_gcd.cpp) +- [Factorial](math/factorial.cpp) +- [Greatest common divisor of array](math/gcd_of_array.cpp) +- [Least common multiple of array](math/lcm_of_array.cpp) +- [Lucky Numbers](math/lucky_numbers.cpp) +- [Modular Exponentiations](math/modular_exponentiations.cpp) +- [nth Fibonacci Number using Goldenratio](math/nth_fibonacci_using_goldenratio.cpp) + +## Searches + +- [Binary Search](searches/binary_search.cpp) +- [Jump Search](searches/jump_search.cpp) +- [Linear Search](searches/linear_search.cpp) +- [Ternary Search](searches/ternary_search.cpp) + +## Sorting + +- [Bubble Sort](sorting/bubble_sort.cpp) +- [Heap Sort](sorting/heap_sort.cpp) +- [Heap Sort without vectors](sorting/heap_sort_without_vectors.cpp) +- [Insertion Sort](sorting/insertion_sort.cpp) +- [Merge Sort](sorting/merge_sort.cpp) +- [Quick Sort](sorting/quick_sort.cpp) +- [Selection Sort](sorting/selection_sort.cpp) +- [Sort Vector](sorting/sort_vector.cpp) +- [Tree Sort](sorting/tree_sort.cpp) + +## Strings + +- [Anagram Check](strings/anagram_check.cpp) +- [Lexicographic Ranking](strings/lexicographic_ranking.cpp) +- [Longest Palindrome Subset](strings/longest_palindrome_subset.cpp) +- [Naive Search](strings/naive_search.cpp) +- [Permutations of string](strings/permutations_of_string.cpp) +- [Print duplicate string](strings/print_duplicate_string.cpp) +- [Rabin Karp](strings/rabin_karp.cpp) +- [Remove Adjacent Duplicates](strings/remove_adjacent_duplicates.cpp) +- [Remove Duplicates](strings/remove_duplicates.cpp) +- [Reverse String](strings/reverse_string.cpp) + +## License + +This work is released under [MIT License](https://github.com/abranhe/algorithms/blob/master/liceense) + +[![MIT IMG](https://cdn.abranhe.com/projects/algorithms/mit-license.png)](https://github.com/abranhe/algorithms/blob/master/license) + +To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. + + +
+ + + +
+
From 6e28c7506dc3e6bd0e4a92c765de8338acc5cece Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 30 Jan 2019 13:21:58 -0500 Subject: [PATCH 111/285] Rename Strings/Rabin_carp_algo.cpp to strings/rabin_carp.cpp --- Strings/Rabin_carp_algo.cpp => strings/rabin_carp.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Strings/Rabin_carp_algo.cpp => strings/rabin_carp.cpp (100%) diff --git a/Strings/Rabin_carp_algo.cpp b/strings/rabin_carp.cpp similarity index 100% rename from Strings/Rabin_carp_algo.cpp rename to strings/rabin_carp.cpp From 20e061278cb3407ab876d0b37bfbfb3463b7d828 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 30 Jan 2019 13:22:58 -0500 Subject: [PATCH 112/285] Update and rename Strings/z algo.cpp to strings/z_algorithm.cpp --- Strings/z algo.cpp => strings/z_algorithm.cpp | 4 ---- 1 file changed, 4 deletions(-) rename Strings/z algo.cpp => strings/z_algorithm.cpp (99%) diff --git a/Strings/z algo.cpp b/strings/z_algorithm.cpp similarity index 99% rename from Strings/z algo.cpp rename to strings/z_algorithm.cpp index 1aabaff9..ab2468c8 100644 --- a/Strings/z algo.cpp +++ b/strings/z_algorithm.cpp @@ -1,13 +1,9 @@ /* - * C++ Program to Implement Z-Algorithm - */ #include - #include - #include using namespace std; From 414f197423a843d69a78eebc198b341bd5e289f1 Mon Sep 17 00:00:00 2001 From: Ankit2598 <36604725+Ankit2598@users.noreply.github.com> Date: Tue, 19 Feb 2019 22:15:49 +0530 Subject: [PATCH 113/285] Update and rename Magic Square to Magic Square.cpp I have done your work @Christian Bender. Kindly check it. --- math/{Magic Square => Magic Square.cpp} | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) rename math/{Magic Square => Magic Square.cpp} (83%) diff --git a/math/Magic Square b/math/Magic Square.cpp similarity index 83% rename from math/Magic Square rename to math/Magic Square.cpp index ce3e92a5..cd9db554 100644 --- a/math/Magic Square +++ b/math/Magic Square.cpp @@ -1,4 +1,4 @@ -#include +#include #define N 3 using namespace std; @@ -41,9 +41,13 @@ bool isMagicSquare(int mat[][N]) int main() { - int mat[][N] = {{ 2, 7, 6 }, - { 9, 5, 1 }, - { 4, 3, 8 }}; + int mat[3][N] ,i,j; + + for(i=0; i<3; i++) + { + for(j=0; j<3; j++) + cin>>mat[i][j]; + } if (isMagicSquare(mat)) cout << "Magic Square"; From ac449c143f34598d001fe68bad31aa43b8ae07bc Mon Sep 17 00:00:00 2001 From: Ankit2598 <36604725+Ankit2598@users.noreply.github.com> Date: Tue, 19 Feb 2019 22:32:22 +0530 Subject: [PATCH 114/285] Update Magic Square.cpp I have updated my code as you mentioned @christianbender. Kindly check it. --- math/Magic Square.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/Magic Square.cpp b/math/Magic Square.cpp index cd9db554..5b94a6d6 100644 --- a/math/Magic Square.cpp +++ b/math/Magic Square.cpp @@ -41,12 +41,12 @@ bool isMagicSquare(int mat[][N]) int main() { - int mat[3][N] ,i,j; + int mat[3][N] ,i,k; for(i=0; i<3; i++) { - for(j=0; j<3; j++) - cin>>mat[i][j]; + for(k=0; k<3; k++) + cin>>mat[i][k]; } if (isMagicSquare(mat)) From fece23d1afb5474b6df6ac465ade526693a4d7d3 Mon Sep 17 00:00:00 2001 From: Christian Bender Date: Tue, 19 Feb 2019 20:34:11 +0100 Subject: [PATCH 115/285] updated the readme.md --- readme.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/readme.md b/readme.md index 5501e373..56372ed2 100644 --- a/readme.md +++ b/readme.md @@ -59,6 +59,8 @@ - [Queue](data-structures/queue/queue.cpp) - Stack - [Stack](data-structures/stack/stack.cpp) +- Linked List + - [linked list](data-structures/linkedlist) ## Dynamic Programming @@ -68,6 +70,8 @@ - [Longest common subsequence](dynamic-programming/lcs.cpp) - [Longest Path](dynamic-programming/longest_path.cpp) - [Ways to Cover](dynamic-programming/ways_to_cover.cpp) +- [Fibonacci Numbers](dynamic-programming/fibonacci_number.cpp) +- [Rod Cutting](dynamic-programming/rod_cutting.cpp) ## Graphs @@ -78,6 +82,7 @@ - [Dijkstra](graphs/dijkstra.cpp) - [Floyed Warshall](graphs/floyd_warshall.cpp) - [Prims Adjacency List](graphs/prims_adjacency_list.cpp) +- [Topo-Sort](graphs/toposort.cpp) ## Math @@ -89,6 +94,13 @@ - [Lucky Numbers](math/lucky_numbers.cpp) - [Modular Exponentiations](math/modular_exponentiations.cpp) - [nth Fibonacci Number using Goldenratio](math/nth_fibonacci_using_goldenratio.cpp) +- [Armstrong Numbers](math/armstrong_number.cpp) +- [Termo Conversion](math/TermoConv.cpp) +- [Pascal Triangle](math/Pascals_triangle.cpp) +- [Modular Exponentiation](math/modular_exponentiation.cpp) +- [Maximum Subarray Problem ](math/kadence.cpp) +- [Eulers Totient (Phi-function)](math/eulers_totient.cpp) +- [Slicker Algorithm](math/Slicker_Algorithm.cpp) ## Searches @@ -96,6 +108,7 @@ - [Jump Search](searches/jump_search.cpp) - [Linear Search](searches/linear_search.cpp) - [Ternary Search](searches/ternary_search.cpp) +- [Exponential Search](searches/exponential_search.cpp) ## Sorting @@ -108,6 +121,13 @@ - [Selection Sort](sorting/selection_sort.cpp) - [Sort Vector](sorting/sort_vector.cpp) - [Tree Sort](sorting/tree_sort.cpp) +- [Counting Sort](sorting/counting_sort.cpp) +- [Bogo-Sort](sorting/bogo_sort.cpp) +- [Radix-Sort](sorting/radix_sort.cpp) +- [Rank Sort](sorting/rank_sort.cpp) +- [Shell Sort](sorting/shell_sort.cpp) +- [Stooge Sort](sorting/stooge_sort.cpp) +- [Shaker Sort](sorting/shaker_sort.cpp) ## Strings @@ -121,6 +141,7 @@ - [Remove Adjacent Duplicates](strings/remove_adjacent_duplicates.cpp) - [Remove Duplicates](strings/remove_duplicates.cpp) - [Reverse String](strings/reverse_string.cpp) +- [Naive Search](strings/naive_search.cpp) ## License From 8334ff4a4bac8c3b4beb18857e15a33be51f2a88 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 20 Feb 2019 02:39:14 -0500 Subject: [PATCH 116/285] adding validattor --- .travis.yml | 7 + ...gleArea.cpp => largest_rectangle_area.cpp} | 0 .../{linkedlist_adt.h => linkedlist_adt.hpp} | 0 ...umber.cpp => all_factors_of_a_numbe_r.cpp} | 0 math/{HoaxNo.cpp => hoax_no.cpp} | 0 ...osthenes.cpp => sieve_of_eratosthenes.cpp} | 0 math/{sphenicNo.cpp => sphenic_no.cpp} | 0 math/{TermoConv.cpp => termo_conv.cpp} | 0 scripts/formatter.js | 39 + scripts/node_modules/.yarn-integrity | 29 + .../node_modules/balanced-match/.npmignore | 5 + .../node_modules/balanced-match/LICENSE.md | 21 + scripts/node_modules/balanced-match/README.md | 91 + scripts/node_modules/balanced-match/index.js | 59 + .../node_modules/balanced-match/package.json | 49 + scripts/node_modules/brace-expansion/LICENSE | 21 + .../node_modules/brace-expansion/README.md | 129 + scripts/node_modules/brace-expansion/index.js | 201 + .../node_modules/brace-expansion/package.json | 47 + scripts/node_modules/concat-map/.travis.yml | 4 + scripts/node_modules/concat-map/LICENSE | 18 + .../node_modules/concat-map/README.markdown | 62 + .../node_modules/concat-map/example/map.js | 6 + scripts/node_modules/concat-map/index.js | 13 + scripts/node_modules/concat-map/package.json | 43 + scripts/node_modules/concat-map/test/map.js | 39 + scripts/node_modules/decamelize/index.js | 21 + scripts/node_modules/decamelize/license | 9 + scripts/node_modules/decamelize/package.json | 41 + scripts/node_modules/decamelize/readme.md | 48 + scripts/node_modules/fs.realpath/LICENSE | 43 + scripts/node_modules/fs.realpath/README.md | 33 + scripts/node_modules/fs.realpath/index.js | 66 + scripts/node_modules/fs.realpath/old.js | 303 ++ scripts/node_modules/fs.realpath/package.json | 26 + scripts/node_modules/glob/LICENSE | 15 + scripts/node_modules/glob/README.md | 368 ++ scripts/node_modules/glob/changelog.md | 67 + scripts/node_modules/glob/common.js | 240 + scripts/node_modules/glob/glob.js | 790 ++++ scripts/node_modules/glob/package.json | 43 + scripts/node_modules/glob/sync.js | 486 ++ scripts/node_modules/inflight/LICENSE | 15 + scripts/node_modules/inflight/README.md | 37 + scripts/node_modules/inflight/inflight.js | 54 + scripts/node_modules/inflight/package.json | 29 + scripts/node_modules/inherits/LICENSE | 16 + scripts/node_modules/inherits/README.md | 42 + scripts/node_modules/inherits/inherits.js | 7 + .../node_modules/inherits/inherits_browser.js | 23 + scripts/node_modules/inherits/package.json | 29 + scripts/node_modules/minimatch/LICENSE | 15 + scripts/node_modules/minimatch/README.md | 209 + scripts/node_modules/minimatch/minimatch.js | 923 ++++ scripts/node_modules/minimatch/package.json | 30 + scripts/node_modules/once/LICENSE | 15 + scripts/node_modules/once/README.md | 79 + scripts/node_modules/once/once.js | 42 + scripts/node_modules/once/package.json | 33 + .../node_modules/path-is-absolute/index.js | 20 + scripts/node_modules/path-is-absolute/license | 21 + .../path-is-absolute/package.json | 43 + .../node_modules/path-is-absolute/readme.md | 59 + scripts/node_modules/wrappy/LICENSE | 15 + scripts/node_modules/wrappy/README.md | 36 + scripts/node_modules/wrappy/package.json | 29 + scripts/node_modules/wrappy/wrappy.js | 33 + scripts/node_modules/xregexp/LICENSE | 21 + scripts/node_modules/xregexp/README.md | 237 + .../node_modules/xregexp/lib/addons/build.js | 241 + .../xregexp/lib/addons/matchrecursive.js | 202 + .../xregexp/lib/addons/unicode-base.js | 247 + .../xregexp/lib/addons/unicode-blocks.js | 852 ++++ .../xregexp/lib/addons/unicode-categories.js | 204 + .../xregexp/lib/addons/unicode-properties.js | 103 + .../xregexp/lib/addons/unicode-scripts.js | 454 ++ scripts/node_modules/xregexp/lib/index.js | 50 + scripts/node_modules/xregexp/lib/xregexp.js | 1792 +++++++ scripts/node_modules/xregexp/package.json | 47 + .../node_modules/xregexp/src/addons/build.js | 234 + .../xregexp/src/addons/matchrecursive.js | 197 + .../xregexp/src/addons/unicode-base.js | 258 + .../xregexp/src/addons/unicode-blocks.js | 1118 +++++ .../xregexp/src/addons/unicode-categories.js | 234 + .../xregexp/src/addons/unicode-properties.js | 104 + .../xregexp/src/addons/unicode-scripts.js | 584 +++ scripts/node_modules/xregexp/src/index.js | 19 + scripts/node_modules/xregexp/src/xregexp.js | 1827 ++++++++ scripts/node_modules/xregexp/xregexp-all.js | 4156 +++++++++++++++++ scripts/package.json | 15 + scripts/validate.js | 34 + scripts/yarn.lock | 87 + 92 files changed, 18653 insertions(+) create mode 100644 .travis.yml rename data-structures/{largestRectangleArea.cpp => largest_rectangle_area.cpp} (100%) rename data-structures/linkedlist/{linkedlist_adt.h => linkedlist_adt.hpp} (100%) rename math/{all_factors_of_a_number.cpp => all_factors_of_a_numbe_r.cpp} (100%) rename math/{HoaxNo.cpp => hoax_no.cpp} (100%) rename math/{sieveOfEratosthenes.cpp => sieve_of_eratosthenes.cpp} (100%) rename math/{sphenicNo.cpp => sphenic_no.cpp} (100%) rename math/{TermoConv.cpp => termo_conv.cpp} (100%) create mode 100644 scripts/formatter.js create mode 100644 scripts/node_modules/.yarn-integrity create mode 100644 scripts/node_modules/balanced-match/.npmignore create mode 100644 scripts/node_modules/balanced-match/LICENSE.md create mode 100644 scripts/node_modules/balanced-match/README.md create mode 100644 scripts/node_modules/balanced-match/index.js create mode 100644 scripts/node_modules/balanced-match/package.json create mode 100644 scripts/node_modules/brace-expansion/LICENSE create mode 100644 scripts/node_modules/brace-expansion/README.md create mode 100644 scripts/node_modules/brace-expansion/index.js create mode 100644 scripts/node_modules/brace-expansion/package.json create mode 100644 scripts/node_modules/concat-map/.travis.yml create mode 100644 scripts/node_modules/concat-map/LICENSE create mode 100644 scripts/node_modules/concat-map/README.markdown create mode 100644 scripts/node_modules/concat-map/example/map.js create mode 100644 scripts/node_modules/concat-map/index.js create mode 100644 scripts/node_modules/concat-map/package.json create mode 100644 scripts/node_modules/concat-map/test/map.js create mode 100644 scripts/node_modules/decamelize/index.js create mode 100644 scripts/node_modules/decamelize/license create mode 100644 scripts/node_modules/decamelize/package.json create mode 100644 scripts/node_modules/decamelize/readme.md create mode 100644 scripts/node_modules/fs.realpath/LICENSE create mode 100644 scripts/node_modules/fs.realpath/README.md create mode 100644 scripts/node_modules/fs.realpath/index.js create mode 100644 scripts/node_modules/fs.realpath/old.js create mode 100644 scripts/node_modules/fs.realpath/package.json create mode 100644 scripts/node_modules/glob/LICENSE create mode 100644 scripts/node_modules/glob/README.md create mode 100644 scripts/node_modules/glob/changelog.md create mode 100644 scripts/node_modules/glob/common.js create mode 100644 scripts/node_modules/glob/glob.js create mode 100644 scripts/node_modules/glob/package.json create mode 100644 scripts/node_modules/glob/sync.js create mode 100644 scripts/node_modules/inflight/LICENSE create mode 100644 scripts/node_modules/inflight/README.md create mode 100644 scripts/node_modules/inflight/inflight.js create mode 100644 scripts/node_modules/inflight/package.json create mode 100644 scripts/node_modules/inherits/LICENSE create mode 100644 scripts/node_modules/inherits/README.md create mode 100644 scripts/node_modules/inherits/inherits.js create mode 100644 scripts/node_modules/inherits/inherits_browser.js create mode 100644 scripts/node_modules/inherits/package.json create mode 100644 scripts/node_modules/minimatch/LICENSE create mode 100644 scripts/node_modules/minimatch/README.md create mode 100644 scripts/node_modules/minimatch/minimatch.js create mode 100644 scripts/node_modules/minimatch/package.json create mode 100644 scripts/node_modules/once/LICENSE create mode 100644 scripts/node_modules/once/README.md create mode 100644 scripts/node_modules/once/once.js create mode 100644 scripts/node_modules/once/package.json create mode 100644 scripts/node_modules/path-is-absolute/index.js create mode 100644 scripts/node_modules/path-is-absolute/license create mode 100644 scripts/node_modules/path-is-absolute/package.json create mode 100644 scripts/node_modules/path-is-absolute/readme.md create mode 100644 scripts/node_modules/wrappy/LICENSE create mode 100644 scripts/node_modules/wrappy/README.md create mode 100644 scripts/node_modules/wrappy/package.json create mode 100644 scripts/node_modules/wrappy/wrappy.js create mode 100644 scripts/node_modules/xregexp/LICENSE create mode 100644 scripts/node_modules/xregexp/README.md create mode 100644 scripts/node_modules/xregexp/lib/addons/build.js create mode 100644 scripts/node_modules/xregexp/lib/addons/matchrecursive.js create mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-base.js create mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-blocks.js create mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-categories.js create mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-properties.js create mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-scripts.js create mode 100644 scripts/node_modules/xregexp/lib/index.js create mode 100644 scripts/node_modules/xregexp/lib/xregexp.js create mode 100644 scripts/node_modules/xregexp/package.json create mode 100644 scripts/node_modules/xregexp/src/addons/build.js create mode 100644 scripts/node_modules/xregexp/src/addons/matchrecursive.js create mode 100644 scripts/node_modules/xregexp/src/addons/unicode-base.js create mode 100644 scripts/node_modules/xregexp/src/addons/unicode-blocks.js create mode 100644 scripts/node_modules/xregexp/src/addons/unicode-categories.js create mode 100644 scripts/node_modules/xregexp/src/addons/unicode-properties.js create mode 100644 scripts/node_modules/xregexp/src/addons/unicode-scripts.js create mode 100644 scripts/node_modules/xregexp/src/index.js create mode 100644 scripts/node_modules/xregexp/src/xregexp.js create mode 100644 scripts/node_modules/xregexp/xregexp-all.js create mode 100644 scripts/package.json create mode 100644 scripts/validate.js create mode 100644 scripts/yarn.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..3d17fe7f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: node_js + +script: cd scripts \ + && npm run validate + +notifications: + email: false \ No newline at end of file diff --git a/data-structures/largestRectangleArea.cpp b/data-structures/largest_rectangle_area.cpp similarity index 100% rename from data-structures/largestRectangleArea.cpp rename to data-structures/largest_rectangle_area.cpp diff --git a/data-structures/linkedlist/linkedlist_adt.h b/data-structures/linkedlist/linkedlist_adt.hpp similarity index 100% rename from data-structures/linkedlist/linkedlist_adt.h rename to data-structures/linkedlist/linkedlist_adt.hpp diff --git a/math/all_factors_of_a_number.cpp b/math/all_factors_of_a_numbe_r.cpp similarity index 100% rename from math/all_factors_of_a_number.cpp rename to math/all_factors_of_a_numbe_r.cpp diff --git a/math/HoaxNo.cpp b/math/hoax_no.cpp similarity index 100% rename from math/HoaxNo.cpp rename to math/hoax_no.cpp diff --git a/math/sieveOfEratosthenes.cpp b/math/sieve_of_eratosthenes.cpp similarity index 100% rename from math/sieveOfEratosthenes.cpp rename to math/sieve_of_eratosthenes.cpp diff --git a/math/sphenicNo.cpp b/math/sphenic_no.cpp similarity index 100% rename from math/sphenicNo.cpp rename to math/sphenic_no.cpp diff --git a/math/TermoConv.cpp b/math/termo_conv.cpp similarity index 100% rename from math/TermoConv.cpp rename to math/termo_conv.cpp diff --git a/scripts/formatter.js b/scripts/formatter.js new file mode 100644 index 00000000..06f066c0 --- /dev/null +++ b/scripts/formatter.js @@ -0,0 +1,39 @@ +/** + * The All Algorithms C++ Formatter + * + * Author: Carlos Abraham Hernandez + * https://abranhe.com (abraham@abranhe.com) + */ +'use strict'; + +const glob = require('glob'); +const path = require('path'); +const decamelize = require('decamelize'); +const shell = require('child_process').execSync; + +const getFiles = (src, callback) => { + glob(src + '/**', callback); +}; + +getFiles('../', (err, res) => { + if (err) { + console.log('Error', err); + } else { + res.map((file) => { + // Accept only valid C++ Files (.cpp,.hpp,.h) + if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { + return; + } + + // Only avilable for Linux/Macos + // https://stackoverflow.com/a/41030518/7602110 + // Can be replaced in the future + shell(`mv ${file} ${decamelize(file)}`); + + // Replace for convention .h for .hpp + if (path.extname(file) === '.h') { + shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`); + } + }); + } +}); diff --git a/scripts/node_modules/.yarn-integrity b/scripts/node_modules/.yarn-integrity new file mode 100644 index 00000000..785c8e63 --- /dev/null +++ b/scripts/node_modules/.yarn-integrity @@ -0,0 +1,29 @@ +{ + "systemParams": "darwin-x64-67", + "modulesFolders": [ + "node_modules" + ], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [ + "decamelize@^2.0.0", + "glob@^7.1.3" + ], + "lockfileEntries": { + "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767", + "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd", + "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "decamelize@^2.0.0": "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7", + "fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f", + "glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1", + "inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de", + "minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083", + "once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "xregexp@4.0.0": "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + }, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/scripts/node_modules/balanced-match/.npmignore b/scripts/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000..ae5d8c36 --- /dev/null +++ b/scripts/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/scripts/node_modules/balanced-match/LICENSE.md b/scripts/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000..2cdc8e41 --- /dev/null +++ b/scripts/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/scripts/node_modules/balanced-match/README.md b/scripts/node_modules/balanced-match/README.md new file mode 100644 index 00000000..08e918c0 --- /dev/null +++ b/scripts/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/scripts/node_modules/balanced-match/index.js b/scripts/node_modules/balanced-match/index.js new file mode 100644 index 00000000..1685a762 --- /dev/null +++ b/scripts/node_modules/balanced-match/index.js @@ -0,0 +1,59 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/scripts/node_modules/balanced-match/package.json b/scripts/node_modules/balanced-match/package.json new file mode 100644 index 00000000..61349c6e --- /dev/null +++ b/scripts/node_modules/balanced-match/package.json @@ -0,0 +1,49 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test", + "bench": "make bench" + }, + "dependencies": {}, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/scripts/node_modules/brace-expansion/LICENSE b/scripts/node_modules/brace-expansion/LICENSE new file mode 100644 index 00000000..de322667 --- /dev/null +++ b/scripts/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/scripts/node_modules/brace-expansion/README.md b/scripts/node_modules/brace-expansion/README.md new file mode 100644 index 00000000..6b4e0e16 --- /dev/null +++ b/scripts/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/scripts/node_modules/brace-expansion/index.js b/scripts/node_modules/brace-expansion/index.js new file mode 100644 index 00000000..0478be81 --- /dev/null +++ b/scripts/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/scripts/node_modules/brace-expansion/package.json b/scripts/node_modules/brace-expansion/package.json new file mode 100644 index 00000000..a18faa8f --- /dev/null +++ b/scripts/node_modules/brace-expansion/package.json @@ -0,0 +1,47 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.11", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/scripts/node_modules/concat-map/.travis.yml b/scripts/node_modules/concat-map/.travis.yml new file mode 100644 index 00000000..f1d0f13c --- /dev/null +++ b/scripts/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/scripts/node_modules/concat-map/LICENSE b/scripts/node_modules/concat-map/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/scripts/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/concat-map/README.markdown b/scripts/node_modules/concat-map/README.markdown new file mode 100644 index 00000000..408f70a1 --- /dev/null +++ b/scripts/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/scripts/node_modules/concat-map/example/map.js b/scripts/node_modules/concat-map/example/map.js new file mode 100644 index 00000000..33656217 --- /dev/null +++ b/scripts/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/scripts/node_modules/concat-map/index.js b/scripts/node_modules/concat-map/index.js new file mode 100644 index 00000000..b29a7812 --- /dev/null +++ b/scripts/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/scripts/node_modules/concat-map/package.json b/scripts/node_modules/concat-map/package.json new file mode 100644 index 00000000..d3640e6b --- /dev/null +++ b/scripts/node_modules/concat-map/package.json @@ -0,0 +1,43 @@ +{ + "name" : "concat-map", + "description" : "concatenative mapdashery", + "version" : "0.0.1", + "repository" : { + "type" : "git", + "url" : "git://github.com/substack/node-concat-map.git" + }, + "main" : "index.js", + "keywords" : [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories" : { + "example" : "example", + "test" : "test" + }, + "scripts" : { + "test" : "tape test/*.js" + }, + "devDependencies" : { + "tape" : "~2.4.0" + }, + "license" : "MIT", + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : { + "ie" : [ 6, 7, 8, 9 ], + "ff" : [ 3.5, 10, 15.0 ], + "chrome" : [ 10, 22 ], + "safari" : [ 5.1 ], + "opera" : [ 12 ] + } + } +} diff --git a/scripts/node_modules/concat-map/test/map.js b/scripts/node_modules/concat-map/test/map.js new file mode 100644 index 00000000..fdbd7022 --- /dev/null +++ b/scripts/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/scripts/node_modules/decamelize/index.js b/scripts/node_modules/decamelize/index.js new file mode 100644 index 00000000..1b8327b8 --- /dev/null +++ b/scripts/node_modules/decamelize/index.js @@ -0,0 +1,21 @@ +'use strict'; +const xRegExp = require('xregexp'); + +module.exports = (text, separator) => { + if (typeof text !== 'string') { + throw new TypeError('Expected a string'); + } + + separator = typeof separator === 'undefined' ? '_' : separator; + + const regex1 = xRegExp('([\\p{Ll}\\d])(\\p{Lu})', 'g'); + const regex2 = xRegExp('(\\p{Lu}+)(\\p{Lu}[\\p{Ll}\\d]+)', 'g'); + + return text + // TODO: Use this instead of `xregexp` when targeting Node.js 10: + // .replace(/([\p{Lowercase_Letter}\d])(\p{Uppercase_Letter})/gu, `$1${separator}$2`) + // .replace(/(\p{Lowercase_Letter}+)(\p{Uppercase_Letter}[\p{Lowercase_Letter}\d]+)/gu, `$1${separator}$2`) + .replace(regex1, `$1${separator}$2`) + .replace(regex2, `$1${separator}$2`) + .toLowerCase(); +}; diff --git a/scripts/node_modules/decamelize/license b/scripts/node_modules/decamelize/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/scripts/node_modules/decamelize/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/decamelize/package.json b/scripts/node_modules/decamelize/package.json new file mode 100644 index 00000000..b5d5f8ef --- /dev/null +++ b/scripts/node_modules/decamelize/package.json @@ -0,0 +1,41 @@ +{ + "name": "decamelize", + "version": "2.0.0", + "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", + "license": "MIT", + "repository": "sindresorhus/decamelize", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "decamelize", + "decamelcase", + "camelcase", + "lowercase", + "case", + "dash", + "hyphen", + "string", + "str", + "text", + "convert" + ], + "dependencies": { + "xregexp": "4.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/scripts/node_modules/decamelize/readme.md b/scripts/node_modules/decamelize/readme.md new file mode 100644 index 00000000..7ab31a98 --- /dev/null +++ b/scripts/node_modules/decamelize/readme.md @@ -0,0 +1,48 @@ +# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) + +> Convert a camelized string into a lowercased one with a custom separator
+> Example: `unicornRainbow` → `unicorn_rainbow` + + +## Install + +``` +$ npm install decamelize +``` + + +## Usage + +```js +const decamelize = require('decamelize'); + +decamelize('unicornRainbow'); +//=> 'unicorn_rainbow' + +decamelize('unicornRainbow', '-'); +//=> 'unicorn-rainbow' +``` + + +## API + +### decamelize(input, [separator]) + +#### input + +Type: `string` + +#### separator + +Type: `string`
+Default: `_` + + +## Related + +See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/scripts/node_modules/fs.realpath/LICENSE b/scripts/node_modules/fs.realpath/LICENSE new file mode 100644 index 00000000..5bd884c2 --- /dev/null +++ b/scripts/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/fs.realpath/README.md b/scripts/node_modules/fs.realpath/README.md new file mode 100644 index 00000000..a42ceac6 --- /dev/null +++ b/scripts/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/scripts/node_modules/fs.realpath/index.js b/scripts/node_modules/fs.realpath/index.js new file mode 100644 index 00000000..b09c7c7e --- /dev/null +++ b/scripts/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/scripts/node_modules/fs.realpath/old.js b/scripts/node_modules/fs.realpath/old.js new file mode 100644 index 00000000..b40305e7 --- /dev/null +++ b/scripts/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/scripts/node_modules/fs.realpath/package.json b/scripts/node_modules/fs.realpath/package.json new file mode 100644 index 00000000..3edc57d2 --- /dev/null +++ b/scripts/node_modules/fs.realpath/package.json @@ -0,0 +1,26 @@ +{ + "name": "fs.realpath", + "version": "1.0.0", + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "old.js", + "index.js" + ] +} diff --git a/scripts/node_modules/glob/LICENSE b/scripts/node_modules/glob/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/scripts/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/glob/README.md b/scripts/node_modules/glob/README.md new file mode 100644 index 00000000..baa1d1ba --- /dev/null +++ b/scripts/node_modules/glob/README.md @@ -0,0 +1,368 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/scripts/node_modules/glob/changelog.md b/scripts/node_modules/glob/changelog.md new file mode 100644 index 00000000..41636771 --- /dev/null +++ b/scripts/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/scripts/node_modules/glob/common.js b/scripts/node_modules/glob/common.js new file mode 100644 index 00000000..66651bb3 --- /dev/null +++ b/scripts/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/scripts/node_modules/glob/glob.js b/scripts/node_modules/glob/glob.js new file mode 100644 index 00000000..58dec0f6 --- /dev/null +++ b/scripts/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/scripts/node_modules/glob/package.json b/scripts/node_modules/glob/package.json new file mode 100644 index 00000000..a4faae1b --- /dev/null +++ b/scripts/node_modules/glob/package.json @@ -0,0 +1,43 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.1.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC" +} diff --git a/scripts/node_modules/glob/sync.js b/scripts/node_modules/glob/sync.js new file mode 100644 index 00000000..c952134b --- /dev/null +++ b/scripts/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/scripts/node_modules/inflight/LICENSE b/scripts/node_modules/inflight/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/scripts/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/inflight/README.md b/scripts/node_modules/inflight/README.md new file mode 100644 index 00000000..6dc89291 --- /dev/null +++ b/scripts/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/scripts/node_modules/inflight/inflight.js b/scripts/node_modules/inflight/inflight.js new file mode 100644 index 00000000..48202b3c --- /dev/null +++ b/scripts/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/scripts/node_modules/inflight/package.json b/scripts/node_modules/inflight/package.json new file mode 100644 index 00000000..6084d350 --- /dev/null +++ b/scripts/node_modules/inflight/package.json @@ -0,0 +1,29 @@ +{ + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.1.2" + }, + "scripts": { + "test": "tap test.js --100" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/inflight.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" +} diff --git a/scripts/node_modules/inherits/LICENSE b/scripts/node_modules/inherits/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/scripts/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/scripts/node_modules/inherits/README.md b/scripts/node_modules/inherits/README.md new file mode 100644 index 00000000..b1c56658 --- /dev/null +++ b/scripts/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/scripts/node_modules/inherits/inherits.js b/scripts/node_modules/inherits/inherits.js new file mode 100644 index 00000000..3b94763a --- /dev/null +++ b/scripts/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/scripts/node_modules/inherits/inherits_browser.js b/scripts/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000..c1e78a75 --- /dev/null +++ b/scripts/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/scripts/node_modules/inherits/package.json b/scripts/node_modules/inherits/package.json new file mode 100644 index 00000000..7cf62b95 --- /dev/null +++ b/scripts/node_modules/inherits/package.json @@ -0,0 +1,29 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.3", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", + "scripts": { + "test": "node test" + }, + "devDependencies": { + "tap": "^7.1.0" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/scripts/node_modules/minimatch/LICENSE b/scripts/node_modules/minimatch/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/scripts/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/minimatch/README.md b/scripts/node_modules/minimatch/README.md new file mode 100644 index 00000000..ad72b813 --- /dev/null +++ b/scripts/node_modules/minimatch/README.md @@ -0,0 +1,209 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/scripts/node_modules/minimatch/minimatch.js b/scripts/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000..5b5f8cf4 --- /dev/null +++ b/scripts/node_modules/minimatch/minimatch.js @@ -0,0 +1,923 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/scripts/node_modules/minimatch/package.json b/scripts/node_modules/minimatch/package.json new file mode 100644 index 00000000..c4514c80 --- /dev/null +++ b/scripts/node_modules/minimatch/package.json @@ -0,0 +1,30 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js --cov", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^10.3.2" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/scripts/node_modules/once/LICENSE b/scripts/node_modules/once/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/scripts/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/once/README.md b/scripts/node_modules/once/README.md new file mode 100644 index 00000000..1f1ffca9 --- /dev/null +++ b/scripts/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/scripts/node_modules/once/once.js b/scripts/node_modules/once/once.js new file mode 100644 index 00000000..23540673 --- /dev/null +++ b/scripts/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/scripts/node_modules/once/package.json b/scripts/node_modules/once/package.json new file mode 100644 index 00000000..16815b2f --- /dev/null +++ b/scripts/node_modules/once/package.json @@ -0,0 +1,33 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/scripts/node_modules/path-is-absolute/index.js b/scripts/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000..22aa6c35 --- /dev/null +++ b/scripts/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/scripts/node_modules/path-is-absolute/license b/scripts/node_modules/path-is-absolute/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/scripts/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/scripts/node_modules/path-is-absolute/package.json b/scripts/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000..91196d5e --- /dev/null +++ b/scripts/node_modules/path-is-absolute/package.json @@ -0,0 +1,43 @@ +{ + "name": "path-is-absolute", + "version": "1.0.1", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": "sindresorhus/path-is-absolute", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "devDependencies": { + "xo": "^0.16.0" + } +} diff --git a/scripts/node_modules/path-is-absolute/readme.md b/scripts/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000..8dbdf5fc --- /dev/null +++ b/scripts/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/scripts/node_modules/wrappy/LICENSE b/scripts/node_modules/wrappy/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/scripts/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/wrappy/README.md b/scripts/node_modules/wrappy/README.md new file mode 100644 index 00000000..98eab252 --- /dev/null +++ b/scripts/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/scripts/node_modules/wrappy/package.json b/scripts/node_modules/wrappy/package.json new file mode 100644 index 00000000..13075204 --- /dev/null +++ b/scripts/node_modules/wrappy/package.json @@ -0,0 +1,29 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy" +} diff --git a/scripts/node_modules/wrappy/wrappy.js b/scripts/node_modules/wrappy/wrappy.js new file mode 100644 index 00000000..bb7e7d6f --- /dev/null +++ b/scripts/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/scripts/node_modules/xregexp/LICENSE b/scripts/node_modules/xregexp/LICENSE new file mode 100644 index 00000000..43f08b4c --- /dev/null +++ b/scripts/node_modules/xregexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2007-2017 Steven Levithan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/scripts/node_modules/xregexp/README.md b/scripts/node_modules/xregexp/README.md new file mode 100644 index 00000000..172a6321 --- /dev/null +++ b/scripts/node_modules/xregexp/README.md @@ -0,0 +1,237 @@ +# XRegExp 4.0.0 + +[![Build Status](https://travis-ci.org/slevithan/xregexp.svg?branch=master)](https://travis-ci.org/slevithan/xregexp) + +XRegExp provides augmented (and extensible) JavaScript regular expressions. You get modern syntax and flags beyond what browsers support natively. XRegExp is also a regex utility belt with tools to make your grepping and parsing easier, while freeing you from regex cross-browser inconsistencies and other annoyances. + +XRegExp supports all native ES6 regular expression syntax. It supports ES5+ browsers, and you can use it with Node.js or as a RequireJS module. + +## Performance + +XRegExp compiles to native `RegExp` objects. Therefore regexes built with XRegExp perform just as fast as native regular expressions. There is a tiny extra cost when compiling a pattern for the first time. + +## Usage examples + +```js +// Using named capture and flag x for free-spacing and line comments +const date = XRegExp( + `(? [0-9]{4} ) -? # year + (? [0-9]{2} ) -? # month + (? [0-9]{2} ) # day`, 'x'); + +// XRegExp.exec gives you named backreferences on the match result +let match = XRegExp.exec('2017-02-22', date); +match.year; // -> '2017' + +// It also includes optional pos and sticky arguments +let pos = 3; +const result = []; +while (match = XRegExp.exec('<1><2><3>4<5>', /<(\d+)>/, pos, 'sticky')) { + result.push(match[1]); + pos = match.index + match[0].length; +} +// result -> ['2', '3'] + +// XRegExp.replace allows named backreferences in replacements +XRegExp.replace('2017-02-22', date, '$/$/$'); +// -> '02/22/2017' +XRegExp.replace('2017-02-22', date, (match) => { + return `${match.month}/${match.day}/${match.year}`; +}); +// -> '02/22/2017' + +// XRegExps compile to RegExps and work perfectly with native methods +date.test('2017-02-22'); +// -> true + +// The only caveat is that named captures must be referenced using +// numbered backreferences if used with native methods +'2017-02-22'.replace(date, '$2/$3/$1'); +// -> '02/22/2017' + +// Use XRegExp.forEach to extract every other digit from a string +const evens = []; +XRegExp.forEach('1a2345', /\d/, (match, i) => { + if (i % 2) evens.push(+match[0]); +}); +// evens -> [2, 4] + +// Use XRegExp.matchChain to get numbers within tags +XRegExp.matchChain('1 2 3 4 \n 56', [ + XRegExp('(?is).*?'), + /\d+/ +]); +// -> ['2', '4', '56'] + +// You can also pass forward and return specific backreferences +const html = + `
XRegExp + Google`; +XRegExp.matchChain(html, [ + {regex: //i, backref: 1}, + {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} +]); +// -> ['xregexp.com', 'www.google.com'] + +// Merge strings and regexes, with updated backreferences +XRegExp.union(['m+a*n', /(bear)\1/, /(pig)\1/], 'i', {conjunction: 'or'}); +// -> /m\+a\*n|(bear)\1|(pig)\2/i +``` + +These examples give the flavor of what's possible, but XRegExp has more syntax, flags, methods, options, and browser fixes that aren't shown here. You can also augment XRegExp's regular expression syntax with addons (see below) or write your own. See [xregexp.com](http://xregexp.com/) for details. + +## Addons + +You can either load addons individually, or bundle all addons with XRegExp by loading `xregexp-all.js` from https://unpkg.com/xregexp/xregexp-all.js. + +### Unicode + +If not using `xregexp-all.js`, first include the Unicode Base script and then one or more of the addons for Unicode blocks, categories, properties, or scripts. + +Then you can do this: + +```js +// Test the Unicode category L (Letter) +const unicodeWord = XRegExp('^\\pL+$'); +unicodeWord.test('Русский'); // -> true +unicodeWord.test('日本語'); // -> true +unicodeWord.test('العربية'); // -> true + +// Test some Unicode scripts +XRegExp('^\\p{Hiragana}+$').test('ひらがな'); // -> true +XRegExp('^[\\p{Latin}\\p{Common}]+$').test('Über Café.'); // -> true +``` + +By default, `\p{…}` and `\P{…}` support the Basic Multilingual Plane (i.e. code points up to `U+FFFF`). You can opt-in to full 21-bit Unicode support (with code points up to `U+10FFFF`) on a per-regex basis by using flag `A`. This is called *astral mode*. You can automatically add flag `A` for all new regexes by running `XRegExp.install('astral')`. When in astral mode, `\p{…}` and `\P{…}` always match a full code point rather than a code unit, using surrogate pairs for code points above `U+FFFF`. + +```js +// Using flag A to match astral code points +XRegExp('^\\pS$').test('💩'); // -> false +XRegExp('^\\pS$', 'A').test('💩'); // -> true +XRegExp('(?A)^\\pS$').test('💩'); // -> true +// Using surrogate pair U+D83D U+DCA9 to represent U+1F4A9 (pile of poo) +XRegExp('(?A)^\\pS$').test('\uD83D\uDCA9'); // -> true + +// Implicit flag A +XRegExp.install('astral'); +XRegExp('^\\pS$').test('💩'); // -> true +``` + +Opting in to astral mode disables the use of `\p{…}` and `\P{…}` within character classes. In astral mode, use e.g. `(\pL|[0-9_])+` instead of `[\pL0-9_]+`. + +XRegExp uses Unicode 9.0.0. + +### XRegExp.build + +Build regular expressions using named subpatterns, for readability and pattern reuse: + +```js +const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + hours: XRegExp.build('{{h12}} : | {{h24}}', { + h12: /1[0-2]|0?[1-9]/, + h24: /2[0-3]|[01][0-9]/ + }), + minutes: /^[0-5][0-9]$/ +}); + +time.test('10:59'); // -> true +XRegExp.exec('10:59', time).minutes; // -> '59' +``` + +Named subpatterns can be provided as strings or regex objects. A leading `^` and trailing unescaped `$` are stripped from subpatterns if both are present, which allows embedding independently-useful anchored patterns. `{{…}}` tokens can be quantified as a single unit. Any backreferences in the outer pattern or provided subpatterns are automatically renumbered to work correctly within the larger combined pattern. The syntax `({{name}})` works as shorthand for named capture via `(?{{name}})`. Named subpatterns cannot be embedded within character classes. + +#### XRegExp.tag (included with XRegExp.build) + +Provides tagged template literals that create regexes with XRegExp syntax and flags: + +```js +const h12 = /1[0-2]|0?[1-9]/; +const h24 = /2[0-3]|[01][0-9]/; +const hours = XRegExp.tag('x')`${h12} : | ${h24}`; +const minutes = /^[0-5][0-9]$/; +// Note that explicitly naming the 'minutes' group is required for named backreferences +const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; +time.test('10:59'); // -> true +XRegExp.exec('10:59', time).minutes; // -> '59' +``` + +XRegExp.tag does more than just basic interpolation. For starters, you get all the XRegExp syntax and flags. Even better, since `XRegExp.tag` uses your pattern as a raw string, you no longer need to escape all your backslashes. And since it relies on `XRegExp.build` under the hood, you get all of its extras for free. Leading `^` and trailing unescaped `$` are stripped from interpolated patterns if both are present (to allow embedding independently useful anchored regexes), interpolating into a character class is an error (to avoid unintended meaning in edge cases), interpolated patterns are treated as atomic units when quantified, interpolated strings have their special characters escaped, and any backreferences within an interpolated regex are rewritten to work within the overall pattern. + +### XRegExp.matchRecursive + +Match recursive constructs using XRegExp pattern strings as left and right delimiters: + +```js +const str1 = '(t((e))s)t()(ing)'; +XRegExp.matchRecursive(str1, '\\(', '\\)', 'g'); +// -> ['t((e))s', '', 'ing'] + +// Extended information mode with valueNames +const str2 = 'Here is
an
example'; +XRegExp.matchRecursive(str2, '', '
', 'gi', { + valueNames: ['between', 'left', 'match', 'right'] +}); +/* -> [ +{name: 'between', value: 'Here is ', start: 0, end: 8}, +{name: 'left', value: '
', start: 8, end: 13}, +{name: 'match', value: '
an
', start: 13, end: 27}, +{name: 'right', value: '
', start: 27, end: 33}, +{name: 'between', value: ' example', start: 33, end: 41} +] */ + +// Omitting unneeded parts with null valueNames, and using escapeChar +const str3 = '...{1}.\\{{function(x,y){return {y:x}}}'; +XRegExp.matchRecursive(str3, '{', '}', 'g', { + valueNames: ['literal', null, 'value', null], + escapeChar: '\\' +}); +/* -> [ +{name: 'literal', value: '...', start: 0, end: 3}, +{name: 'value', value: '1', start: 4, end: 5}, +{name: 'literal', value: '.\\{', start: 6, end: 9}, +{name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} +] */ + +// Sticky mode via flag y +const str4 = '<1><<<2>>><3>4<5>'; +XRegExp.matchRecursive(str4, '<', '>', 'gy'); +// -> ['1', '<<2>>', '3'] +``` + +`XRegExp.matchRecursive` throws an error if it scans past an unbalanced delimiter in the target string. + +## Installation and usage + +In browsers (bundle XRegExp with all of its addons): + +```html + +``` + +Using [npm](https://www.npmjs.com/): + +```bash +npm install xregexp +``` + +In [Node.js](http://nodejs.org/): + +```js +const XRegExp = require('xregexp'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({paths: {xregexp: 'xregexp-all'}}, ['xregexp'], (XRegExp) => { + console.log(XRegExp.version); +}); +``` + +## About + +XRegExp copyright 2007-2017 by [Steven Levithan](http://stevenlevithan.com/). Unicode data generators by [Mathias Bynens](http://mathiasbynens.be/), adapted from [unicode-data](http://git.io/unicode). XRegExp's syntax extensions and flags come from [Perl](http://www.perl.org/), [.NET](http://www.microsoft.com/net), etc. + +All code, including addons, tools, and tests, is released under the terms of the [MIT License](http://mit-license.org/). + +Learn more at [xregexp.com](http://xregexp.com/). diff --git a/scripts/node_modules/xregexp/lib/addons/build.js b/scripts/node_modules/xregexp/lib/addons/build.js new file mode 100644 index 00000000..c1cdd338 --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/build.js @@ -0,0 +1,241 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp.build 4.0.0 + * + * Steven Levithan (c) 2012-2017 MIT License + */ + +exports.default = function (XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && + // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? + // Don't recompile, to preserve capture names + value : + // Recompile as XRegExp + XRegExp(value.source, flags) : + // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns['subpattern' + subpatternIndex] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? '{{subpattern' + subpatternIndex + '}}' : ''); + } + + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; + // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); + // Add flags within a leading mode modifier to the overall pattern's flags + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } + + // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + var patternAsRegex = asXRegExp(pattern, addFlagX); + + // 'Caps' is short for 'captures' + var numCaps = 0; + var numPriorCaps = void 0; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName = void 0; + var intro = void 0; + var localCapIndex = void 0; + // Named subpattern + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError('Undefined property ' + $0); + } + // Named subpattern was wrapped in a capturing group + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + intro = '(?<' + (capName || subName) + '>'; + } else { + intro = '(?:'; + } + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if (backref) { + localCapIndex = +backref - 1; + // Rewrite the backreference + return data[subName].names[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + data[subName].names[localCapIndex] + '>' : '\\' + (+backref + numPriorCaps); + } + return match; + }); + return '' + intro + rewrittenSubpattern + ')'; + } + // Capturing group + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if ($4) { + localCapIndex = +$4 - 1; + // Rewrite the backreference + return outerCapNames[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + outerCapNames[localCapIndex] + '>' : '\\' + outerCapsMap[+$4]; + } + return $0; + }); + + return XRegExp(output, flags); + }; +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/matchrecursive.js b/scripts/node_modules/xregexp/lib/addons/matchrecursive.js new file mode 100644 index 00000000..95511e4c --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/matchrecursive.js @@ -0,0 +1,202 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp.matchRecursive 4.0.0 + * + * Steven Levithan (c) 2009-2017 MIT License + */ + +exports.default = function (XRegExp) { + + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; + // Flag `y` is controlled internally + var basicFlags = flags.replace(/y/g, ''); + var escapeChar = options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart = void 0; + var innerStart = void 0; + var leftMatch = void 0; + var rightMatch = void 0; + var esc = void 0; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + escapeChar = XRegExp.escape(escapeChar); + // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + esc = new RegExp('(?:' + escapeChar + '[\\S\\s]|(?:(?!' + + // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { conjunction: 'or' }).source + ')[^' + escapeChar + '])+)+', + // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); + // Keep the leftmost match only + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } + // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } + // If the delimiter matched an empty string, avoid an infinite loop + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-base.js b/scripts/node_modules/xregexp/lib/addons/unicode-base.js new file mode 100644 index 00000000..7cc76c46 --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/unicode-base.js @@ -0,0 +1,247 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Base 4.0.0 + * + * Steven Levithan (c) 2008-2017 MIT License + */ + +exports.default = function (XRegExp) { + + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + + // ==--------------------------== + // Private stuff + // ==--------------------------== + + // Storage for Unicode data + var unicode = {}; + + // Reuse utils + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; + + // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } + + // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } + + // Inverts a list of ordered BMP characters and ranges + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + if (start > lastEnd + 1) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (start > lastEnd + 2) { + output += '-\\u' + pad4(hex(start - 1)); + } + } + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } + + // Generates an inverted BMP range on first use + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } + + // Combines and optionally negates BMP and astral data + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); + } + if (item.astral) { + combined += item.astral; + } + if (item.isBmpLast && item.bmp) { + combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; + } + + // Astral Unicode tokens always match a code point, never a code unit + return isNegated ? '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : '(?:' + combined + ')'; + } + + // Builds a complete astral pattern on first use + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } + + // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + XRegExp.addToken( + // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; + // Negated via \P{..} or \p{^..} + var isNegated = match[1] === 'P' || !!match[2]; + // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + var isAstralMode = flags.indexOf('A') !== -1; + // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + var slug = normalize(match[4] || match[3]); + // Token data object + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } + + // Switch to the negated form of the referenced Unicode token + if (item.inverseOf) { + slug = normalize(item.inverseOf); + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); + } + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : (isNegated ? '[^' : '[') + item.bmp + ']'; + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var item = void 0; + + for (var i = 0; i < data.length; ++i) { + item = data[i]; + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + unicode[normalize(item.name)] = item; + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js b/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js new file mode 100644 index 00000000..69704aad --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js @@ -0,0 +1,852 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Blocks 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData([{ + name: 'InAdlam', + astral: '\uD83A[\uDD00-\uDD5F]' + }, { + name: 'InAegean_Numbers', + astral: '\uD800[\uDD00-\uDD3F]' + }, { + name: 'InAhom', + astral: '\uD805[\uDF00-\uDF3F]' + }, { + name: 'InAlchemical_Symbols', + astral: '\uD83D[\uDF00-\uDF7F]' + }, { + name: 'InAlphabetic_Presentation_Forms', + bmp: '\uFB00-\uFB4F' + }, { + name: 'InAnatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE7F]' + }, { + name: 'InAncient_Greek_Musical_Notation', + astral: '\uD834[\uDE00-\uDE4F]' + }, { + name: 'InAncient_Greek_Numbers', + astral: '\uD800[\uDD40-\uDD8F]' + }, { + name: 'InAncient_Symbols', + astral: '\uD800[\uDD90-\uDDCF]' + }, { + name: 'InArabic', + bmp: '\u0600-\u06FF' + }, { + name: 'InArabic_Extended_A', + bmp: '\u08A0-\u08FF' + }, { + name: 'InArabic_Mathematical_Alphabetic_Symbols', + astral: '\uD83B[\uDE00-\uDEFF]' + }, { + name: 'InArabic_Presentation_Forms_A', + bmp: '\uFB50-\uFDFF' + }, { + name: 'InArabic_Presentation_Forms_B', + bmp: '\uFE70-\uFEFF' + }, { + name: 'InArabic_Supplement', + bmp: '\u0750-\u077F' + }, { + name: 'InArmenian', + bmp: '\u0530-\u058F' + }, { + name: 'InArrows', + bmp: '\u2190-\u21FF' + }, { + name: 'InAvestan', + astral: '\uD802[\uDF00-\uDF3F]' + }, { + name: 'InBalinese', + bmp: '\u1B00-\u1B7F' + }, { + name: 'InBamum', + bmp: '\uA6A0-\uA6FF' + }, { + name: 'InBamum_Supplement', + astral: '\uD81A[\uDC00-\uDE3F]' + }, { + name: 'InBasic_Latin', + bmp: '\0-\x7F' + }, { + name: 'InBassa_Vah', + astral: '\uD81A[\uDED0-\uDEFF]' + }, { + name: 'InBatak', + bmp: '\u1BC0-\u1BFF' + }, { + name: 'InBengali', + bmp: '\u0980-\u09FF' + }, { + name: 'InBhaiksuki', + astral: '\uD807[\uDC00-\uDC6F]' + }, { + name: 'InBlock_Elements', + bmp: '\u2580-\u259F' + }, { + name: 'InBopomofo', + bmp: '\u3100-\u312F' + }, { + name: 'InBopomofo_Extended', + bmp: '\u31A0-\u31BF' + }, { + name: 'InBox_Drawing', + bmp: '\u2500-\u257F' + }, { + name: 'InBrahmi', + astral: '\uD804[\uDC00-\uDC7F]' + }, { + name: 'InBraille_Patterns', + bmp: '\u2800-\u28FF' + }, { + name: 'InBuginese', + bmp: '\u1A00-\u1A1F' + }, { + name: 'InBuhid', + bmp: '\u1740-\u175F' + }, { + name: 'InByzantine_Musical_Symbols', + astral: '\uD834[\uDC00-\uDCFF]' + }, { + name: 'InCJK_Compatibility', + bmp: '\u3300-\u33FF' + }, { + name: 'InCJK_Compatibility_Forms', + bmp: '\uFE30-\uFE4F' + }, { + name: 'InCJK_Compatibility_Ideographs', + bmp: '\uF900-\uFAFF' + }, { + name: 'InCJK_Compatibility_Ideographs_Supplement', + astral: '\uD87E[\uDC00-\uDE1F]' + }, { + name: 'InCJK_Radicals_Supplement', + bmp: '\u2E80-\u2EFF' + }, { + name: 'InCJK_Strokes', + bmp: '\u31C0-\u31EF' + }, { + name: 'InCJK_Symbols_and_Punctuation', + bmp: '\u3000-\u303F' + }, { + name: 'InCJK_Unified_Ideographs', + bmp: '\u4E00-\u9FFF' + }, { + name: 'InCJK_Unified_Ideographs_Extension_A', + bmp: '\u3400-\u4DBF' + }, { + name: 'InCJK_Unified_Ideographs_Extension_B', + astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_C', + astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_D', + astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_E', + astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, { + name: 'InCarian', + astral: '\uD800[\uDEA0-\uDEDF]' + }, { + name: 'InCaucasian_Albanian', + astral: '\uD801[\uDD30-\uDD6F]' + }, { + name: 'InChakma', + astral: '\uD804[\uDD00-\uDD4F]' + }, { + name: 'InCham', + bmp: '\uAA00-\uAA5F' + }, { + name: 'InCherokee', + bmp: '\u13A0-\u13FF' + }, { + name: 'InCherokee_Supplement', + bmp: '\uAB70-\uABBF' + }, { + name: 'InCombining_Diacritical_Marks', + bmp: '\u0300-\u036F' + }, { + name: 'InCombining_Diacritical_Marks_Extended', + bmp: '\u1AB0-\u1AFF' + }, { + name: 'InCombining_Diacritical_Marks_Supplement', + bmp: '\u1DC0-\u1DFF' + }, { + name: 'InCombining_Diacritical_Marks_for_Symbols', + bmp: '\u20D0-\u20FF' + }, { + name: 'InCombining_Half_Marks', + bmp: '\uFE20-\uFE2F' + }, { + name: 'InCommon_Indic_Number_Forms', + bmp: '\uA830-\uA83F' + }, { + name: 'InControl_Pictures', + bmp: '\u2400-\u243F' + }, { + name: 'InCoptic', + bmp: '\u2C80-\u2CFF' + }, { + name: 'InCoptic_Epact_Numbers', + astral: '\uD800[\uDEE0-\uDEFF]' + }, { + name: 'InCounting_Rod_Numerals', + astral: '\uD834[\uDF60-\uDF7F]' + }, { + name: 'InCuneiform', + astral: '\uD808[\uDC00-\uDFFF]' + }, { + name: 'InCuneiform_Numbers_and_Punctuation', + astral: '\uD809[\uDC00-\uDC7F]' + }, { + name: 'InCurrency_Symbols', + bmp: '\u20A0-\u20CF' + }, { + name: 'InCypriot_Syllabary', + astral: '\uD802[\uDC00-\uDC3F]' + }, { + name: 'InCyrillic', + bmp: '\u0400-\u04FF' + }, { + name: 'InCyrillic_Extended_A', + bmp: '\u2DE0-\u2DFF' + }, { + name: 'InCyrillic_Extended_B', + bmp: '\uA640-\uA69F' + }, { + name: 'InCyrillic_Extended_C', + bmp: '\u1C80-\u1C8F' + }, { + name: 'InCyrillic_Supplement', + bmp: '\u0500-\u052F' + }, { + name: 'InDeseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, { + name: 'InDevanagari', + bmp: '\u0900-\u097F' + }, { + name: 'InDevanagari_Extended', + bmp: '\uA8E0-\uA8FF' + }, { + name: 'InDingbats', + bmp: '\u2700-\u27BF' + }, { + name: 'InDomino_Tiles', + astral: '\uD83C[\uDC30-\uDC9F]' + }, { + name: 'InDuployan', + astral: '\uD82F[\uDC00-\uDC9F]' + }, { + name: 'InEarly_Dynastic_Cuneiform', + astral: '\uD809[\uDC80-\uDD4F]' + }, { + name: 'InEgyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, { + name: 'InElbasan', + astral: '\uD801[\uDD00-\uDD2F]' + }, { + name: 'InEmoticons', + astral: '\uD83D[\uDE00-\uDE4F]' + }, { + name: 'InEnclosed_Alphanumeric_Supplement', + astral: '\uD83C[\uDD00-\uDDFF]' + }, { + name: 'InEnclosed_Alphanumerics', + bmp: '\u2460-\u24FF' + }, { + name: 'InEnclosed_CJK_Letters_and_Months', + bmp: '\u3200-\u32FF' + }, { + name: 'InEnclosed_Ideographic_Supplement', + astral: '\uD83C[\uDE00-\uDEFF]' + }, { + name: 'InEthiopic', + bmp: '\u1200-\u137F' + }, { + name: 'InEthiopic_Extended', + bmp: '\u2D80-\u2DDF' + }, { + name: 'InEthiopic_Extended_A', + bmp: '\uAB00-\uAB2F' + }, { + name: 'InEthiopic_Supplement', + bmp: '\u1380-\u139F' + }, { + name: 'InGeneral_Punctuation', + bmp: '\u2000-\u206F' + }, { + name: 'InGeometric_Shapes', + bmp: '\u25A0-\u25FF' + }, { + name: 'InGeometric_Shapes_Extended', + astral: '\uD83D[\uDF80-\uDFFF]' + }, { + name: 'InGeorgian', + bmp: '\u10A0-\u10FF' + }, { + name: 'InGeorgian_Supplement', + bmp: '\u2D00-\u2D2F' + }, { + name: 'InGlagolitic', + bmp: '\u2C00-\u2C5F' + }, { + name: 'InGlagolitic_Supplement', + astral: '\uD838[\uDC00-\uDC2F]' + }, { + name: 'InGothic', + astral: '\uD800[\uDF30-\uDF4F]' + }, { + name: 'InGrantha', + astral: '\uD804[\uDF00-\uDF7F]' + }, { + name: 'InGreek_Extended', + bmp: '\u1F00-\u1FFF' + }, { + name: 'InGreek_and_Coptic', + bmp: '\u0370-\u03FF' + }, { + name: 'InGujarati', + bmp: '\u0A80-\u0AFF' + }, { + name: 'InGurmukhi', + bmp: '\u0A00-\u0A7F' + }, { + name: 'InHalfwidth_and_Fullwidth_Forms', + bmp: '\uFF00-\uFFEF' + }, { + name: 'InHangul_Compatibility_Jamo', + bmp: '\u3130-\u318F' + }, { + name: 'InHangul_Jamo', + bmp: '\u1100-\u11FF' + }, { + name: 'InHangul_Jamo_Extended_A', + bmp: '\uA960-\uA97F' + }, { + name: 'InHangul_Jamo_Extended_B', + bmp: '\uD7B0-\uD7FF' + }, { + name: 'InHangul_Syllables', + bmp: '\uAC00-\uD7AF' + }, { + name: 'InHanunoo', + bmp: '\u1720-\u173F' + }, { + name: 'InHatran', + astral: '\uD802[\uDCE0-\uDCFF]' + }, { + name: 'InHebrew', + bmp: '\u0590-\u05FF' + }, { + name: 'InHigh_Private_Use_Surrogates', + bmp: '\uDB80-\uDBFF' + }, { + name: 'InHigh_Surrogates', + bmp: '\uD800-\uDB7F' + }, { + name: 'InHiragana', + bmp: '\u3040-\u309F' + }, { + name: 'InIPA_Extensions', + bmp: '\u0250-\u02AF' + }, { + name: 'InIdeographic_Description_Characters', + bmp: '\u2FF0-\u2FFF' + }, { + name: 'InIdeographic_Symbols_and_Punctuation', + astral: '\uD81B[\uDFE0-\uDFFF]' + }, { + name: 'InImperial_Aramaic', + astral: '\uD802[\uDC40-\uDC5F]' + }, { + name: 'InInscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF7F]' + }, { + name: 'InInscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF5F]' + }, { + name: 'InJavanese', + bmp: '\uA980-\uA9DF' + }, { + name: 'InKaithi', + astral: '\uD804[\uDC80-\uDCCF]' + }, { + name: 'InKana_Supplement', + astral: '\uD82C[\uDC00-\uDCFF]' + }, { + name: 'InKanbun', + bmp: '\u3190-\u319F' + }, { + name: 'InKangxi_Radicals', + bmp: '\u2F00-\u2FDF' + }, { + name: 'InKannada', + bmp: '\u0C80-\u0CFF' + }, { + name: 'InKatakana', + bmp: '\u30A0-\u30FF' + }, { + name: 'InKatakana_Phonetic_Extensions', + bmp: '\u31F0-\u31FF' + }, { + name: 'InKayah_Li', + bmp: '\uA900-\uA92F' + }, { + name: 'InKharoshthi', + astral: '\uD802[\uDE00-\uDE5F]' + }, { + name: 'InKhmer', + bmp: '\u1780-\u17FF' + }, { + name: 'InKhmer_Symbols', + bmp: '\u19E0-\u19FF' + }, { + name: 'InKhojki', + astral: '\uD804[\uDE00-\uDE4F]' + }, { + name: 'InKhudawadi', + astral: '\uD804[\uDEB0-\uDEFF]' + }, { + name: 'InLao', + bmp: '\u0E80-\u0EFF' + }, { + name: 'InLatin_Extended_Additional', + bmp: '\u1E00-\u1EFF' + }, { + name: 'InLatin_Extended_A', + bmp: '\u0100-\u017F' + }, { + name: 'InLatin_Extended_B', + bmp: '\u0180-\u024F' + }, { + name: 'InLatin_Extended_C', + bmp: '\u2C60-\u2C7F' + }, { + name: 'InLatin_Extended_D', + bmp: '\uA720-\uA7FF' + }, { + name: 'InLatin_Extended_E', + bmp: '\uAB30-\uAB6F' + }, { + name: 'InLatin_1_Supplement', + bmp: '\x80-\xFF' + }, { + name: 'InLepcha', + bmp: '\u1C00-\u1C4F' + }, { + name: 'InLetterlike_Symbols', + bmp: '\u2100-\u214F' + }, { + name: 'InLimbu', + bmp: '\u1900-\u194F' + }, { + name: 'InLinear_A', + astral: '\uD801[\uDE00-\uDF7F]' + }, { + name: 'InLinear_B_Ideograms', + astral: '\uD800[\uDC80-\uDCFF]' + }, { + name: 'InLinear_B_Syllabary', + astral: '\uD800[\uDC00-\uDC7F]' + }, { + name: 'InLisu', + bmp: '\uA4D0-\uA4FF' + }, { + name: 'InLow_Surrogates', + bmp: '\uDC00-\uDFFF' + }, { + name: 'InLycian', + astral: '\uD800[\uDE80-\uDE9F]' + }, { + name: 'InLydian', + astral: '\uD802[\uDD20-\uDD3F]' + }, { + name: 'InMahajani', + astral: '\uD804[\uDD50-\uDD7F]' + }, { + name: 'InMahjong_Tiles', + astral: '\uD83C[\uDC00-\uDC2F]' + }, { + name: 'InMalayalam', + bmp: '\u0D00-\u0D7F' + }, { + name: 'InMandaic', + bmp: '\u0840-\u085F' + }, { + name: 'InManichaean', + astral: '\uD802[\uDEC0-\uDEFF]' + }, { + name: 'InMarchen', + astral: '\uD807[\uDC70-\uDCBF]' + }, { + name: 'InMathematical_Alphanumeric_Symbols', + astral: '\uD835[\uDC00-\uDFFF]' + }, { + name: 'InMathematical_Operators', + bmp: '\u2200-\u22FF' + }, { + name: 'InMeetei_Mayek', + bmp: '\uABC0-\uABFF' + }, { + name: 'InMeetei_Mayek_Extensions', + bmp: '\uAAE0-\uAAFF' + }, { + name: 'InMende_Kikakui', + astral: '\uD83A[\uDC00-\uDCDF]' + }, { + name: 'InMeroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDFF]' + }, { + name: 'InMeroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, { + name: 'InMiao', + astral: '\uD81B[\uDF00-\uDF9F]' + }, { + name: 'InMiscellaneous_Mathematical_Symbols_A', + bmp: '\u27C0-\u27EF' + }, { + name: 'InMiscellaneous_Mathematical_Symbols_B', + bmp: '\u2980-\u29FF' + }, { + name: 'InMiscellaneous_Symbols', + bmp: '\u2600-\u26FF' + }, { + name: 'InMiscellaneous_Symbols_and_Arrows', + bmp: '\u2B00-\u2BFF' + }, { + name: 'InMiscellaneous_Symbols_and_Pictographs', + astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, { + name: 'InMiscellaneous_Technical', + bmp: '\u2300-\u23FF' + }, { + name: 'InModi', + astral: '\uD805[\uDE00-\uDE5F]' + }, { + name: 'InModifier_Tone_Letters', + bmp: '\uA700-\uA71F' + }, { + name: 'InMongolian', + bmp: '\u1800-\u18AF' + }, { + name: 'InMongolian_Supplement', + astral: '\uD805[\uDE60-\uDE7F]' + }, { + name: 'InMro', + astral: '\uD81A[\uDE40-\uDE6F]' + }, { + name: 'InMultani', + astral: '\uD804[\uDE80-\uDEAF]' + }, { + name: 'InMusical_Symbols', + astral: '\uD834[\uDD00-\uDDFF]' + }, { + name: 'InMyanmar', + bmp: '\u1000-\u109F' + }, { + name: 'InMyanmar_Extended_A', + bmp: '\uAA60-\uAA7F' + }, { + name: 'InMyanmar_Extended_B', + bmp: '\uA9E0-\uA9FF' + }, { + name: 'InNKo', + bmp: '\u07C0-\u07FF' + }, { + name: 'InNabataean', + astral: '\uD802[\uDC80-\uDCAF]' + }, { + name: 'InNew_Tai_Lue', + bmp: '\u1980-\u19DF' + }, { + name: 'InNewa', + astral: '\uD805[\uDC00-\uDC7F]' + }, { + name: 'InNumber_Forms', + bmp: '\u2150-\u218F' + }, { + name: 'InOgham', + bmp: '\u1680-\u169F' + }, { + name: 'InOl_Chiki', + bmp: '\u1C50-\u1C7F' + }, { + name: 'InOld_Hungarian', + astral: '\uD803[\uDC80-\uDCFF]' + }, { + name: 'InOld_Italic', + astral: '\uD800[\uDF00-\uDF2F]' + }, { + name: 'InOld_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, { + name: 'InOld_Permic', + astral: '\uD800[\uDF50-\uDF7F]' + }, { + name: 'InOld_Persian', + astral: '\uD800[\uDFA0-\uDFDF]' + }, { + name: 'InOld_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, { + name: 'InOld_Turkic', + astral: '\uD803[\uDC00-\uDC4F]' + }, { + name: 'InOptical_Character_Recognition', + bmp: '\u2440-\u245F' + }, { + name: 'InOriya', + bmp: '\u0B00-\u0B7F' + }, { + name: 'InOrnamental_Dingbats', + astral: '\uD83D[\uDE50-\uDE7F]' + }, { + name: 'InOsage', + astral: '\uD801[\uDCB0-\uDCFF]' + }, { + name: 'InOsmanya', + astral: '\uD801[\uDC80-\uDCAF]' + }, { + name: 'InPahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF8F]' + }, { + name: 'InPalmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, { + name: 'InPau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEFF]' + }, { + name: 'InPhags_pa', + bmp: '\uA840-\uA87F' + }, { + name: 'InPhaistos_Disc', + astral: '\uD800[\uDDD0-\uDDFF]' + }, { + name: 'InPhoenician', + astral: '\uD802[\uDD00-\uDD1F]' + }, { + name: 'InPhonetic_Extensions', + bmp: '\u1D00-\u1D7F' + }, { + name: 'InPhonetic_Extensions_Supplement', + bmp: '\u1D80-\u1DBF' + }, { + name: 'InPlaying_Cards', + astral: '\uD83C[\uDCA0-\uDCFF]' + }, { + name: 'InPrivate_Use_Area', + bmp: '\uE000-\uF8FF' + }, { + name: 'InPsalter_Pahlavi', + astral: '\uD802[\uDF80-\uDFAF]' + }, { + name: 'InRejang', + bmp: '\uA930-\uA95F' + }, { + name: 'InRumi_Numeral_Symbols', + astral: '\uD803[\uDE60-\uDE7F]' + }, { + name: 'InRunic', + bmp: '\u16A0-\u16FF' + }, { + name: 'InSamaritan', + bmp: '\u0800-\u083F' + }, { + name: 'InSaurashtra', + bmp: '\uA880-\uA8DF' + }, { + name: 'InSharada', + astral: '\uD804[\uDD80-\uDDDF]' + }, { + name: 'InShavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, { + name: 'InShorthand_Format_Controls', + astral: '\uD82F[\uDCA0-\uDCAF]' + }, { + name: 'InSiddham', + astral: '\uD805[\uDD80-\uDDFF]' + }, { + name: 'InSinhala', + bmp: '\u0D80-\u0DFF' + }, { + name: 'InSinhala_Archaic_Numbers', + astral: '\uD804[\uDDE0-\uDDFF]' + }, { + name: 'InSmall_Form_Variants', + bmp: '\uFE50-\uFE6F' + }, { + name: 'InSora_Sompeng', + astral: '\uD804[\uDCD0-\uDCFF]' + }, { + name: 'InSpacing_Modifier_Letters', + bmp: '\u02B0-\u02FF' + }, { + name: 'InSpecials', + bmp: '\uFFF0-\uFFFF' + }, { + name: 'InSundanese', + bmp: '\u1B80-\u1BBF' + }, { + name: 'InSundanese_Supplement', + bmp: '\u1CC0-\u1CCF' + }, { + name: 'InSuperscripts_and_Subscripts', + bmp: '\u2070-\u209F' + }, { + name: 'InSupplemental_Arrows_A', + bmp: '\u27F0-\u27FF' + }, { + name: 'InSupplemental_Arrows_B', + bmp: '\u2900-\u297F' + }, { + name: 'InSupplemental_Arrows_C', + astral: '\uD83E[\uDC00-\uDCFF]' + }, { + name: 'InSupplemental_Mathematical_Operators', + bmp: '\u2A00-\u2AFF' + }, { + name: 'InSupplemental_Punctuation', + bmp: '\u2E00-\u2E7F' + }, { + name: 'InSupplemental_Symbols_and_Pictographs', + astral: '\uD83E[\uDD00-\uDDFF]' + }, { + name: 'InSupplementary_Private_Use_Area_A', + astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, { + name: 'InSupplementary_Private_Use_Area_B', + astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, { + name: 'InSutton_SignWriting', + astral: '\uD836[\uDC00-\uDEAF]' + }, { + name: 'InSyloti_Nagri', + bmp: '\uA800-\uA82F' + }, { + name: 'InSyriac', + bmp: '\u0700-\u074F' + }, { + name: 'InTagalog', + bmp: '\u1700-\u171F' + }, { + name: 'InTagbanwa', + bmp: '\u1760-\u177F' + }, { + name: 'InTags', + astral: '\uDB40[\uDC00-\uDC7F]' + }, { + name: 'InTai_Le', + bmp: '\u1950-\u197F' + }, { + name: 'InTai_Tham', + bmp: '\u1A20-\u1AAF' + }, { + name: 'InTai_Viet', + bmp: '\uAA80-\uAADF' + }, { + name: 'InTai_Xuan_Jing_Symbols', + astral: '\uD834[\uDF00-\uDF5F]' + }, { + name: 'InTakri', + astral: '\uD805[\uDE80-\uDECF]' + }, { + name: 'InTamil', + bmp: '\u0B80-\u0BFF' + }, { + name: 'InTangut', + astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, { + name: 'InTangut_Components', + astral: '\uD822[\uDC00-\uDEFF]' + }, { + name: 'InTelugu', + bmp: '\u0C00-\u0C7F' + }, { + name: 'InThaana', + bmp: '\u0780-\u07BF' + }, { + name: 'InThai', + bmp: '\u0E00-\u0E7F' + }, { + name: 'InTibetan', + bmp: '\u0F00-\u0FFF' + }, { + name: 'InTifinagh', + bmp: '\u2D30-\u2D7F' + }, { + name: 'InTirhuta', + astral: '\uD805[\uDC80-\uDCDF]' + }, { + name: 'InTransport_and_Map_Symbols', + astral: '\uD83D[\uDE80-\uDEFF]' + }, { + name: 'InUgaritic', + astral: '\uD800[\uDF80-\uDF9F]' + }, { + name: 'InUnified_Canadian_Aboriginal_Syllabics', + bmp: '\u1400-\u167F' + }, { + name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + bmp: '\u18B0-\u18FF' + }, { + name: 'InVai', + bmp: '\uA500-\uA63F' + }, { + name: 'InVariation_Selectors', + bmp: '\uFE00-\uFE0F' + }, { + name: 'InVariation_Selectors_Supplement', + astral: '\uDB40[\uDD00-\uDDEF]' + }, { + name: 'InVedic_Extensions', + bmp: '\u1CD0-\u1CFF' + }, { + name: 'InVertical_Forms', + bmp: '\uFE10-\uFE1F' + }, { + name: 'InWarang_Citi', + astral: '\uD806[\uDCA0-\uDCFF]' + }, { + name: 'InYi_Radicals', + bmp: '\uA490-\uA4CF' + }, { + name: 'InYi_Syllables', + bmp: '\uA000-\uA48F' + }, { + name: 'InYijing_Hexagram_Symbols', + bmp: '\u4DC0-\u4DFF' + }]); +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-categories.js b/scripts/node_modules/xregexp/lib/addons/unicode-categories.js new file mode 100644 index 00000000..2ab93179 --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/unicode-categories.js @@ -0,0 +1,204 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Categories 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData([{ + name: 'C', + alias: 'Other', + isBmpLast: true, + bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, { + name: 'Cc', + alias: 'Control', + bmp: '\0-\x1F\x7F-\x9F' + }, { + name: 'Cf', + alias: 'Format', + bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, { + name: 'Cn', + alias: 'Unassigned', + bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, { + name: 'Co', + alias: 'Private_Use', + bmp: '\uE000-\uF8FF', + astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, { + name: 'Cs', + alias: 'Surrogate', + bmp: '\uD800-\uDFFF' + }, { + name: 'L', + alias: 'Letter', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Ll', + alias: 'Lowercase_Letter', + bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, { + name: 'Lm', + alias: 'Modifier_Letter', + bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' + }, { + name: 'Lo', + alias: 'Other_Letter', + bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Lt', + alias: 'Titlecase_Letter', + bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, { + name: 'Lu', + alias: 'Uppercase_Letter', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, { + name: 'M', + alias: 'Mark', + bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'Mc', + alias: 'Spacing_Mark', + bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, { + name: 'Me', + alias: 'Enclosing_Mark', + bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, { + name: 'Mn', + alias: 'Nonspacing_Mark', + bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'N', + alias: 'Number', + bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' + }, { + name: 'Nd', + alias: 'Decimal_Number', + bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, { + name: 'Nl', + alias: 'Letter_Number', + bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, { + name: 'No', + alias: 'Other_Number', + bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' + }, { + name: 'P', + alias: 'Punctuation', + bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, { + name: 'Pc', + alias: 'Connector_Punctuation', + bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, { + name: 'Pd', + alias: 'Dash_Punctuation', + bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, { + name: 'Pe', + alias: 'Close_Punctuation', + bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, { + name: 'Pf', + alias: 'Final_Punctuation', + bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, { + name: 'Pi', + alias: 'Initial_Punctuation', + bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, { + name: 'Po', + alias: 'Other_Punctuation', + bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, { + name: 'Ps', + alias: 'Open_Punctuation', + bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, { + name: 'S', + alias: 'Symbol', + bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, { + name: 'Sc', + alias: 'Currency_Symbol', + bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' + }, { + name: 'Sk', + alias: 'Modifier_Symbol', + bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + astral: '\uD83C[\uDFFB-\uDFFF]' + }, { + name: 'Sm', + alias: 'Math_Symbol', + bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, { + name: 'So', + alias: 'Other_Symbol', + bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, { + name: 'Z', + alias: 'Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, { + name: 'Zl', + alias: 'Line_Separator', + bmp: '\u2028' + }, { + name: 'Zp', + alias: 'Paragraph_Separator', + bmp: '\u2029' + }, { + name: 'Zs', + alias: 'Space_Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + }]); +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-properties.js b/scripts/node_modules/xregexp/lib/addons/unicode-properties.js new file mode 100644 index 00000000..81d5a324 --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/unicode-properties.js @@ -0,0 +1,103 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Properties 4.0.0 + * + * Steven Levithan (c) 2012-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = [{ + name: 'ASCII', + bmp: '\0-\x7F' + }, { + name: 'Alphabetic', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Any', + isBmpLast: true, + bmp: '\0-\uFFFF', + astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, { + name: 'Default_Ignorable_Code_Point', + bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, { + name: 'Lowercase', + bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, { + name: 'Noncharacter_Code_Point', + bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', + astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, { + name: 'Uppercase', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, { + name: 'White_Space', + bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }]; + + // Add non-generated data + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + + XRegExp.addUnicodeData(unicodeData); +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js b/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js new file mode 100644 index 00000000..f1a77838 --- /dev/null +++ b/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js @@ -0,0 +1,454 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Scripts 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData([{ + name: 'Adlam', + astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, { + name: 'Ahom', + astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, { + name: 'Anatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE46]' + }, { + name: 'Arabic', + bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, { + name: 'Armenian', + bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' + }, { + name: 'Avestan', + astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, { + name: 'Balinese', + bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' + }, { + name: 'Bamum', + bmp: '\uA6A0-\uA6F7', + astral: '\uD81A[\uDC00-\uDE38]' + }, { + name: 'Bassa_Vah', + astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, { + name: 'Batak', + bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, { + name: 'Bengali', + bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' + }, { + name: 'Bhaiksuki', + astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, { + name: 'Bopomofo', + bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' + }, { + name: 'Brahmi', + astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, { + name: 'Braille', + bmp: '\u2800-\u28FF' + }, { + name: 'Buginese', + bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' + }, { + name: 'Buhid', + bmp: '\u1740-\u1753' + }, { + name: 'Canadian_Aboriginal', + bmp: '\u1400-\u167F\u18B0-\u18F5' + }, { + name: 'Carian', + astral: '\uD800[\uDEA0-\uDED0]' + }, { + name: 'Caucasian_Albanian', + astral: '\uD801[\uDD30-\uDD63\uDD6F]' + }, { + name: 'Chakma', + astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' + }, { + name: 'Cham', + bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, { + name: 'Cherokee', + bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, { + name: 'Common', + bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, { + name: 'Coptic', + bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, { + name: 'Cuneiform', + astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, { + name: 'Cypriot', + astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, { + name: 'Cyrillic', + bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, { + name: 'Deseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, { + name: 'Devanagari', + bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' + }, { + name: 'Duployan', + astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, { + name: 'Egyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, { + name: 'Elbasan', + astral: '\uD801[\uDD00-\uDD27]' + }, { + name: 'Ethiopic', + bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, { + name: 'Georgian', + bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' + }, { + name: 'Glagolitic', + bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', + astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, { + name: 'Gothic', + astral: '\uD800[\uDF30-\uDF4A]' + }, { + name: 'Grantha', + astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, { + name: 'Greek', + bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, { + name: 'Gujarati', + bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' + }, { + name: 'Gurmukhi', + bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' + }, { + name: 'Han', + bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', + astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Hangul', + bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, { + name: 'Hanunoo', + bmp: '\u1720-\u1734' + }, { + name: 'Hatran', + astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, { + name: 'Hebrew', + bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, { + name: 'Hiragana', + bmp: '\u3041-\u3096\u309D-\u309F', + astral: '\uD82C\uDC01|\uD83C\uDE00' + }, { + name: 'Imperial_Aramaic', + astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, { + name: 'Inherited', + bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'Inscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, { + name: 'Inscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, { + name: 'Javanese', + bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, { + name: 'Kaithi', + astral: '\uD804[\uDC80-\uDCC1]' + }, { + name: 'Kannada', + bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, { + name: 'Katakana', + bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + astral: '\uD82C\uDC00' + }, { + name: 'Kayah_Li', + bmp: '\uA900-\uA92D\uA92F' + }, { + name: 'Kharoshthi', + astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' + }, { + name: 'Khmer', + bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, { + name: 'Khojki', + astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, { + name: 'Khudawadi', + astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, { + name: 'Lao', + bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, { + name: 'Latin', + bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, { + name: 'Lepcha', + bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, { + name: 'Limbu', + bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, { + name: 'Linear_A', + astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, { + name: 'Linear_B', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, { + name: 'Lisu', + bmp: '\uA4D0-\uA4FF' + }, { + name: 'Lycian', + astral: '\uD800[\uDE80-\uDE9C]' + }, { + name: 'Lydian', + astral: '\uD802[\uDD20-\uDD39\uDD3F]' + }, { + name: 'Mahajani', + astral: '\uD804[\uDD50-\uDD76]' + }, { + name: 'Malayalam', + bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, { + name: 'Mandaic', + bmp: '\u0840-\u085B\u085E' + }, { + name: 'Manichaean', + astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, { + name: 'Marchen', + astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, { + name: 'Meetei_Mayek', + bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, { + name: 'Mende_Kikakui', + astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, { + name: 'Meroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, { + name: 'Meroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, { + name: 'Miao', + astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, { + name: 'Modi', + astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, { + name: 'Mongolian', + bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', + astral: '\uD805[\uDE60-\uDE6C]' + }, { + name: 'Mro', + astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, { + name: 'Multani', + astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, { + name: 'Myanmar', + bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, { + name: 'Nabataean', + astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, { + name: 'New_Tai_Lue', + bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, { + name: 'Newa', + astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' + }, { + name: 'Nko', + bmp: '\u07C0-\u07FA' + }, { + name: 'Ogham', + bmp: '\u1680-\u169C' + }, { + name: 'Ol_Chiki', + bmp: '\u1C50-\u1C7F' + }, { + name: 'Old_Hungarian', + astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, { + name: 'Old_Italic', + astral: '\uD800[\uDF00-\uDF23]' + }, { + name: 'Old_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, { + name: 'Old_Permic', + astral: '\uD800[\uDF50-\uDF7A]' + }, { + name: 'Old_Persian', + astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, { + name: 'Old_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, { + name: 'Old_Turkic', + astral: '\uD803[\uDC00-\uDC48]' + }, { + name: 'Oriya', + bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, { + name: 'Osage', + astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, { + name: 'Osmanya', + astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, { + name: 'Pahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, { + name: 'Palmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, { + name: 'Pau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEF8]' + }, { + name: 'Phags_Pa', + bmp: '\uA840-\uA877' + }, { + name: 'Phoenician', + astral: '\uD802[\uDD00-\uDD1B\uDD1F]' + }, { + name: 'Psalter_Pahlavi', + astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, { + name: 'Rejang', + bmp: '\uA930-\uA953\uA95F' + }, { + name: 'Runic', + bmp: '\u16A0-\u16EA\u16EE-\u16F8' + }, { + name: 'Samaritan', + bmp: '\u0800-\u082D\u0830-\u083E' + }, { + name: 'Saurashtra', + bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' + }, { + name: 'Sharada', + astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, { + name: 'Shavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, { + name: 'Siddham', + astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, { + name: 'SignWriting', + astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, { + name: 'Sinhala', + bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + astral: '\uD804[\uDDE1-\uDDF4]' + }, { + name: 'Sora_Sompeng', + astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, { + name: 'Sundanese', + bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, { + name: 'Syloti_Nagri', + bmp: '\uA800-\uA82B' + }, { + name: 'Syriac', + bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' + }, { + name: 'Tagalog', + bmp: '\u1700-\u170C\u170E-\u1714' + }, { + name: 'Tagbanwa', + bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, { + name: 'Tai_Le', + bmp: '\u1950-\u196D\u1970-\u1974' + }, { + name: 'Tai_Tham', + bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, { + name: 'Tai_Viet', + bmp: '\uAA80-\uAAC2\uAADB-\uAADF' + }, { + name: 'Takri', + astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, { + name: 'Tamil', + bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, { + name: 'Tangut', + astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' + }, { + name: 'Telugu', + bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, { + name: 'Thaana', + bmp: '\u0780-\u07B1' + }, { + name: 'Thai', + bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' + }, { + name: 'Tibetan', + bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, { + name: 'Tifinagh', + bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, { + name: 'Tirhuta', + astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, { + name: 'Ugaritic', + astral: '\uD800[\uDF80-\uDF9D\uDF9F]' + }, { + name: 'Vai', + bmp: '\uA500-\uA62B' + }, { + name: 'Warang_Citi', + astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, { + name: 'Yi', + bmp: '\uA000-\uA48C\uA490-\uA4C6' + }]); +}; + +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/index.js b/scripts/node_modules/xregexp/lib/index.js new file mode 100644 index 00000000..232b2f6d --- /dev/null +++ b/scripts/node_modules/xregexp/lib/index.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _xregexp = require('./xregexp'); + +var _xregexp2 = _interopRequireDefault(_xregexp); + +var _build = require('./addons/build'); + +var _build2 = _interopRequireDefault(_build); + +var _matchrecursive = require('./addons/matchrecursive'); + +var _matchrecursive2 = _interopRequireDefault(_matchrecursive); + +var _unicodeBase = require('./addons/unicode-base'); + +var _unicodeBase2 = _interopRequireDefault(_unicodeBase); + +var _unicodeBlocks = require('./addons/unicode-blocks'); + +var _unicodeBlocks2 = _interopRequireDefault(_unicodeBlocks); + +var _unicodeCategories = require('./addons/unicode-categories'); + +var _unicodeCategories2 = _interopRequireDefault(_unicodeCategories); + +var _unicodeProperties = require('./addons/unicode-properties'); + +var _unicodeProperties2 = _interopRequireDefault(_unicodeProperties); + +var _unicodeScripts = require('./addons/unicode-scripts'); + +var _unicodeScripts2 = _interopRequireDefault(_unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _build2.default)(_xregexp2.default); +(0, _matchrecursive2.default)(_xregexp2.default); +(0, _unicodeBase2.default)(_xregexp2.default); +(0, _unicodeBlocks2.default)(_xregexp2.default); +(0, _unicodeCategories2.default)(_xregexp2.default); +(0, _unicodeProperties2.default)(_xregexp2.default); +(0, _unicodeScripts2.default)(_xregexp2.default); + +exports.default = _xregexp2.default; +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/xregexp.js b/scripts/node_modules/xregexp/lib/xregexp.js new file mode 100644 index 00000000..971b6bbc --- /dev/null +++ b/scripts/node_modules/xregexp/lib/xregexp.js @@ -0,0 +1,1792 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/*! + * XRegExp 4.0.0 + * + * Steven Levithan (c) 2007-2017 MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ + +// ==--------------------------== +// Private stuff +// ==--------------------------== + +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; +// Optional features that can be installed and uninstalled +var features = { + astral: false +}; +// Native methods to use and restore ('native' is an ES3 reserved keyword) +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; +// Storage for fixed/extended native methods +var fixed = {}; +// Storage for regexes cached by `XRegExp.cache` +var regexCache = {}; +// Storage for pattern details cached by the `XRegExp` constructor +var patternCache = {}; +// Storage for regex syntax tokens added internally or by `XRegExp.addToken` +var tokens = []; +// Token scopes +var defaultScope = 'default'; +var classScope = 'class'; +// Regexes that match native regex syntax, including octals +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; +// Any backreference or dollar-prefixed character in replacement strings +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; +// Check for correct `exec` handling of nonparticipating capturing groups +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; +// Check for ES6 `flags` prop support +var hasFlagsProp = /x/.flags !== undefined; +// Shortcut to `Object.prototype.toString` +var toString = {}.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + return isSupported; +} +// Check for ES6 `u` flag support +var hasNativeU = hasNativeFlag('u'); +// Check for ES6 `y` flag support +var hasNativeY = hasNativeFlag('y'); +// Tracker for known flags, including addon flags +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; + +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + var p = void 0; + + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } + + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; + // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + + return regex; +} + +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} + +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + if (options.removeY) { + flagsToRemove += 'y'; + } + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + if (options.addY) { + flagsToAdd += 'y'; + } + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } + // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } + + // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + + return regex; +} + +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ +function dec(hex) { + return parseInt(hex, 16); +} + +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ +function getContextualTokenSeparator(match, scope, flags) { + if ( + // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || + // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } + // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + return '(?:)'; +} + +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : + // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} + +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} + +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ +function hex(dec) { + return parseInt(dec, 10).toString(16); +} + +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ +function isQuantifierNext(pattern, pos, flags) { + var inlineCommentPattern = '\\(\\?#[^)]*\\)'; + var lineCommentPattern = '#[^#\\n]*'; + var quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; + return nativ.test.call(flags.indexOf('x') !== -1 ? + // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : + // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} + +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ +function isType(value, type) { + return toString.call(value) === '[object ' + type + ']'; +} + +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ +function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; +} + +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ +function prepareFlags(pattern, flags) { + var i = void 0; + + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError('Invalid duplicate regex flag ' + flags); + } + + // Strip and apply a leading mode modifier with any combination of flags except g or y + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); + } + // Allow duplicate flags within the mode modifier + flags = clipDuplicates(flags + $1); + return ''; + }); + + // Throw on unknown native or nonnative flags + for (i = 0; i < flags.length; ++i) { + if (!registeredFlags[flags[i]]) { + throw new SyntaxError('Unknown regex flag ' + flags[i]); + } + } + + return { + pattern: pattern, + flags: flags + }; +} + +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + + return options; + } + + return value; +} + +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} + +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match = void 0; + var t = void 0; + + // Run in reverse insertion order + while (i--) { + t = tokens[i]; + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; + // Finished with token tests + break; + } + } + + return result; +} + +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ +function setAstral(on) { + features.astral = on; +} + +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} + +// ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + return copyRegex(pattern); + } + + // Copy the argument behavior of `RegExp` + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result = void 0; + + // Check for flag-related errors, and strip/apply flags in a leading mode modifier + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; + + // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); + // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; + output += token; + pos += token.length; + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} + +// Add `RegExp.prototype` to the prototype chain +XRegExp.prototype = /(?:)/; + +// ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ +XRegExp.version = '4.0.0'; + +// ==--------------------------== +// Public methods +// ==--------------------------== + +// Intentionally undocumented; used in tests and addons +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; + +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var optionalFlags = options.optionalFlags; + var i = void 0; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + for (i = 0; i < optionalFlags.length; ++i) { + registerFlag(optionalFlags[i]); + } + } + + // Add to the private list of syntax tokens + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + XRegExp.cache.flush('patterns'); +}; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; + +// Intentionally undocumented; used in tests +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match = void 0; + + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.match`/`replace` + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? regex.source + '|()' : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + + pos = pos || 0; + r2.lastIndex = pos; + + // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + match = fixed.exec.call(r2, str); + + // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; + +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match = void 0; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + + pos = match.index + (match[0].length || 1); + } +}; + +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ +XRegExp.globalize = function (regex) { + return copyRegex(regex, { addG: true }); +}; + +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true + * }); + * + * // With an options string + * XRegExp.install('astral'); + */ +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } +}; + +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`replace` + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? + // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { regex: chain[level] }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the + // `undefined`s for backreferences to nonparticipating capturing groups. In such + // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw + // the exception, so also check if the backreference is a number that is within the + // bounds of the array. + if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { + throw new ReferenceError('Backreference to undefined group: ' + item.backref); + } + + matches.push(match[item.backref] || ''); + } else { + matches.push(match[0]); + } + } + + for (var i = 0; i < values.length; ++i) { + XRegExp.forEach(values[i], item.regex, addMatch); + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } + + // Fixed `replace` required for named backreferences, etc. + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; + +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ +XRegExp.replaceEach = function (str, replacements) { + var i = void 0; + var r = void 0; + + for (i = 0; i < replacements.length; ++i) { + r = replacements[i]; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + + return str; +}; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; + +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral'); + */ +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } +}; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures = void 0; + var captureNames = void 0; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; + + // Capturing group + if (paren) { + ++numCaptures; + // If the current capture has a name, preserve the name + if (name) { + return '(?<' + name + '>'; + } + // Backreference + } else if (backref) { + // Rewrite the backreference + return '\\' + (+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var pattern = void 0; + for (var i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; + + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; + +// ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var len = args.length; + // Skip index 0 and the last 2 + for (var i = 1; i < len - 2; ++i) { + if (args[i] === undefined) { + match[i] = undefined; + } + } + }); + } + + // Attach named capture properties + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); + // Fixes IE bug + regex.lastIndex = 0; + + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; + +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex = void 0; + var captureNames = void 0; + var result = void 0; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } + // Only needed if `search` is nonglobal + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } + + // Don't use `typeof`; some older browsers return 'function' for regex objects + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (captureNames) { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + // ES6 specs the context for replacement functions as `undefined` + return replacement.apply(undefined, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; + // Named or numbered backreference with curly or angled braces + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ''; + } + // Groups with the same name is an error, else would need `lastIndexOf` + n = captureNames ? captureNames.indexOf(bracketed) : -1; + if (n < 0) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[n + 1] || ''; + } + // Else, special variable or numbered backreference without curly braces + if (dollarToken === '$') { + // $$ + return '$'; + } + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } + // Else, numbered backreference without braces + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[dollarToken] || ''; + } + // `$` followed by an unsupported char is an error, unlike native JS + throw new SyntaxError('Invalid token ' + $0); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength = void 0; + + // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + limit = (limit === undefined ? -1 : limit) >>> 0; + + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; + +// ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError('Invalid escape ' + match[0]); +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + if (code > 0x10FFFF) { + throw new SyntaxError('Invalid Unicode code point ' + match[0]); + } + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return '\\u' + pad4(hex(code)); + } + // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ +XRegExp.addToken(/\[(\^?)\]/, +// For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ leadChar: '[' }); + +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { leadChar: '(' }); + +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { flag: 'x' }); + +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); + +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError('Backreference to undefined group ' + match[0]); + } + // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + return '\\' + index + (endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { leadChar: '\\' }); + +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + match[0]); + } + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError('Cannot use integer as capture name ' + match[0]); + } + if (match[1] === 'length' || match[1] === '__proto__') { + throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); + } + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { leadChar: '(' }); + +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); + +exports.default = XRegExp; +module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/package.json b/scripts/node_modules/xregexp/package.json new file mode 100644 index 00000000..977f1867 --- /dev/null +++ b/scripts/node_modules/xregexp/package.json @@ -0,0 +1,47 @@ +{ + "name": "xregexp", + "version": "4.0.0", + "description": "Extended regular expressions", + "homepage": "http://xregexp.com/", + "author": "Steven Levithan ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/slevithan/xregexp.git" + }, + "keywords": [ + "regex", + "regexp", + "regular expression", + "unicode" + ], + "main": "./lib", + "files": [ + "src", + "lib", + "xregexp-all.js", + "LICENSE" + ], + "scripts": { + "lint": "eslint src", + "babel": "babel src -d lib", + "prebuild": "npm run lint && npm run babel", + "build": "browserify lib/index.js --standalone XRegExp > xregexp-all.js", + "pretest": "npm run build", + "test": "jasmine JASMINE_CONFIG_PATH=tests/jasmine.json", + "test-saucelabs": "npm run pretest && zuul tests/spec/*.js", + "test-browser": "npm run test-saucelabs -- --local --open", + "prepublish": "npm test" + }, + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-array-includes": "^2.0.3", + "babel-plugin-transform-xregexp": "^0.0.4", + "babel-preset-env": "^1.4.0", + "browserify": "^12.0.1", + "eslint": "^3.19.0", + "jasmine": "^2.5.3", + "zuul": "^3.11.1" + } +} diff --git a/scripts/node_modules/xregexp/src/addons/build.js b/scripts/node_modules/xregexp/src/addons/build.js new file mode 100644 index 00000000..3a14e72e --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/build.js @@ -0,0 +1,234 @@ +/*! + * XRegExp.build 4.0.0 + * + * Steven Levithan (c) 2012-2017 MIT License + */ + +export default (XRegExp) => { + const REGEX_DATA = 'xregexp'; + const subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + const parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + const leadingAnchor = /^(?:\(\?:\))*\^/; + const trailingAnchor = /\$(?:\(\?:\))*$/; + + if ( + leadingAnchor.test(pattern) && + trailingAnchor.test(pattern) && + // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, '')) + ) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + function asXRegExp(value, addFlagX) { + const flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? + (value[REGEX_DATA] && value[REGEX_DATA].captureNames ? + // Don't recompile, to preserve capture names + value : + // Recompile as XRegExp + XRegExp(value.source, flags) + ) : + // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns[`subpattern${subpatternIndex}`] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + const hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? `{{subpattern${subpatternIndex}}}` : ''); + } + + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.tag = (flags) => (literals, ...substitutions) => { + const subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + const pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.build = (pattern, subs, flags) => { + flags = flags || ''; + // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + const addFlagX = flags.includes('x'); + const inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); + // Add flags within a leading mode modifier to the overall pattern's flags + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + const data = {}; + for (const p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + const sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } + + // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + const patternAsRegex = asXRegExp(pattern, addFlagX); + + // 'Caps' is short for 'captures' + let numCaps = 0; + let numPriorCaps; + let numOuterCaps = 0; + const outerCapsMap = [0]; + const outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + const output = patternAsRegex.source.replace(parts, ($0, $1, $2, $3, $4) => { + const subName = $1 || $2; + let capName; + let intro; + let localCapIndex; + // Named subpattern + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError(`Undefined property ${$0}`); + } + // Named subpattern was wrapped in a capturing group + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + intro = `(?<${capName || subName}>`; + } else { + intro = '(?:'; + } + numPriorCaps = numCaps; + const rewrittenSubpattern = data[subName].pattern.replace(subParts, (match, paren, backref) => { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return `(?<${capName}>`; + } + // Backreference + } else if (backref) { + localCapIndex = +backref - 1; + // Rewrite the backreference + return data[subName].names[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + `\\k<${data[subName].names[localCapIndex]}>` : + `\\${+backref + numPriorCaps}`; + } + return match; + }); + return `${intro}${rewrittenSubpattern})`; + } + // Capturing group + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return `(?<${capName}>`; + } + // Backreference + } else if ($4) { + localCapIndex = +$4 - 1; + // Rewrite the backreference + return outerCapNames[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + `\\k<${outerCapNames[localCapIndex]}>` : + `\\${outerCapsMap[+$4]}`; + } + return $0; + }); + + return XRegExp(output, flags); + }; +}; diff --git a/scripts/node_modules/xregexp/src/addons/matchrecursive.js b/scripts/node_modules/xregexp/src/addons/matchrecursive.js new file mode 100644 index 00000000..bf563ee6 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/matchrecursive.js @@ -0,0 +1,197 @@ +/*! + * XRegExp.matchRecursive 4.0.0 + * + * Steven Levithan (c) 2009-2017 MIT License + */ + +export default (XRegExp) => { + + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name, + value, + start, + end + }; + } + + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + XRegExp.matchRecursive = (str, left, right, flags, options) => { + flags = flags || ''; + options = options || {}; + const global = flags.includes('g'); + const sticky = flags.includes('y'); + // Flag `y` is controlled internally + const basicFlags = flags.replace(/y/g, ''); + let escapeChar = options.escapeChar; + const vN = options.valueNames; + const output = []; + let openTokens = 0; + let delimStart = 0; + let delimEnd = 0; + let lastOuterEnd = 0; + let outerStart; + let innerStart; + let leftMatch; + let rightMatch; + let esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + escapeChar = XRegExp.escape(escapeChar); + // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + esc = new RegExp( + `(?:${escapeChar}[\\S\\s]|(?:(?!${ + // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', {conjunction: 'or'}).source + })[^${escapeChar}])+)+`, + // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '') + ); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); + // Keep the leftmost match only + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } + // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + ++openTokens; + } else if (rightMatch && openTokens) { + if (!--openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } + // If the delimiter matched an empty string, avoid an infinite loop + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-base.js b/scripts/node_modules/xregexp/src/addons/unicode-base.js new file mode 100644 index 00000000..9fcb0448 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/unicode-base.js @@ -0,0 +1,258 @@ +/*! + * XRegExp Unicode Base 4.0.0 + * + * Steven Levithan (c) 2008-2017 MIT License + */ + +export default (XRegExp) => { + + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + + // ==--------------------------== + // Private stuff + // ==--------------------------== + + // Storage for Unicode data + const unicode = {}; + + // Reuse utils + const dec = XRegExp._dec; + const hex = XRegExp._hex; + const pad4 = XRegExp._pad4; + + // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } + + // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + function charCode(chr) { + const esc = /^\\[xu](.+)/.exec(chr); + return esc ? + dec(esc[1]) : + chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } + + // Inverts a list of ordered BMP characters and ranges + function invertBmp(range) { + let output = ''; + let lastEnd = -1; + + XRegExp.forEach( + range, + /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, + (m) => { + const start = charCode(m[1]); + if (start > (lastEnd + 1)) { + output += `\\u${pad4(hex(lastEnd + 1))}`; + if (start > (lastEnd + 2)) { + output += `-\\u${pad4(hex(start - 1))}`; + } + } + lastEnd = charCode(m[2] || m[1]); + } + ); + + if (lastEnd < 0xFFFF) { + output += `\\u${pad4(hex(lastEnd + 1))}`; + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } + + // Generates an inverted BMP range on first use + function cacheInvertedBmp(slug) { + const prop = 'b!'; + return ( + unicode[slug][prop] || + (unicode[slug][prop] = invertBmp(unicode[slug].bmp)) + ); + } + + // Combines and optionally negates BMP and astral data + function buildAstral(slug, isNegated) { + const item = unicode[slug]; + let combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = `[${item.bmp}]${item.astral ? '|' : ''}`; + } + if (item.astral) { + combined += item.astral; + } + if (item.isBmpLast && item.bmp) { + combined += `${item.astral ? '|' : ''}[${item.bmp}]`; + } + + // Astral Unicode tokens always match a code point, never a code unit + return isNegated ? + `(?:(?!${combined})(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))` : + `(?:${combined})`; + } + + // Builds a complete astral pattern on first use + function cacheAstral(slug, isNegated) { + const prop = isNegated ? 'a!' : 'a='; + return ( + unicode[slug][prop] || + (unicode[slug][prop] = buildAstral(slug, isNegated)) + ); + } + + // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + XRegExp.addToken( + // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, + (match, scope, flags) => { + const ERR_DOUBLE_NEG = 'Invalid double negation '; + const ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + const ERR_UNKNOWN_REF = 'Unicode token missing data '; + const ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + const ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; + // Negated via \P{..} or \p{^..} + let isNegated = match[1] === 'P' || !!match[2]; + // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + const isAstralMode = flags.includes('A'); + // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + let slug = normalize(match[4] || match[3]); + // Token data object + let item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } + + // Switch to the negated form of the referenced Unicode token + if (item.inverseOf) { + slug = normalize(item.inverseOf); + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError(`${ERR_UNKNOWN_REF + match[0]} -> ${item.inverseOf}`); + } + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? + (isNegated ? cacheInvertedBmp(slug) : item.bmp) : + `${(isNegated ? '[^' : '[') + item.bmp}]`; + }, + { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + } + ); + + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + XRegExp.addUnicodeData = (data) => { + const ERR_NO_NAME = 'Unicode token requires name'; + const ERR_NO_DATA = 'Unicode token has no character data '; + let item; + + for (let i = 0; i < data.length; ++i) { + item = data[i]; + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + unicode[normalize(item.name)] = item; + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + XRegExp._getUnicodeProperty = (name) => { + const slug = normalize(name); + return unicode[slug]; + }; +}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-blocks.js b/scripts/node_modules/xregexp/src/addons/unicode-blocks.js new file mode 100644 index 00000000..e2f922c9 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/unicode-blocks.js @@ -0,0 +1,1118 @@ +/*! + * XRegExp Unicode Blocks 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +export default (XRegExp) => { + + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData([ + { + name: 'InAdlam', + astral: '\uD83A[\uDD00-\uDD5F]' + }, + { + name: 'InAegean_Numbers', + astral: '\uD800[\uDD00-\uDD3F]' + }, + { + name: 'InAhom', + astral: '\uD805[\uDF00-\uDF3F]' + }, + { + name: 'InAlchemical_Symbols', + astral: '\uD83D[\uDF00-\uDF7F]' + }, + { + name: 'InAlphabetic_Presentation_Forms', + bmp: '\uFB00-\uFB4F' + }, + { + name: 'InAnatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE7F]' + }, + { + name: 'InAncient_Greek_Musical_Notation', + astral: '\uD834[\uDE00-\uDE4F]' + }, + { + name: 'InAncient_Greek_Numbers', + astral: '\uD800[\uDD40-\uDD8F]' + }, + { + name: 'InAncient_Symbols', + astral: '\uD800[\uDD90-\uDDCF]' + }, + { + name: 'InArabic', + bmp: '\u0600-\u06FF' + }, + { + name: 'InArabic_Extended_A', + bmp: '\u08A0-\u08FF' + }, + { + name: 'InArabic_Mathematical_Alphabetic_Symbols', + astral: '\uD83B[\uDE00-\uDEFF]' + }, + { + name: 'InArabic_Presentation_Forms_A', + bmp: '\uFB50-\uFDFF' + }, + { + name: 'InArabic_Presentation_Forms_B', + bmp: '\uFE70-\uFEFF' + }, + { + name: 'InArabic_Supplement', + bmp: '\u0750-\u077F' + }, + { + name: 'InArmenian', + bmp: '\u0530-\u058F' + }, + { + name: 'InArrows', + bmp: '\u2190-\u21FF' + }, + { + name: 'InAvestan', + astral: '\uD802[\uDF00-\uDF3F]' + }, + { + name: 'InBalinese', + bmp: '\u1B00-\u1B7F' + }, + { + name: 'InBamum', + bmp: '\uA6A0-\uA6FF' + }, + { + name: 'InBamum_Supplement', + astral: '\uD81A[\uDC00-\uDE3F]' + }, + { + name: 'InBasic_Latin', + bmp: '\0-\x7F' + }, + { + name: 'InBassa_Vah', + astral: '\uD81A[\uDED0-\uDEFF]' + }, + { + name: 'InBatak', + bmp: '\u1BC0-\u1BFF' + }, + { + name: 'InBengali', + bmp: '\u0980-\u09FF' + }, + { + name: 'InBhaiksuki', + astral: '\uD807[\uDC00-\uDC6F]' + }, + { + name: 'InBlock_Elements', + bmp: '\u2580-\u259F' + }, + { + name: 'InBopomofo', + bmp: '\u3100-\u312F' + }, + { + name: 'InBopomofo_Extended', + bmp: '\u31A0-\u31BF' + }, + { + name: 'InBox_Drawing', + bmp: '\u2500-\u257F' + }, + { + name: 'InBrahmi', + astral: '\uD804[\uDC00-\uDC7F]' + }, + { + name: 'InBraille_Patterns', + bmp: '\u2800-\u28FF' + }, + { + name: 'InBuginese', + bmp: '\u1A00-\u1A1F' + }, + { + name: 'InBuhid', + bmp: '\u1740-\u175F' + }, + { + name: 'InByzantine_Musical_Symbols', + astral: '\uD834[\uDC00-\uDCFF]' + }, + { + name: 'InCJK_Compatibility', + bmp: '\u3300-\u33FF' + }, + { + name: 'InCJK_Compatibility_Forms', + bmp: '\uFE30-\uFE4F' + }, + { + name: 'InCJK_Compatibility_Ideographs', + bmp: '\uF900-\uFAFF' + }, + { + name: 'InCJK_Compatibility_Ideographs_Supplement', + astral: '\uD87E[\uDC00-\uDE1F]' + }, + { + name: 'InCJK_Radicals_Supplement', + bmp: '\u2E80-\u2EFF' + }, + { + name: 'InCJK_Strokes', + bmp: '\u31C0-\u31EF' + }, + { + name: 'InCJK_Symbols_and_Punctuation', + bmp: '\u3000-\u303F' + }, + { + name: 'InCJK_Unified_Ideographs', + bmp: '\u4E00-\u9FFF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_A', + bmp: '\u3400-\u4DBF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_B', + astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_C', + astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_D', + astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_E', + astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, + { + name: 'InCarian', + astral: '\uD800[\uDEA0-\uDEDF]' + }, + { + name: 'InCaucasian_Albanian', + astral: '\uD801[\uDD30-\uDD6F]' + }, + { + name: 'InChakma', + astral: '\uD804[\uDD00-\uDD4F]' + }, + { + name: 'InCham', + bmp: '\uAA00-\uAA5F' + }, + { + name: 'InCherokee', + bmp: '\u13A0-\u13FF' + }, + { + name: 'InCherokee_Supplement', + bmp: '\uAB70-\uABBF' + }, + { + name: 'InCombining_Diacritical_Marks', + bmp: '\u0300-\u036F' + }, + { + name: 'InCombining_Diacritical_Marks_Extended', + bmp: '\u1AB0-\u1AFF' + }, + { + name: 'InCombining_Diacritical_Marks_Supplement', + bmp: '\u1DC0-\u1DFF' + }, + { + name: 'InCombining_Diacritical_Marks_for_Symbols', + bmp: '\u20D0-\u20FF' + }, + { + name: 'InCombining_Half_Marks', + bmp: '\uFE20-\uFE2F' + }, + { + name: 'InCommon_Indic_Number_Forms', + bmp: '\uA830-\uA83F' + }, + { + name: 'InControl_Pictures', + bmp: '\u2400-\u243F' + }, + { + name: 'InCoptic', + bmp: '\u2C80-\u2CFF' + }, + { + name: 'InCoptic_Epact_Numbers', + astral: '\uD800[\uDEE0-\uDEFF]' + }, + { + name: 'InCounting_Rod_Numerals', + astral: '\uD834[\uDF60-\uDF7F]' + }, + { + name: 'InCuneiform', + astral: '\uD808[\uDC00-\uDFFF]' + }, + { + name: 'InCuneiform_Numbers_and_Punctuation', + astral: '\uD809[\uDC00-\uDC7F]' + }, + { + name: 'InCurrency_Symbols', + bmp: '\u20A0-\u20CF' + }, + { + name: 'InCypriot_Syllabary', + astral: '\uD802[\uDC00-\uDC3F]' + }, + { + name: 'InCyrillic', + bmp: '\u0400-\u04FF' + }, + { + name: 'InCyrillic_Extended_A', + bmp: '\u2DE0-\u2DFF' + }, + { + name: 'InCyrillic_Extended_B', + bmp: '\uA640-\uA69F' + }, + { + name: 'InCyrillic_Extended_C', + bmp: '\u1C80-\u1C8F' + }, + { + name: 'InCyrillic_Supplement', + bmp: '\u0500-\u052F' + }, + { + name: 'InDeseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'InDevanagari', + bmp: '\u0900-\u097F' + }, + { + name: 'InDevanagari_Extended', + bmp: '\uA8E0-\uA8FF' + }, + { + name: 'InDingbats', + bmp: '\u2700-\u27BF' + }, + { + name: 'InDomino_Tiles', + astral: '\uD83C[\uDC30-\uDC9F]' + }, + { + name: 'InDuployan', + astral: '\uD82F[\uDC00-\uDC9F]' + }, + { + name: 'InEarly_Dynastic_Cuneiform', + astral: '\uD809[\uDC80-\uDD4F]' + }, + { + name: 'InEgyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + name: 'InElbasan', + astral: '\uD801[\uDD00-\uDD2F]' + }, + { + name: 'InEmoticons', + astral: '\uD83D[\uDE00-\uDE4F]' + }, + { + name: 'InEnclosed_Alphanumeric_Supplement', + astral: '\uD83C[\uDD00-\uDDFF]' + }, + { + name: 'InEnclosed_Alphanumerics', + bmp: '\u2460-\u24FF' + }, + { + name: 'InEnclosed_CJK_Letters_and_Months', + bmp: '\u3200-\u32FF' + }, + { + name: 'InEnclosed_Ideographic_Supplement', + astral: '\uD83C[\uDE00-\uDEFF]' + }, + { + name: 'InEthiopic', + bmp: '\u1200-\u137F' + }, + { + name: 'InEthiopic_Extended', + bmp: '\u2D80-\u2DDF' + }, + { + name: 'InEthiopic_Extended_A', + bmp: '\uAB00-\uAB2F' + }, + { + name: 'InEthiopic_Supplement', + bmp: '\u1380-\u139F' + }, + { + name: 'InGeneral_Punctuation', + bmp: '\u2000-\u206F' + }, + { + name: 'InGeometric_Shapes', + bmp: '\u25A0-\u25FF' + }, + { + name: 'InGeometric_Shapes_Extended', + astral: '\uD83D[\uDF80-\uDFFF]' + }, + { + name: 'InGeorgian', + bmp: '\u10A0-\u10FF' + }, + { + name: 'InGeorgian_Supplement', + bmp: '\u2D00-\u2D2F' + }, + { + name: 'InGlagolitic', + bmp: '\u2C00-\u2C5F' + }, + { + name: 'InGlagolitic_Supplement', + astral: '\uD838[\uDC00-\uDC2F]' + }, + { + name: 'InGothic', + astral: '\uD800[\uDF30-\uDF4F]' + }, + { + name: 'InGrantha', + astral: '\uD804[\uDF00-\uDF7F]' + }, + { + name: 'InGreek_Extended', + bmp: '\u1F00-\u1FFF' + }, + { + name: 'InGreek_and_Coptic', + bmp: '\u0370-\u03FF' + }, + { + name: 'InGujarati', + bmp: '\u0A80-\u0AFF' + }, + { + name: 'InGurmukhi', + bmp: '\u0A00-\u0A7F' + }, + { + name: 'InHalfwidth_and_Fullwidth_Forms', + bmp: '\uFF00-\uFFEF' + }, + { + name: 'InHangul_Compatibility_Jamo', + bmp: '\u3130-\u318F' + }, + { + name: 'InHangul_Jamo', + bmp: '\u1100-\u11FF' + }, + { + name: 'InHangul_Jamo_Extended_A', + bmp: '\uA960-\uA97F' + }, + { + name: 'InHangul_Jamo_Extended_B', + bmp: '\uD7B0-\uD7FF' + }, + { + name: 'InHangul_Syllables', + bmp: '\uAC00-\uD7AF' + }, + { + name: 'InHanunoo', + bmp: '\u1720-\u173F' + }, + { + name: 'InHatran', + astral: '\uD802[\uDCE0-\uDCFF]' + }, + { + name: 'InHebrew', + bmp: '\u0590-\u05FF' + }, + { + name: 'InHigh_Private_Use_Surrogates', + bmp: '\uDB80-\uDBFF' + }, + { + name: 'InHigh_Surrogates', + bmp: '\uD800-\uDB7F' + }, + { + name: 'InHiragana', + bmp: '\u3040-\u309F' + }, + { + name: 'InIPA_Extensions', + bmp: '\u0250-\u02AF' + }, + { + name: 'InIdeographic_Description_Characters', + bmp: '\u2FF0-\u2FFF' + }, + { + name: 'InIdeographic_Symbols_and_Punctuation', + astral: '\uD81B[\uDFE0-\uDFFF]' + }, + { + name: 'InImperial_Aramaic', + astral: '\uD802[\uDC40-\uDC5F]' + }, + { + name: 'InInscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF7F]' + }, + { + name: 'InInscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF5F]' + }, + { + name: 'InJavanese', + bmp: '\uA980-\uA9DF' + }, + { + name: 'InKaithi', + astral: '\uD804[\uDC80-\uDCCF]' + }, + { + name: 'InKana_Supplement', + astral: '\uD82C[\uDC00-\uDCFF]' + }, + { + name: 'InKanbun', + bmp: '\u3190-\u319F' + }, + { + name: 'InKangxi_Radicals', + bmp: '\u2F00-\u2FDF' + }, + { + name: 'InKannada', + bmp: '\u0C80-\u0CFF' + }, + { + name: 'InKatakana', + bmp: '\u30A0-\u30FF' + }, + { + name: 'InKatakana_Phonetic_Extensions', + bmp: '\u31F0-\u31FF' + }, + { + name: 'InKayah_Li', + bmp: '\uA900-\uA92F' + }, + { + name: 'InKharoshthi', + astral: '\uD802[\uDE00-\uDE5F]' + }, + { + name: 'InKhmer', + bmp: '\u1780-\u17FF' + }, + { + name: 'InKhmer_Symbols', + bmp: '\u19E0-\u19FF' + }, + { + name: 'InKhojki', + astral: '\uD804[\uDE00-\uDE4F]' + }, + { + name: 'InKhudawadi', + astral: '\uD804[\uDEB0-\uDEFF]' + }, + { + name: 'InLao', + bmp: '\u0E80-\u0EFF' + }, + { + name: 'InLatin_Extended_Additional', + bmp: '\u1E00-\u1EFF' + }, + { + name: 'InLatin_Extended_A', + bmp: '\u0100-\u017F' + }, + { + name: 'InLatin_Extended_B', + bmp: '\u0180-\u024F' + }, + { + name: 'InLatin_Extended_C', + bmp: '\u2C60-\u2C7F' + }, + { + name: 'InLatin_Extended_D', + bmp: '\uA720-\uA7FF' + }, + { + name: 'InLatin_Extended_E', + bmp: '\uAB30-\uAB6F' + }, + { + name: 'InLatin_1_Supplement', + bmp: '\x80-\xFF' + }, + { + name: 'InLepcha', + bmp: '\u1C00-\u1C4F' + }, + { + name: 'InLetterlike_Symbols', + bmp: '\u2100-\u214F' + }, + { + name: 'InLimbu', + bmp: '\u1900-\u194F' + }, + { + name: 'InLinear_A', + astral: '\uD801[\uDE00-\uDF7F]' + }, + { + name: 'InLinear_B_Ideograms', + astral: '\uD800[\uDC80-\uDCFF]' + }, + { + name: 'InLinear_B_Syllabary', + astral: '\uD800[\uDC00-\uDC7F]' + }, + { + name: 'InLisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'InLow_Surrogates', + bmp: '\uDC00-\uDFFF' + }, + { + name: 'InLycian', + astral: '\uD800[\uDE80-\uDE9F]' + }, + { + name: 'InLydian', + astral: '\uD802[\uDD20-\uDD3F]' + }, + { + name: 'InMahajani', + astral: '\uD804[\uDD50-\uDD7F]' + }, + { + name: 'InMahjong_Tiles', + astral: '\uD83C[\uDC00-\uDC2F]' + }, + { + name: 'InMalayalam', + bmp: '\u0D00-\u0D7F' + }, + { + name: 'InMandaic', + bmp: '\u0840-\u085F' + }, + { + name: 'InManichaean', + astral: '\uD802[\uDEC0-\uDEFF]' + }, + { + name: 'InMarchen', + astral: '\uD807[\uDC70-\uDCBF]' + }, + { + name: 'InMathematical_Alphanumeric_Symbols', + astral: '\uD835[\uDC00-\uDFFF]' + }, + { + name: 'InMathematical_Operators', + bmp: '\u2200-\u22FF' + }, + { + name: 'InMeetei_Mayek', + bmp: '\uABC0-\uABFF' + }, + { + name: 'InMeetei_Mayek_Extensions', + bmp: '\uAAE0-\uAAFF' + }, + { + name: 'InMende_Kikakui', + astral: '\uD83A[\uDC00-\uDCDF]' + }, + { + name: 'InMeroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDFF]' + }, + { + name: 'InMeroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'InMiao', + astral: '\uD81B[\uDF00-\uDF9F]' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_A', + bmp: '\u27C0-\u27EF' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_B', + bmp: '\u2980-\u29FF' + }, + { + name: 'InMiscellaneous_Symbols', + bmp: '\u2600-\u26FF' + }, + { + name: 'InMiscellaneous_Symbols_and_Arrows', + bmp: '\u2B00-\u2BFF' + }, + { + name: 'InMiscellaneous_Symbols_and_Pictographs', + astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, + { + name: 'InMiscellaneous_Technical', + bmp: '\u2300-\u23FF' + }, + { + name: 'InModi', + astral: '\uD805[\uDE00-\uDE5F]' + }, + { + name: 'InModifier_Tone_Letters', + bmp: '\uA700-\uA71F' + }, + { + name: 'InMongolian', + bmp: '\u1800-\u18AF' + }, + { + name: 'InMongolian_Supplement', + astral: '\uD805[\uDE60-\uDE7F]' + }, + { + name: 'InMro', + astral: '\uD81A[\uDE40-\uDE6F]' + }, + { + name: 'InMultani', + astral: '\uD804[\uDE80-\uDEAF]' + }, + { + name: 'InMusical_Symbols', + astral: '\uD834[\uDD00-\uDDFF]' + }, + { + name: 'InMyanmar', + bmp: '\u1000-\u109F' + }, + { + name: 'InMyanmar_Extended_A', + bmp: '\uAA60-\uAA7F' + }, + { + name: 'InMyanmar_Extended_B', + bmp: '\uA9E0-\uA9FF' + }, + { + name: 'InNKo', + bmp: '\u07C0-\u07FF' + }, + { + name: 'InNabataean', + astral: '\uD802[\uDC80-\uDCAF]' + }, + { + name: 'InNew_Tai_Lue', + bmp: '\u1980-\u19DF' + }, + { + name: 'InNewa', + astral: '\uD805[\uDC00-\uDC7F]' + }, + { + name: 'InNumber_Forms', + bmp: '\u2150-\u218F' + }, + { + name: 'InOgham', + bmp: '\u1680-\u169F' + }, + { + name: 'InOl_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'InOld_Hungarian', + astral: '\uD803[\uDC80-\uDCFF]' + }, + { + name: 'InOld_Italic', + astral: '\uD800[\uDF00-\uDF2F]' + }, + { + name: 'InOld_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'InOld_Permic', + astral: '\uD800[\uDF50-\uDF7F]' + }, + { + name: 'InOld_Persian', + astral: '\uD800[\uDFA0-\uDFDF]' + }, + { + name: 'InOld_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'InOld_Turkic', + astral: '\uD803[\uDC00-\uDC4F]' + }, + { + name: 'InOptical_Character_Recognition', + bmp: '\u2440-\u245F' + }, + { + name: 'InOriya', + bmp: '\u0B00-\u0B7F' + }, + { + name: 'InOrnamental_Dingbats', + astral: '\uD83D[\uDE50-\uDE7F]' + }, + { + name: 'InOsage', + astral: '\uD801[\uDCB0-\uDCFF]' + }, + { + name: 'InOsmanya', + astral: '\uD801[\uDC80-\uDCAF]' + }, + { + name: 'InPahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF8F]' + }, + { + name: 'InPalmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'InPau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEFF]' + }, + { + name: 'InPhags_pa', + bmp: '\uA840-\uA87F' + }, + { + name: 'InPhaistos_Disc', + astral: '\uD800[\uDDD0-\uDDFF]' + }, + { + name: 'InPhoenician', + astral: '\uD802[\uDD00-\uDD1F]' + }, + { + name: 'InPhonetic_Extensions', + bmp: '\u1D00-\u1D7F' + }, + { + name: 'InPhonetic_Extensions_Supplement', + bmp: '\u1D80-\u1DBF' + }, + { + name: 'InPlaying_Cards', + astral: '\uD83C[\uDCA0-\uDCFF]' + }, + { + name: 'InPrivate_Use_Area', + bmp: '\uE000-\uF8FF' + }, + { + name: 'InPsalter_Pahlavi', + astral: '\uD802[\uDF80-\uDFAF]' + }, + { + name: 'InRejang', + bmp: '\uA930-\uA95F' + }, + { + name: 'InRumi_Numeral_Symbols', + astral: '\uD803[\uDE60-\uDE7F]' + }, + { + name: 'InRunic', + bmp: '\u16A0-\u16FF' + }, + { + name: 'InSamaritan', + bmp: '\u0800-\u083F' + }, + { + name: 'InSaurashtra', + bmp: '\uA880-\uA8DF' + }, + { + name: 'InSharada', + astral: '\uD804[\uDD80-\uDDDF]' + }, + { + name: 'InShavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'InShorthand_Format_Controls', + astral: '\uD82F[\uDCA0-\uDCAF]' + }, + { + name: 'InSiddham', + astral: '\uD805[\uDD80-\uDDFF]' + }, + { + name: 'InSinhala', + bmp: '\u0D80-\u0DFF' + }, + { + name: 'InSinhala_Archaic_Numbers', + astral: '\uD804[\uDDE0-\uDDFF]' + }, + { + name: 'InSmall_Form_Variants', + bmp: '\uFE50-\uFE6F' + }, + { + name: 'InSora_Sompeng', + astral: '\uD804[\uDCD0-\uDCFF]' + }, + { + name: 'InSpacing_Modifier_Letters', + bmp: '\u02B0-\u02FF' + }, + { + name: 'InSpecials', + bmp: '\uFFF0-\uFFFF' + }, + { + name: 'InSundanese', + bmp: '\u1B80-\u1BBF' + }, + { + name: 'InSundanese_Supplement', + bmp: '\u1CC0-\u1CCF' + }, + { + name: 'InSuperscripts_and_Subscripts', + bmp: '\u2070-\u209F' + }, + { + name: 'InSupplemental_Arrows_A', + bmp: '\u27F0-\u27FF' + }, + { + name: 'InSupplemental_Arrows_B', + bmp: '\u2900-\u297F' + }, + { + name: 'InSupplemental_Arrows_C', + astral: '\uD83E[\uDC00-\uDCFF]' + }, + { + name: 'InSupplemental_Mathematical_Operators', + bmp: '\u2A00-\u2AFF' + }, + { + name: 'InSupplemental_Punctuation', + bmp: '\u2E00-\u2E7F' + }, + { + name: 'InSupplemental_Symbols_and_Pictographs', + astral: '\uD83E[\uDD00-\uDDFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_A', + astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_B', + astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'InSutton_SignWriting', + astral: '\uD836[\uDC00-\uDEAF]' + }, + { + name: 'InSyloti_Nagri', + bmp: '\uA800-\uA82F' + }, + { + name: 'InSyriac', + bmp: '\u0700-\u074F' + }, + { + name: 'InTagalog', + bmp: '\u1700-\u171F' + }, + { + name: 'InTagbanwa', + bmp: '\u1760-\u177F' + }, + { + name: 'InTags', + astral: '\uDB40[\uDC00-\uDC7F]' + }, + { + name: 'InTai_Le', + bmp: '\u1950-\u197F' + }, + { + name: 'InTai_Tham', + bmp: '\u1A20-\u1AAF' + }, + { + name: 'InTai_Viet', + bmp: '\uAA80-\uAADF' + }, + { + name: 'InTai_Xuan_Jing_Symbols', + astral: '\uD834[\uDF00-\uDF5F]' + }, + { + name: 'InTakri', + astral: '\uD805[\uDE80-\uDECF]' + }, + { + name: 'InTamil', + bmp: '\u0B80-\u0BFF' + }, + { + name: 'InTangut', + astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, + { + name: 'InTangut_Components', + astral: '\uD822[\uDC00-\uDEFF]' + }, + { + name: 'InTelugu', + bmp: '\u0C00-\u0C7F' + }, + { + name: 'InThaana', + bmp: '\u0780-\u07BF' + }, + { + name: 'InThai', + bmp: '\u0E00-\u0E7F' + }, + { + name: 'InTibetan', + bmp: '\u0F00-\u0FFF' + }, + { + name: 'InTifinagh', + bmp: '\u2D30-\u2D7F' + }, + { + name: 'InTirhuta', + astral: '\uD805[\uDC80-\uDCDF]' + }, + { + name: 'InTransport_and_Map_Symbols', + astral: '\uD83D[\uDE80-\uDEFF]' + }, + { + name: 'InUgaritic', + astral: '\uD800[\uDF80-\uDF9F]' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics', + bmp: '\u1400-\u167F' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + bmp: '\u18B0-\u18FF' + }, + { + name: 'InVai', + bmp: '\uA500-\uA63F' + }, + { + name: 'InVariation_Selectors', + bmp: '\uFE00-\uFE0F' + }, + { + name: 'InVariation_Selectors_Supplement', + astral: '\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'InVedic_Extensions', + bmp: '\u1CD0-\u1CFF' + }, + { + name: 'InVertical_Forms', + bmp: '\uFE10-\uFE1F' + }, + { + name: 'InWarang_Citi', + astral: '\uD806[\uDCA0-\uDCFF]' + }, + { + name: 'InYi_Radicals', + bmp: '\uA490-\uA4CF' + }, + { + name: 'InYi_Syllables', + bmp: '\uA000-\uA48F' + }, + { + name: 'InYijing_Hexagram_Symbols', + bmp: '\u4DC0-\u4DFF' + } + ]); +}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-categories.js b/scripts/node_modules/xregexp/src/addons/unicode-categories.js new file mode 100644 index 00000000..a5a70f63 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/unicode-categories.js @@ -0,0 +1,234 @@ +/*! + * XRegExp Unicode Categories 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +export default (XRegExp) => { + + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData([ + { + name: 'C', + alias: 'Other', + isBmpLast: true, + bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, + { + name: 'Cc', + alias: 'Control', + bmp: '\0-\x1F\x7F-\x9F' + }, + { + name: 'Cf', + alias: 'Format', + bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + name: 'Cn', + alias: 'Unassigned', + bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + name: 'Co', + alias: 'Private_Use', + bmp: '\uE000-\uF8FF', + astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + name: 'Cs', + alias: 'Surrogate', + bmp: '\uD800-\uDFFF' + }, + { + name: 'L', + alias: 'Letter', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, + { + name: 'Ll', + alias: 'Lowercase_Letter', + bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + name: 'Lm', + alias: 'Modifier_Letter', + bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' + }, + { + name: 'Lo', + alias: 'Other_Letter', + bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, + { + name: 'Lt', + alias: 'Titlecase_Letter', + bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + name: 'Lu', + alias: 'Uppercase_Letter', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, + { + name: 'M', + alias: 'Mark', + bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Mc', + alias: 'Spacing_Mark', + bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, + { + name: 'Me', + alias: 'Enclosing_Mark', + bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + name: 'Mn', + alias: 'Nonspacing_Mark', + bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'N', + alias: 'Number', + bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' + }, + { + name: 'Nd', + alias: 'Decimal_Number', + bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, + { + name: 'Nl', + alias: 'Letter_Number', + bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, + { + name: 'No', + alias: 'Other_Number', + bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' + }, + { + name: 'P', + alias: 'Punctuation', + bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + name: 'Pc', + alias: 'Connector_Punctuation', + bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + name: 'Pd', + alias: 'Dash_Punctuation', + bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + name: 'Pe', + alias: 'Close_Punctuation', + bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + name: 'Pf', + alias: 'Final_Punctuation', + bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + name: 'Pi', + alias: 'Initial_Punctuation', + bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + name: 'Po', + alias: 'Other_Punctuation', + bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, + { + name: 'Ps', + alias: 'Open_Punctuation', + bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + name: 'S', + alias: 'Symbol', + bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, + { + name: 'Sc', + alias: 'Currency_Symbol', + bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' + }, + { + name: 'Sk', + alias: 'Modifier_Symbol', + bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + astral: '\uD83C[\uDFFB-\uDFFF]' + }, + { + name: 'Sm', + alias: 'Math_Symbol', + bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, + { + name: 'So', + alias: 'Other_Symbol', + bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, + { + name: 'Z', + alias: 'Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + name: 'Zl', + alias: 'Line_Separator', + bmp: '\u2028' + }, + { + name: 'Zp', + alias: 'Paragraph_Separator', + bmp: '\u2029' + }, + { + name: 'Zs', + alias: 'Space_Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } + ]); +}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-properties.js b/scripts/node_modules/xregexp/src/addons/unicode-properties.js new file mode 100644 index 00000000..12773b79 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/unicode-properties.js @@ -0,0 +1,104 @@ +/*! + * XRegExp Unicode Properties 4.0.0 + * + * Steven Levithan (c) 2012-2017 MIT License + * Unicode data by Mathias Bynens + */ + +export default (XRegExp) => { + + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + const unicodeData = [ + { + name: 'ASCII', + bmp: '\0-\x7F' + }, + { + name: 'Alphabetic', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, + { + name: 'Any', + isBmpLast: true, + bmp: '\0-\uFFFF', + astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'Default_Ignorable_Code_Point', + bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, + { + name: 'Lowercase', + bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, + { + name: 'Noncharacter_Code_Point', + bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', + astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, + { + name: 'Uppercase', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + name: 'White_Space', + bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } + ]; + + // Add non-generated data + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + + XRegExp.addUnicodeData(unicodeData); +}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-scripts.js b/scripts/node_modules/xregexp/src/addons/unicode-scripts.js new file mode 100644 index 00000000..84223099 --- /dev/null +++ b/scripts/node_modules/xregexp/src/addons/unicode-scripts.js @@ -0,0 +1,584 @@ +/*! + * XRegExp Unicode Scripts 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +export default (XRegExp) => { + + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData([ + { + name: 'Adlam', + astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, + { + name: 'Ahom', + astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + name: 'Anatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE46]' + }, + { + name: 'Arabic', + bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + name: 'Armenian', + bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + name: 'Avestan', + astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + name: 'Balinese', + bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + name: 'Bamum', + bmp: '\uA6A0-\uA6F7', + astral: '\uD81A[\uDC00-\uDE38]' + }, + { + name: 'Bassa_Vah', + astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + name: 'Batak', + bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + name: 'Bengali', + bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' + }, + { + name: 'Bhaiksuki', + astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, + { + name: 'Bopomofo', + bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' + }, + { + name: 'Brahmi', + astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + name: 'Braille', + bmp: '\u2800-\u28FF' + }, + { + name: 'Buginese', + bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + name: 'Buhid', + bmp: '\u1740-\u1753' + }, + { + name: 'Canadian_Aboriginal', + bmp: '\u1400-\u167F\u18B0-\u18F5' + }, + { + name: 'Carian', + astral: '\uD800[\uDEA0-\uDED0]' + }, + { + name: 'Caucasian_Albanian', + astral: '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + name: 'Chakma', + astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' + }, + { + name: 'Cham', + bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + name: 'Cherokee', + bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + name: 'Common', + bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, + { + name: 'Coptic', + bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + name: 'Cuneiform', + astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, + { + name: 'Cypriot', + astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + name: 'Cyrillic', + bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + name: 'Deseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'Devanagari', + bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' + }, + { + name: 'Duployan', + astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + name: 'Egyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + name: 'Elbasan', + astral: '\uD801[\uDD00-\uDD27]' + }, + { + name: 'Ethiopic', + bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + name: 'Georgian', + bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + name: 'Glagolitic', + bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', + astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, + { + name: 'Gothic', + astral: '\uD800[\uDF30-\uDF4A]' + }, + { + name: 'Grantha', + astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + name: 'Greek', + bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + name: 'Gujarati', + bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' + }, + { + name: 'Gurmukhi', + bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' + }, + { + name: 'Han', + bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', + astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, + { + name: 'Hangul', + bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + name: 'Hanunoo', + bmp: '\u1720-\u1734' + }, + { + name: 'Hatran', + astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + name: 'Hebrew', + bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + name: 'Hiragana', + bmp: '\u3041-\u3096\u309D-\u309F', + astral: '\uD82C\uDC01|\uD83C\uDE00' + }, + { + name: 'Imperial_Aramaic', + astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + name: 'Inherited', + bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Inscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + name: 'Inscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + name: 'Javanese', + bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + name: 'Kaithi', + astral: '\uD804[\uDC80-\uDCC1]' + }, + { + name: 'Kannada', + bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + name: 'Katakana', + bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + astral: '\uD82C\uDC00' + }, + { + name: 'Kayah_Li', + bmp: '\uA900-\uA92D\uA92F' + }, + { + name: 'Kharoshthi', + astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' + }, + { + name: 'Khmer', + bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + name: 'Khojki', + astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, + { + name: 'Khudawadi', + astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + name: 'Lao', + bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + name: 'Latin', + bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + name: 'Lepcha', + bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + name: 'Limbu', + bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + name: 'Linear_A', + astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + name: 'Linear_B', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + name: 'Lisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'Lycian', + astral: '\uD800[\uDE80-\uDE9C]' + }, + { + name: 'Lydian', + astral: '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + name: 'Mahajani', + astral: '\uD804[\uDD50-\uDD76]' + }, + { + name: 'Malayalam', + bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, + { + name: 'Mandaic', + bmp: '\u0840-\u085B\u085E' + }, + { + name: 'Manichaean', + astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + name: 'Marchen', + astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, + { + name: 'Meetei_Mayek', + bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + name: 'Mende_Kikakui', + astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + name: 'Meroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + name: 'Meroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'Miao', + astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + name: 'Modi', + astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + name: 'Mongolian', + bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', + astral: '\uD805[\uDE60-\uDE6C]' + }, + { + name: 'Mro', + astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + name: 'Multani', + astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + name: 'Myanmar', + bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + name: 'Nabataean', + astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + name: 'New_Tai_Lue', + bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + name: 'Newa', + astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' + }, + { + name: 'Nko', + bmp: '\u07C0-\u07FA' + }, + { + name: 'Ogham', + bmp: '\u1680-\u169C' + }, + { + name: 'Ol_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'Old_Hungarian', + astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + name: 'Old_Italic', + astral: '\uD800[\uDF00-\uDF23]' + }, + { + name: 'Old_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'Old_Permic', + astral: '\uD800[\uDF50-\uDF7A]' + }, + { + name: 'Old_Persian', + astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + name: 'Old_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'Old_Turkic', + astral: '\uD803[\uDC00-\uDC48]' + }, + { + name: 'Oriya', + bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + name: 'Osage', + astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, + { + name: 'Osmanya', + astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + name: 'Pahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + name: 'Palmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'Pau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEF8]' + }, + { + name: 'Phags_Pa', + bmp: '\uA840-\uA877' + }, + { + name: 'Phoenician', + astral: '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + name: 'Psalter_Pahlavi', + astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + name: 'Rejang', + bmp: '\uA930-\uA953\uA95F' + }, + { + name: 'Runic', + bmp: '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + name: 'Samaritan', + bmp: '\u0800-\u082D\u0830-\u083E' + }, + { + name: 'Saurashtra', + bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' + }, + { + name: 'Sharada', + astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + name: 'Shavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'Siddham', + astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + name: 'SignWriting', + astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + name: 'Sinhala', + bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + astral: '\uD804[\uDDE1-\uDDF4]' + }, + { + name: 'Sora_Sompeng', + astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + name: 'Sundanese', + bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + name: 'Syloti_Nagri', + bmp: '\uA800-\uA82B' + }, + { + name: 'Syriac', + bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' + }, + { + name: 'Tagalog', + bmp: '\u1700-\u170C\u170E-\u1714' + }, + { + name: 'Tagbanwa', + bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + name: 'Tai_Le', + bmp: '\u1950-\u196D\u1970-\u1974' + }, + { + name: 'Tai_Tham', + bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + name: 'Tai_Viet', + bmp: '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + name: 'Takri', + astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + name: 'Tamil', + bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + name: 'Tangut', + astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' + }, + { + name: 'Telugu', + bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + name: 'Thaana', + bmp: '\u0780-\u07B1' + }, + { + name: 'Thai', + bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + name: 'Tibetan', + bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + name: 'Tifinagh', + bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + name: 'Tirhuta', + astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + name: 'Ugaritic', + astral: '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + name: 'Vai', + bmp: '\uA500-\uA62B' + }, + { + name: 'Warang_Citi', + astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + name: 'Yi', + bmp: '\uA000-\uA48C\uA490-\uA4C6' + } + ]); +}; diff --git a/scripts/node_modules/xregexp/src/index.js b/scripts/node_modules/xregexp/src/index.js new file mode 100644 index 00000000..5ea36461 --- /dev/null +++ b/scripts/node_modules/xregexp/src/index.js @@ -0,0 +1,19 @@ +import XRegExp from './xregexp'; + +import build from './addons/build'; +import matchrecursive from './addons/matchrecursive'; +import unicodeBase from './addons/unicode-base'; +import unicodeBlocks from './addons/unicode-blocks'; +import unicodeCategories from './addons/unicode-categories'; +import unicodeProperties from './addons/unicode-properties'; +import unicodeScripts from './addons/unicode-scripts'; + +build(XRegExp); +matchrecursive(XRegExp); +unicodeBase(XRegExp); +unicodeBlocks(XRegExp); +unicodeCategories(XRegExp); +unicodeProperties(XRegExp); +unicodeScripts(XRegExp); + +export default XRegExp; diff --git a/scripts/node_modules/xregexp/src/xregexp.js b/scripts/node_modules/xregexp/src/xregexp.js new file mode 100644 index 00000000..1a95dfd4 --- /dev/null +++ b/scripts/node_modules/xregexp/src/xregexp.js @@ -0,0 +1,1827 @@ +/*! + * XRegExp 4.0.0 + * + * Steven Levithan (c) 2007-2017 MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ + +// ==--------------------------== +// Private stuff +// ==--------------------------== + +// Property name used for extended regex instance data +const REGEX_DATA = 'xregexp'; +// Optional features that can be installed and uninstalled +const features = { + astral: false +}; +// Native methods to use and restore ('native' is an ES3 reserved keyword) +const nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; +// Storage for fixed/extended native methods +const fixed = {}; +// Storage for regexes cached by `XRegExp.cache` +let regexCache = {}; +// Storage for pattern details cached by the `XRegExp` constructor +let patternCache = {}; +// Storage for regex syntax tokens added internally or by `XRegExp.addToken` +const tokens = []; +// Token scopes +const defaultScope = 'default'; +const classScope = 'class'; +// Regexes that match native regex syntax, including octals +const nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; +// Any backreference or dollar-prefixed character in replacement strings +const replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; +// Check for correct `exec` handling of nonparticipating capturing groups +const correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; +// Check for ES6 `flags` prop support +const hasFlagsProp = /x/.flags !== undefined; +// Shortcut to `Object.prototype.toString` +const toString = {}.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + let isSupported = true; + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + return isSupported; +} +// Check for ES6 `u` flag support +const hasNativeU = hasNativeFlag('u'); +// Check for ES6 `y` flag support +const hasNativeY = hasNativeFlag('y'); +// Tracker for known flags, including addon flags +const registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; + +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + let p; + + regex[REGEX_DATA] = { + captureNames + }; + + if (isInternalOnly) { + return regex; + } + + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; + // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + + return regex; +} + +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} + +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + const xData = regex[REGEX_DATA] || {}; + let flags = getNativeFlags(regex); + let flagsToAdd = ''; + let flagsToRemove = ''; + let xregexpSource = null; + let xregexpFlags = null; + + options = options || {}; + + if (options.removeG) {flagsToRemove += 'g';} + if (options.removeY) {flagsToRemove += 'y';} + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp(`[${flagsToRemove}]+`, 'g'), ''); + } + + if (options.addG) {flagsToAdd += 'g';} + if (options.addY) {flagsToAdd += 'y';} + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } + // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } + + // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + regex = augment( + new RegExp(options.source || regex.source, flags), + hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, + xregexpSource, + xregexpFlags, + options.isInternalOnly + ); + + return regex; +} + +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ +function dec(hex) { + return parseInt(hex, 16); +} + +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ +function getContextualTokenSeparator(match, scope, flags) { + if ( + // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || + match.input[match.index + match[0].length] === ')' || + // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags) + ) { + return ''; + } + // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + return '(?:)'; +} + +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ +function getNativeFlags(regex) { + return hasFlagsProp ? + regex.flags : + // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} + +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} + +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ +function hex(dec) { + return parseInt(dec, 10).toString(16); +} + +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ +function isQuantifierNext(pattern, pos, flags) { + const inlineCommentPattern = '\\(\\?#[^)]*\\)'; + const lineCommentPattern = '#[^#\\n]*'; + const quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; + return nativ.test.call( + flags.includes('x') ? + // Ignore any leading whitespace, line comments, and inline comments + new RegExp(`^(?:\\s|${lineCommentPattern}|${inlineCommentPattern})*(?:${quantifierPattern})`) : + // Ignore any leading inline comments + new RegExp(`^(?:${inlineCommentPattern})*(?:${quantifierPattern})`), + pattern.slice(pos) + ); +} + +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ +function isType(value, type) { + return toString.call(value) === `[object ${type}]`; +} + +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ +function pad4(str) { + while (str.length < 4) { + str = `0${str}`; + } + return str; +} + +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ +function prepareFlags(pattern, flags) { + let i; + + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError(`Invalid duplicate regex flag ${flags}`); + } + + // Strip and apply a leading mode modifier with any combination of flags except g or y + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, ($0, $1) => { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError(`Cannot use flag g or y in mode modifier ${$0}`); + } + // Allow duplicate flags within the mode modifier + flags = clipDuplicates(flags + $1); + return ''; + }); + + // Throw on unknown native or nonnative flags + for (i = 0; i < flags.length; ++i) { + if (!registeredFlags[flags[i]]) { + throw new SyntaxError(`Unknown regex flag ${flags[i]}`); + } + } + + return { + pattern, + flags + }; +} + +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ +function prepareOptions(value) { + const options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, (match) => { + options[match] = true; + }); + + return options; + } + + return value; +} + +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} + +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ +function runTokens(pattern, flags, pos, scope, context) { + let i = tokens.length; + const leadChar = pattern[pos]; + let result = null; + let match; + let t; + + // Run in reverse insertion order + while (i--) { + t = tokens[i]; + if ( + (t.leadChar && t.leadChar !== leadChar) || + (t.scope !== scope && t.scope !== 'all') || + (t.flag && !flags.includes(t.flag)) + ) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; + // Finished with token tests + break; + } + } + + return result; +} + +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ +function setAstral(on) { + features.astral = on; +} + +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} + +// ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + return copyRegex(pattern); + } + + // Copy the argument behavior of `RegExp` + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !flags.includes('A')) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + const context = { + hasNamedCapture: false, + captureNames: [] + }; + let scope = defaultScope; + let output = ''; + let pos = 0; + let result; + + // Check for flag-related errors, and strip/apply flags in a leading mode modifier + const applied = prepareFlags(pattern, flags); + let appliedPattern = applied.pattern; + const appliedFlags = applied.flags; + + // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); + // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + + result.output + + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += (result.matchLength || 1); + } else { + // Get the native token at the current position + const token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; + output += token; + pos += token.length; + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + const generated = patternCache[pattern][flags]; + return augment( + new RegExp(generated.pattern, generated.flags), + generated.captures, + pattern, + flags + ); +} + +// Add `RegExp.prototype` to the prototype chain +XRegExp.prototype = new RegExp(); + +// ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ +XRegExp.version = '4.0.0'; + +// ==--------------------------== +// Public methods +// ==--------------------------== + +// Intentionally undocumented; used in tests and addons +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; + +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ +XRegExp.addToken = (regex, handler, options) => { + options = options || {}; + let optionalFlags = options.optionalFlags; + let i; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + for (i = 0; i < optionalFlags.length; ++i) { + registerFlag(optionalFlags[i]); + } + } + + // Add to the private list of syntax tokens + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + XRegExp.cache.flush('patterns'); +}; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ +XRegExp.cache = (pattern, flags) => { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + return regexCache[pattern][flags] || ( + regexCache[pattern][flags] = XRegExp(pattern, flags) + ); +}; + +// Intentionally undocumented; used in tests +XRegExp.cache.flush = (cacheName) => { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ +XRegExp.escape = (str) => nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ +XRegExp.exec = (str, regex, pos, sticky) => { + let cacheKey = 'g'; + let addY = false; + let fakeY = false; + let match; + + addY = hasNativeY && !!(sticky || (regex.sticky && sticky !== false)); + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.match`/`replace` + const r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY, + source: fakeY ? `${regex.source}|()` : undefined, + removeY: sticky === false, + isInternalOnly: true + }) + ); + + pos = pos || 0; + r2.lastIndex = pos; + + // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + match = fixed.exec.call(r2, str); + + // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; + +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ +XRegExp.forEach = (str, regex, callback) => { + let pos = 0; + let i = -1; + let match; + + while ((match = XRegExp.exec(str, regex, pos))) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + + pos = match.index + (match[0].length || 1); + } +}; + +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ +XRegExp.globalize = (regex) => copyRegex(regex, {addG: true}); + +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true + * }); + * + * // With an options string + * XRegExp.install('astral'); + */ +XRegExp.install = (options) => { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } +}; + +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ +XRegExp.isInstalled = (feature) => !!(features[feature]); + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ +XRegExp.isRegExp = (value) => toString.call(value) === '[object RegExp]'; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ +XRegExp.match = (str, regex, scope) => { + const global = (regex.global && scope !== 'one') || scope === 'all'; + const cacheKey = ((global ? 'g' : '') + (regex.sticky ? 'y' : '')) || 'noGY'; + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`replace` + const r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + + const result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = ( + (scope === 'one' && result) ? + // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + (result.index + result[0].length) : 0 + ); + } + + return global ? (result || []) : (result && result[0]); +}; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ +XRegExp.matchChain = (str, chain) => (function recurseChain(values, level) { + const item = chain[level].regex ? chain[level] : {regex: chain[level]}; + const matches = []; + + function addMatch(match) { + if (item.backref) { + // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the + // `undefined`s for backreferences to nonparticipating capturing groups. In such + // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw + // the exception, so also check if the backreference is a number that is within the + // bounds of the array. + if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { + throw new ReferenceError(`Backreference to undefined group: ${item.backref}`); + } + + matches.push(match[item.backref] || ''); + } else { + matches.push(match[0]); + } + } + + for (let i = 0; i < values.length; ++i) { + XRegExp.forEach(values[i], item.regex, addMatch); + } + + return ((level === chain.length - 1) || !matches.length) ? + matches : + recurseChain(matches, level + 1); +}([str], 0)); + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ +XRegExp.replace = (str, search, replacement, scope) => { + const isRegex = XRegExp.isRegExp(search); + const global = (search.global && scope !== 'one') || scope === 'all'; + const cacheKey = ((global ? 'g' : '') + (search.sticky ? 'y' : '')) || 'noGY'; + let s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + s2 = search[REGEX_DATA][cacheKey] || ( + search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } + + // Fixed `replace` required for named backreferences, etc. + const result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; + +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ +XRegExp.replaceEach = (str, replacements) => { + let i; + let r; + + for (i = 0; i < replacements.length; ++i) { + r = replacements[i]; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + + return str; +}; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ +XRegExp.split = (str, separator, limit) => fixed.split.call(toObject(str), separator, limit); + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) +XRegExp.test = (str, regex, pos, sticky) => !!XRegExp.exec(str, regex, pos, sticky); + +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral'); + */ +XRegExp.uninstall = (options) => { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } +}; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ +XRegExp.union = (patterns, flags, options) => { + options = options || {}; + const conjunction = options.conjunction || 'or'; + let numCaptures = 0; + let numPriorCaptures; + let captureNames; + + function rewrite(match, paren, backref) { + const name = captureNames[numCaptures - numPriorCaptures]; + + // Capturing group + if (paren) { + ++numCaptures; + // If the current capture has a name, preserve the name + if (name) { + return `(?<${name}>`; + } + // Backreference + } else if (backref) { + // Rewrite the backreference + return `\\${+backref + numPriorCaptures}`; + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + const parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + const output = []; + let pattern; + for (let i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = (pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames) || []; + + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + + const separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; + +// ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ +fixed.exec = function(str) { + const origLastIndex = this.lastIndex; + const match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.includes('')) { + const r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, (...args) => { + const len = args.length; + // Skip index 0 and the last 2 + for (let i = 1; i < len - 2; ++i) { + if (args[i] === undefined) { + match[i] = undefined; + } + } + }); + } + + // Attach named capture properties + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (let i = 1; i < match.length; ++i) { + const name = this[REGEX_DATA].captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && (this.lastIndex > match.index)) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ +fixed.test = function(str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ +fixed.match = function(regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + const result = nativ.match.apply(this, arguments); + // Fixes IE bug + regex.lastIndex = 0; + + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; + +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ +fixed.replace = function(search, replacement) { + const isRegex = XRegExp.isRegExp(search); + let origLastIndex; + let captureNames; + let result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } + // Only needed if `search` is nonglobal + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } + + // Don't use `typeof`; some older browsers return 'function' for regex objects + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, (...args) => { + if (captureNames) { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (let i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + // ES6 specs the context for replacement functions as `undefined` + return replacement(...args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, (...args) => { + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; + // Named or numbered backreference with curly or angled braces + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + let n = +bracketed; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ''; + } + // Groups with the same name is an error, else would need `lastIndexOf` + n = captureNames ? captureNames.indexOf(bracketed) : -1; + if (n < 0) { + throw new SyntaxError(`Backreference to undefined group ${$0}`); + } + return args[n + 1] || ''; + } + // Else, special variable or numbered backreference without curly braces + if (dollarToken === '$') { // $$ + return '$'; + } + if (dollarToken === '&' || +dollarToken === 0) { // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + if (dollarToken === '`') { // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + if (dollarToken === "'") { // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } + // Else, numbered backreference without braces + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError(`Backreference to undefined group ${$0}`); + } + return args[dollarToken] || ''; + } + // `$` followed by an unsupported char is an error, unlike native JS + throw new SyntaxError(`Invalid token ${$0}`); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ +fixed.split = function(separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + const str = String(this); + const output = []; + const origLastIndex = separator.lastIndex; + let lastLastIndex = 0; + let lastLength; + + // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + limit = (limit === undefined ? -1 : limit) >>> 0; + + XRegExp.forEach(str, separator, (match) => { + // This condition is not the same as `if (match[0].length)` + if ((match.index + match[0].length) > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; + +// ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ +XRegExp.addToken( + /\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, + (match, scope) => { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError(`Invalid escape ${match[0]}`); + }, + { + scope: 'all', + leadChar: '\\' + } +); + +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ +XRegExp.addToken( + /\\u{([\dA-Fa-f]+)}/, + (match, scope, flags) => { + const code = dec(match[1]); + if (code > 0x10FFFF) { + throw new SyntaxError(`Invalid Unicode code point ${match[0]}`); + } + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return `\\u${pad4(hex(code))}`; + } + // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + if (hasNativeU && flags.includes('u')) { + return match[0]; + } + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); + }, + { + scope: 'all', + leadChar: '\\' + } +); + +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ +XRegExp.addToken( + /\[(\^?)\]/, + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in some versions of Firefox + /* eslint-disable no-confusing-arrow */ + (match) => (match[1] ? '[\\s\\S]' : '\\b\\B'), + /* eslint-enable no-confusing-arrow */ + {leadChar: '['} +); + +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ +XRegExp.addToken( + /\(\?#[^)]*\)/, + getContextualTokenSeparator, + {leadChar: '('} +); + +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ +XRegExp.addToken( + /\s+|#[^\n]*\n?/, + getContextualTokenSeparator, + {flag: 'x'} +); + +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ +XRegExp.addToken( + /\./, + () => '[\\s\\S]', + { + flag: 's', + leadChar: '.' + } +); + +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ +XRegExp.addToken( + /\\k<([\w$]+)>/, + function(match) { + // Groups with the same name is an error, else would need `lastIndexOf` + const index = isNaN(match[1]) ? (this.captureNames.indexOf(match[1]) + 1) : +match[1]; + const endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError(`Backreference to undefined group ${match[0]}`); + } + // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + return `\\${index}${ + endIndex === match.input.length || isNaN(match.input[endIndex]) ? + '' : '(?:)' + }`; + }, + {leadChar: '\\'} +); + +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ +XRegExp.addToken( + /\\(\d+)/, + function(match, scope) { + if ( + !( + scope === defaultScope && + /^[1-9]/.test(match[1]) && + +match[1] <= this.captureNames.length + ) && + match[1] !== '0' + ) { + throw new SyntaxError(`Cannot use octal escape or backreference to undefined group ${match[0]}`); + } + return match[0]; + }, + { + scope: 'all', + leadChar: '\\' + } +); + +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ +XRegExp.addToken( + /\(\?P?<([\w$]+)>/, + function(match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError(`Cannot use integer as capture name ${match[0]}`); + } + if (match[1] === 'length' || match[1] === '__proto__') { + throw new SyntaxError(`Cannot use reserved word as capture name ${match[0]}`); + } + if (this.captureNames.includes(match[1])) { + throw new SyntaxError(`Cannot use same name for multiple groups ${match[0]}`); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; + }, + {leadChar: '('} +); + +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ +XRegExp.addToken( + /\((?!\?)/, + function(match, scope, flags) { + if (flags.includes('n')) { + return '(?:'; + } + this.captureNames.push(null); + return '('; + }, + { + optionalFlags: 'n', + leadChar: '(' + } +); + +export default XRegExp; diff --git a/scripts/node_modules/xregexp/xregexp-all.js b/scripts/node_modules/xregexp/xregexp-all.js new file mode 100644 index 00000000..f4326999 --- /dev/null +++ b/scripts/node_modules/xregexp/xregexp-all.js @@ -0,0 +1,4156 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.XRegExp = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + * Steven Levithan (c) 2012-2017 MIT License + */ + +exports.default = function (XRegExp) { + var REGEX_DATA = 'xregexp'; + var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { + conjunction: 'or' + }); + + /** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/; + var trailingAnchor = /\$(?:\(\?:\))*$/; + + if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && + // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + + /** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not + * already a regex generated by XRegExp + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + function asXRegExp(value, addFlagX) { + var flags = addFlagX ? 'x' : ''; + return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? + // Don't recompile, to preserve capture names + value : + // Recompile as XRegExp + XRegExp(value.source, flags) : + // Compile string as XRegExp + XRegExp(value, flags); + } + + function interpolate(substitution) { + return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); + } + + function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { + subpatterns['subpattern' + subpatternIndex] = interpolated; + return subpatterns; + } + + function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { + var hasSubpattern = subpatternIndex < rawLiterals.length - 1; + return raw + (hasSubpattern ? '{{subpattern' + subpatternIndex + '}}' : ''); + } + + /** + * Provides tagged template literals that create regexes with XRegExp syntax and flags. The + * provided pattern is handled as a raw string, so backslashes don't need to be escaped. + * + * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated + * patterns are treated as atomic units when quantified, interpolated strings have their special + * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated + * regexes if both are present, and any backreferences within an interpolated regex are + * rewritten to work within the overall pattern. + * + * @memberOf XRegExp + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. + * @example + * + * const h12 = /1[0-2]|0?[1-9]/; + * const h24 = /2[0-3]|[01][0-9]/; + * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; + * const minutes = /^[0-5][0-9]$/; + * // Note that explicitly naming the 'minutes' group is required for named backreferences + * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.tag = function (flags) { + return function (literals) { + for (var _len = arguments.length, substitutions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + substitutions[_key - 1] = arguments[_key]; + } + + var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); + var pattern = literals.raw.map(embedSubpatternAfter).join(''); + return XRegExp.build(pattern, subpatterns, flags); + }; + }; + + /** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in + * the outer pattern and provided subpatterns are automatically renumbered to work correctly. + * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.build = function (pattern, subs, flags) { + flags = flags || ''; + // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how + // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` + // and `n`. See more details at . + var addFlagX = flags.indexOf('x') !== -1; + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); + // Add flags within a leading mode modifier to the overall pattern's flags + if (inlineFlags) { + flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); + } + + var data = {}; + for (var p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity. + var sub = asXRegExp(subs[p], addFlagX); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`). + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } + + // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back. + var patternAsRegex = asXRegExp(pattern, addFlagX); + + // 'Caps' is short for 'captures' + var numCaps = 0; + var numPriorCaps = void 0; + var numOuterCaps = 0; + var outerCapsMap = [0]; + var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; + var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { + var subName = $1 || $2; + var capName = void 0; + var intro = void 0; + var localCapIndex = void 0; + // Named subpattern + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError('Undefined property ' + $0); + } + // Named subpattern was wrapped in a capturing group + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + intro = '(?<' + (capName || subName) + '>'; + } else { + intro = '(?:'; + } + numPriorCaps = numCaps; + var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if (backref) { + localCapIndex = +backref - 1; + // Rewrite the backreference + return data[subName].names[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + data[subName].names[localCapIndex] + '>' : '\\' + (+backref + numPriorCaps); + } + return match; + }); + return '' + intro + rewrittenSubpattern + ')'; + } + // Capturing group + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if ($4) { + localCapIndex = +$4 - 1; + // Rewrite the backreference + return outerCapNames[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + outerCapNames[localCapIndex] + '>' : '\\' + outerCapsMap[+$4]; + } + return $0; + }); + + return XRegExp(output, flags); + }; +}; + +module.exports = exports['default']; +},{}],2:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp.matchRecursive 4.0.0 + * + * Steven Levithan (c) 2009-2017 MIT License + */ + +exports.default = function (XRegExp) { + + /** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + + /** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * let str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
an
example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
', start: 8, end: 13}, + * // {name: 'match', value: '
an
', start: 13, end: 27}, + * // {name: 'right', value: '
', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + XRegExp.matchRecursive = function (str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') !== -1; + var sticky = flags.indexOf('y') !== -1; + // Flag `y` is controlled internally + var basicFlags = flags.replace(/y/g, ''); + var escapeChar = options.escapeChar; + var vN = options.valueNames; + var output = []; + var openTokens = 0; + var delimStart = 0; + var delimEnd = 0; + var lastOuterEnd = 0; + var outerStart = void 0; + var innerStart = void 0; + var leftMatch = void 0; + var rightMatch = void 0; + var esc = void 0; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + escapeChar = XRegExp.escape(escapeChar); + // Example of concatenated `esc` regex: + // `escapeChar`: '%' + // `left`: '<' + // `right`: '>' + // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ + esc = new RegExp('(?:' + escapeChar + '[\\S\\s]|(?:(?!' + + // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. + // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax + // transformation resulting from those flags was already applied to `left` and + // `right` when they were passed through the XRegExp constructor above. + XRegExp.union([left, right], '', { conjunction: 'or' }).source + ')[^' + escapeChar + '])+)+', + // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '')); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); + // Keep the leftmost match only + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } + // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + ++openTokens; + } else if (rightMatch && openTokens) { + if (! --openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } + // If the delimiter matched an empty string, avoid an infinite loop + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; +}; + +module.exports = exports['default']; +},{}],3:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Base 4.0.0 + * + * Steven Levithan (c) 2008-2017 MIT License + */ + +exports.default = function (XRegExp) { + + /** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the + * braces for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are + * available to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ + + // ==--------------------------== + // Private stuff + // ==--------------------------== + + // Storage for Unicode data + var unicode = {}; + + // Reuse utils + var dec = XRegExp._dec; + var hex = XRegExp._hex; + var pad4 = XRegExp._pad4; + + // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } + + // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); + } + + // Inverts a list of ordered BMP characters and ranges + function invertBmp(range) { + var output = ''; + var lastEnd = -1; + + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { + var start = charCode(m[1]); + if (start > lastEnd + 1) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (start > lastEnd + 2) { + output += '-\\u' + pad4(hex(start - 1)); + } + } + lastEnd = charCode(m[2] || m[1]); + }); + + if (lastEnd < 0xFFFF) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + + return output; + } + + // Generates an inverted BMP range on first use + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); + } + + // Combines and optionally negates BMP and astral data + function buildAstral(slug, isNegated) { + var item = unicode[slug]; + var combined = ''; + + if (item.bmp && !item.isBmpLast) { + combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); + } + if (item.astral) { + combined += item.astral; + } + if (item.isBmpLast && item.bmp) { + combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; + } + + // Astral Unicode tokens always match a code point, never a code unit + return isNegated ? '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : '(?:' + combined + ')'; + } + + // Builds a complete astral pattern on first use + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); + } + + // ==--------------------------== + // Core functionality + // ==--------------------------== + + /* + * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. + */ + XRegExp.addToken( + // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation '; + var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; + var ERR_UNKNOWN_REF = 'Unicode token missing data '; + var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; + var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; + // Negated via \P{..} or \p{^..} + var isNegated = match[1] === 'P' || !!match[2]; + // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + var isAstralMode = flags.indexOf('A') !== -1; + // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + var slug = normalize(match[4] || match[3]); + // Token data object + var item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } + + // Switch to the negated form of the referenced Unicode token + if (item.inverseOf) { + slug = normalize(item.inverseOf); + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); + } + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : (isNegated ? '[^' : '[') + item.bmp + ']'; + }, { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + }); + + /** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties + * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are + * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If + * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, + * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are + * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and + * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan + * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and + * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape + * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be + * escaped, apart from range-creating hyphens. The `astral` data can additionally use + * character classes and alternation, and should use surrogate pairs to represent astral code + * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is + * defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + XRegExp.addUnicodeData = function (data) { + var ERR_NO_NAME = 'Unicode token requires name'; + var ERR_NO_DATA = 'Unicode token has no character data '; + var item = void 0; + + for (var i = 0; i < data.length; ++i) { + item = data[i]; + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + unicode[normalize(item.name)] = item; + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + + /** + * @ignore + * + * Return a reference to the internal Unicode definition structure for the given Unicode + * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex + * constructs. + * + * @memberOf XRegExp + * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), + * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode + * Properties and Property Aliases. + * @returns {Object} Reference to definition structure when the name matches a Unicode Property. + * + * @note + * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. + * + * @note + * This method is *not* part of the officially documented API and may change or be removed in + * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode + * structures set up by XRegExp. + */ + XRegExp._getUnicodeProperty = function (name) { + var slug = normalize(name); + return unicode[slug]; + }; +}; + +module.exports = exports['default']; +},{}],4:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Blocks 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., + * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and + * underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData([{ + name: 'InAdlam', + astral: '\uD83A[\uDD00-\uDD5F]' + }, { + name: 'InAegean_Numbers', + astral: '\uD800[\uDD00-\uDD3F]' + }, { + name: 'InAhom', + astral: '\uD805[\uDF00-\uDF3F]' + }, { + name: 'InAlchemical_Symbols', + astral: '\uD83D[\uDF00-\uDF7F]' + }, { + name: 'InAlphabetic_Presentation_Forms', + bmp: '\uFB00-\uFB4F' + }, { + name: 'InAnatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE7F]' + }, { + name: 'InAncient_Greek_Musical_Notation', + astral: '\uD834[\uDE00-\uDE4F]' + }, { + name: 'InAncient_Greek_Numbers', + astral: '\uD800[\uDD40-\uDD8F]' + }, { + name: 'InAncient_Symbols', + astral: '\uD800[\uDD90-\uDDCF]' + }, { + name: 'InArabic', + bmp: '\u0600-\u06FF' + }, { + name: 'InArabic_Extended_A', + bmp: '\u08A0-\u08FF' + }, { + name: 'InArabic_Mathematical_Alphabetic_Symbols', + astral: '\uD83B[\uDE00-\uDEFF]' + }, { + name: 'InArabic_Presentation_Forms_A', + bmp: '\uFB50-\uFDFF' + }, { + name: 'InArabic_Presentation_Forms_B', + bmp: '\uFE70-\uFEFF' + }, { + name: 'InArabic_Supplement', + bmp: '\u0750-\u077F' + }, { + name: 'InArmenian', + bmp: '\u0530-\u058F' + }, { + name: 'InArrows', + bmp: '\u2190-\u21FF' + }, { + name: 'InAvestan', + astral: '\uD802[\uDF00-\uDF3F]' + }, { + name: 'InBalinese', + bmp: '\u1B00-\u1B7F' + }, { + name: 'InBamum', + bmp: '\uA6A0-\uA6FF' + }, { + name: 'InBamum_Supplement', + astral: '\uD81A[\uDC00-\uDE3F]' + }, { + name: 'InBasic_Latin', + bmp: '\0-\x7F' + }, { + name: 'InBassa_Vah', + astral: '\uD81A[\uDED0-\uDEFF]' + }, { + name: 'InBatak', + bmp: '\u1BC0-\u1BFF' + }, { + name: 'InBengali', + bmp: '\u0980-\u09FF' + }, { + name: 'InBhaiksuki', + astral: '\uD807[\uDC00-\uDC6F]' + }, { + name: 'InBlock_Elements', + bmp: '\u2580-\u259F' + }, { + name: 'InBopomofo', + bmp: '\u3100-\u312F' + }, { + name: 'InBopomofo_Extended', + bmp: '\u31A0-\u31BF' + }, { + name: 'InBox_Drawing', + bmp: '\u2500-\u257F' + }, { + name: 'InBrahmi', + astral: '\uD804[\uDC00-\uDC7F]' + }, { + name: 'InBraille_Patterns', + bmp: '\u2800-\u28FF' + }, { + name: 'InBuginese', + bmp: '\u1A00-\u1A1F' + }, { + name: 'InBuhid', + bmp: '\u1740-\u175F' + }, { + name: 'InByzantine_Musical_Symbols', + astral: '\uD834[\uDC00-\uDCFF]' + }, { + name: 'InCJK_Compatibility', + bmp: '\u3300-\u33FF' + }, { + name: 'InCJK_Compatibility_Forms', + bmp: '\uFE30-\uFE4F' + }, { + name: 'InCJK_Compatibility_Ideographs', + bmp: '\uF900-\uFAFF' + }, { + name: 'InCJK_Compatibility_Ideographs_Supplement', + astral: '\uD87E[\uDC00-\uDE1F]' + }, { + name: 'InCJK_Radicals_Supplement', + bmp: '\u2E80-\u2EFF' + }, { + name: 'InCJK_Strokes', + bmp: '\u31C0-\u31EF' + }, { + name: 'InCJK_Symbols_and_Punctuation', + bmp: '\u3000-\u303F' + }, { + name: 'InCJK_Unified_Ideographs', + bmp: '\u4E00-\u9FFF' + }, { + name: 'InCJK_Unified_Ideographs_Extension_A', + bmp: '\u3400-\u4DBF' + }, { + name: 'InCJK_Unified_Ideographs_Extension_B', + astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_C', + astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_D', + astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, { + name: 'InCJK_Unified_Ideographs_Extension_E', + astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' + }, { + name: 'InCarian', + astral: '\uD800[\uDEA0-\uDEDF]' + }, { + name: 'InCaucasian_Albanian', + astral: '\uD801[\uDD30-\uDD6F]' + }, { + name: 'InChakma', + astral: '\uD804[\uDD00-\uDD4F]' + }, { + name: 'InCham', + bmp: '\uAA00-\uAA5F' + }, { + name: 'InCherokee', + bmp: '\u13A0-\u13FF' + }, { + name: 'InCherokee_Supplement', + bmp: '\uAB70-\uABBF' + }, { + name: 'InCombining_Diacritical_Marks', + bmp: '\u0300-\u036F' + }, { + name: 'InCombining_Diacritical_Marks_Extended', + bmp: '\u1AB0-\u1AFF' + }, { + name: 'InCombining_Diacritical_Marks_Supplement', + bmp: '\u1DC0-\u1DFF' + }, { + name: 'InCombining_Diacritical_Marks_for_Symbols', + bmp: '\u20D0-\u20FF' + }, { + name: 'InCombining_Half_Marks', + bmp: '\uFE20-\uFE2F' + }, { + name: 'InCommon_Indic_Number_Forms', + bmp: '\uA830-\uA83F' + }, { + name: 'InControl_Pictures', + bmp: '\u2400-\u243F' + }, { + name: 'InCoptic', + bmp: '\u2C80-\u2CFF' + }, { + name: 'InCoptic_Epact_Numbers', + astral: '\uD800[\uDEE0-\uDEFF]' + }, { + name: 'InCounting_Rod_Numerals', + astral: '\uD834[\uDF60-\uDF7F]' + }, { + name: 'InCuneiform', + astral: '\uD808[\uDC00-\uDFFF]' + }, { + name: 'InCuneiform_Numbers_and_Punctuation', + astral: '\uD809[\uDC00-\uDC7F]' + }, { + name: 'InCurrency_Symbols', + bmp: '\u20A0-\u20CF' + }, { + name: 'InCypriot_Syllabary', + astral: '\uD802[\uDC00-\uDC3F]' + }, { + name: 'InCyrillic', + bmp: '\u0400-\u04FF' + }, { + name: 'InCyrillic_Extended_A', + bmp: '\u2DE0-\u2DFF' + }, { + name: 'InCyrillic_Extended_B', + bmp: '\uA640-\uA69F' + }, { + name: 'InCyrillic_Extended_C', + bmp: '\u1C80-\u1C8F' + }, { + name: 'InCyrillic_Supplement', + bmp: '\u0500-\u052F' + }, { + name: 'InDeseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, { + name: 'InDevanagari', + bmp: '\u0900-\u097F' + }, { + name: 'InDevanagari_Extended', + bmp: '\uA8E0-\uA8FF' + }, { + name: 'InDingbats', + bmp: '\u2700-\u27BF' + }, { + name: 'InDomino_Tiles', + astral: '\uD83C[\uDC30-\uDC9F]' + }, { + name: 'InDuployan', + astral: '\uD82F[\uDC00-\uDC9F]' + }, { + name: 'InEarly_Dynastic_Cuneiform', + astral: '\uD809[\uDC80-\uDD4F]' + }, { + name: 'InEgyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, { + name: 'InElbasan', + astral: '\uD801[\uDD00-\uDD2F]' + }, { + name: 'InEmoticons', + astral: '\uD83D[\uDE00-\uDE4F]' + }, { + name: 'InEnclosed_Alphanumeric_Supplement', + astral: '\uD83C[\uDD00-\uDDFF]' + }, { + name: 'InEnclosed_Alphanumerics', + bmp: '\u2460-\u24FF' + }, { + name: 'InEnclosed_CJK_Letters_and_Months', + bmp: '\u3200-\u32FF' + }, { + name: 'InEnclosed_Ideographic_Supplement', + astral: '\uD83C[\uDE00-\uDEFF]' + }, { + name: 'InEthiopic', + bmp: '\u1200-\u137F' + }, { + name: 'InEthiopic_Extended', + bmp: '\u2D80-\u2DDF' + }, { + name: 'InEthiopic_Extended_A', + bmp: '\uAB00-\uAB2F' + }, { + name: 'InEthiopic_Supplement', + bmp: '\u1380-\u139F' + }, { + name: 'InGeneral_Punctuation', + bmp: '\u2000-\u206F' + }, { + name: 'InGeometric_Shapes', + bmp: '\u25A0-\u25FF' + }, { + name: 'InGeometric_Shapes_Extended', + astral: '\uD83D[\uDF80-\uDFFF]' + }, { + name: 'InGeorgian', + bmp: '\u10A0-\u10FF' + }, { + name: 'InGeorgian_Supplement', + bmp: '\u2D00-\u2D2F' + }, { + name: 'InGlagolitic', + bmp: '\u2C00-\u2C5F' + }, { + name: 'InGlagolitic_Supplement', + astral: '\uD838[\uDC00-\uDC2F]' + }, { + name: 'InGothic', + astral: '\uD800[\uDF30-\uDF4F]' + }, { + name: 'InGrantha', + astral: '\uD804[\uDF00-\uDF7F]' + }, { + name: 'InGreek_Extended', + bmp: '\u1F00-\u1FFF' + }, { + name: 'InGreek_and_Coptic', + bmp: '\u0370-\u03FF' + }, { + name: 'InGujarati', + bmp: '\u0A80-\u0AFF' + }, { + name: 'InGurmukhi', + bmp: '\u0A00-\u0A7F' + }, { + name: 'InHalfwidth_and_Fullwidth_Forms', + bmp: '\uFF00-\uFFEF' + }, { + name: 'InHangul_Compatibility_Jamo', + bmp: '\u3130-\u318F' + }, { + name: 'InHangul_Jamo', + bmp: '\u1100-\u11FF' + }, { + name: 'InHangul_Jamo_Extended_A', + bmp: '\uA960-\uA97F' + }, { + name: 'InHangul_Jamo_Extended_B', + bmp: '\uD7B0-\uD7FF' + }, { + name: 'InHangul_Syllables', + bmp: '\uAC00-\uD7AF' + }, { + name: 'InHanunoo', + bmp: '\u1720-\u173F' + }, { + name: 'InHatran', + astral: '\uD802[\uDCE0-\uDCFF]' + }, { + name: 'InHebrew', + bmp: '\u0590-\u05FF' + }, { + name: 'InHigh_Private_Use_Surrogates', + bmp: '\uDB80-\uDBFF' + }, { + name: 'InHigh_Surrogates', + bmp: '\uD800-\uDB7F' + }, { + name: 'InHiragana', + bmp: '\u3040-\u309F' + }, { + name: 'InIPA_Extensions', + bmp: '\u0250-\u02AF' + }, { + name: 'InIdeographic_Description_Characters', + bmp: '\u2FF0-\u2FFF' + }, { + name: 'InIdeographic_Symbols_and_Punctuation', + astral: '\uD81B[\uDFE0-\uDFFF]' + }, { + name: 'InImperial_Aramaic', + astral: '\uD802[\uDC40-\uDC5F]' + }, { + name: 'InInscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF7F]' + }, { + name: 'InInscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF5F]' + }, { + name: 'InJavanese', + bmp: '\uA980-\uA9DF' + }, { + name: 'InKaithi', + astral: '\uD804[\uDC80-\uDCCF]' + }, { + name: 'InKana_Supplement', + astral: '\uD82C[\uDC00-\uDCFF]' + }, { + name: 'InKanbun', + bmp: '\u3190-\u319F' + }, { + name: 'InKangxi_Radicals', + bmp: '\u2F00-\u2FDF' + }, { + name: 'InKannada', + bmp: '\u0C80-\u0CFF' + }, { + name: 'InKatakana', + bmp: '\u30A0-\u30FF' + }, { + name: 'InKatakana_Phonetic_Extensions', + bmp: '\u31F0-\u31FF' + }, { + name: 'InKayah_Li', + bmp: '\uA900-\uA92F' + }, { + name: 'InKharoshthi', + astral: '\uD802[\uDE00-\uDE5F]' + }, { + name: 'InKhmer', + bmp: '\u1780-\u17FF' + }, { + name: 'InKhmer_Symbols', + bmp: '\u19E0-\u19FF' + }, { + name: 'InKhojki', + astral: '\uD804[\uDE00-\uDE4F]' + }, { + name: 'InKhudawadi', + astral: '\uD804[\uDEB0-\uDEFF]' + }, { + name: 'InLao', + bmp: '\u0E80-\u0EFF' + }, { + name: 'InLatin_Extended_Additional', + bmp: '\u1E00-\u1EFF' + }, { + name: 'InLatin_Extended_A', + bmp: '\u0100-\u017F' + }, { + name: 'InLatin_Extended_B', + bmp: '\u0180-\u024F' + }, { + name: 'InLatin_Extended_C', + bmp: '\u2C60-\u2C7F' + }, { + name: 'InLatin_Extended_D', + bmp: '\uA720-\uA7FF' + }, { + name: 'InLatin_Extended_E', + bmp: '\uAB30-\uAB6F' + }, { + name: 'InLatin_1_Supplement', + bmp: '\x80-\xFF' + }, { + name: 'InLepcha', + bmp: '\u1C00-\u1C4F' + }, { + name: 'InLetterlike_Symbols', + bmp: '\u2100-\u214F' + }, { + name: 'InLimbu', + bmp: '\u1900-\u194F' + }, { + name: 'InLinear_A', + astral: '\uD801[\uDE00-\uDF7F]' + }, { + name: 'InLinear_B_Ideograms', + astral: '\uD800[\uDC80-\uDCFF]' + }, { + name: 'InLinear_B_Syllabary', + astral: '\uD800[\uDC00-\uDC7F]' + }, { + name: 'InLisu', + bmp: '\uA4D0-\uA4FF' + }, { + name: 'InLow_Surrogates', + bmp: '\uDC00-\uDFFF' + }, { + name: 'InLycian', + astral: '\uD800[\uDE80-\uDE9F]' + }, { + name: 'InLydian', + astral: '\uD802[\uDD20-\uDD3F]' + }, { + name: 'InMahajani', + astral: '\uD804[\uDD50-\uDD7F]' + }, { + name: 'InMahjong_Tiles', + astral: '\uD83C[\uDC00-\uDC2F]' + }, { + name: 'InMalayalam', + bmp: '\u0D00-\u0D7F' + }, { + name: 'InMandaic', + bmp: '\u0840-\u085F' + }, { + name: 'InManichaean', + astral: '\uD802[\uDEC0-\uDEFF]' + }, { + name: 'InMarchen', + astral: '\uD807[\uDC70-\uDCBF]' + }, { + name: 'InMathematical_Alphanumeric_Symbols', + astral: '\uD835[\uDC00-\uDFFF]' + }, { + name: 'InMathematical_Operators', + bmp: '\u2200-\u22FF' + }, { + name: 'InMeetei_Mayek', + bmp: '\uABC0-\uABFF' + }, { + name: 'InMeetei_Mayek_Extensions', + bmp: '\uAAE0-\uAAFF' + }, { + name: 'InMende_Kikakui', + astral: '\uD83A[\uDC00-\uDCDF]' + }, { + name: 'InMeroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDFF]' + }, { + name: 'InMeroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, { + name: 'InMiao', + astral: '\uD81B[\uDF00-\uDF9F]' + }, { + name: 'InMiscellaneous_Mathematical_Symbols_A', + bmp: '\u27C0-\u27EF' + }, { + name: 'InMiscellaneous_Mathematical_Symbols_B', + bmp: '\u2980-\u29FF' + }, { + name: 'InMiscellaneous_Symbols', + bmp: '\u2600-\u26FF' + }, { + name: 'InMiscellaneous_Symbols_and_Arrows', + bmp: '\u2B00-\u2BFF' + }, { + name: 'InMiscellaneous_Symbols_and_Pictographs', + astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' + }, { + name: 'InMiscellaneous_Technical', + bmp: '\u2300-\u23FF' + }, { + name: 'InModi', + astral: '\uD805[\uDE00-\uDE5F]' + }, { + name: 'InModifier_Tone_Letters', + bmp: '\uA700-\uA71F' + }, { + name: 'InMongolian', + bmp: '\u1800-\u18AF' + }, { + name: 'InMongolian_Supplement', + astral: '\uD805[\uDE60-\uDE7F]' + }, { + name: 'InMro', + astral: '\uD81A[\uDE40-\uDE6F]' + }, { + name: 'InMultani', + astral: '\uD804[\uDE80-\uDEAF]' + }, { + name: 'InMusical_Symbols', + astral: '\uD834[\uDD00-\uDDFF]' + }, { + name: 'InMyanmar', + bmp: '\u1000-\u109F' + }, { + name: 'InMyanmar_Extended_A', + bmp: '\uAA60-\uAA7F' + }, { + name: 'InMyanmar_Extended_B', + bmp: '\uA9E0-\uA9FF' + }, { + name: 'InNKo', + bmp: '\u07C0-\u07FF' + }, { + name: 'InNabataean', + astral: '\uD802[\uDC80-\uDCAF]' + }, { + name: 'InNew_Tai_Lue', + bmp: '\u1980-\u19DF' + }, { + name: 'InNewa', + astral: '\uD805[\uDC00-\uDC7F]' + }, { + name: 'InNumber_Forms', + bmp: '\u2150-\u218F' + }, { + name: 'InOgham', + bmp: '\u1680-\u169F' + }, { + name: 'InOl_Chiki', + bmp: '\u1C50-\u1C7F' + }, { + name: 'InOld_Hungarian', + astral: '\uD803[\uDC80-\uDCFF]' + }, { + name: 'InOld_Italic', + astral: '\uD800[\uDF00-\uDF2F]' + }, { + name: 'InOld_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, { + name: 'InOld_Permic', + astral: '\uD800[\uDF50-\uDF7F]' + }, { + name: 'InOld_Persian', + astral: '\uD800[\uDFA0-\uDFDF]' + }, { + name: 'InOld_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, { + name: 'InOld_Turkic', + astral: '\uD803[\uDC00-\uDC4F]' + }, { + name: 'InOptical_Character_Recognition', + bmp: '\u2440-\u245F' + }, { + name: 'InOriya', + bmp: '\u0B00-\u0B7F' + }, { + name: 'InOrnamental_Dingbats', + astral: '\uD83D[\uDE50-\uDE7F]' + }, { + name: 'InOsage', + astral: '\uD801[\uDCB0-\uDCFF]' + }, { + name: 'InOsmanya', + astral: '\uD801[\uDC80-\uDCAF]' + }, { + name: 'InPahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF8F]' + }, { + name: 'InPalmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, { + name: 'InPau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEFF]' + }, { + name: 'InPhags_pa', + bmp: '\uA840-\uA87F' + }, { + name: 'InPhaistos_Disc', + astral: '\uD800[\uDDD0-\uDDFF]' + }, { + name: 'InPhoenician', + astral: '\uD802[\uDD00-\uDD1F]' + }, { + name: 'InPhonetic_Extensions', + bmp: '\u1D00-\u1D7F' + }, { + name: 'InPhonetic_Extensions_Supplement', + bmp: '\u1D80-\u1DBF' + }, { + name: 'InPlaying_Cards', + astral: '\uD83C[\uDCA0-\uDCFF]' + }, { + name: 'InPrivate_Use_Area', + bmp: '\uE000-\uF8FF' + }, { + name: 'InPsalter_Pahlavi', + astral: '\uD802[\uDF80-\uDFAF]' + }, { + name: 'InRejang', + bmp: '\uA930-\uA95F' + }, { + name: 'InRumi_Numeral_Symbols', + astral: '\uD803[\uDE60-\uDE7F]' + }, { + name: 'InRunic', + bmp: '\u16A0-\u16FF' + }, { + name: 'InSamaritan', + bmp: '\u0800-\u083F' + }, { + name: 'InSaurashtra', + bmp: '\uA880-\uA8DF' + }, { + name: 'InSharada', + astral: '\uD804[\uDD80-\uDDDF]' + }, { + name: 'InShavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, { + name: 'InShorthand_Format_Controls', + astral: '\uD82F[\uDCA0-\uDCAF]' + }, { + name: 'InSiddham', + astral: '\uD805[\uDD80-\uDDFF]' + }, { + name: 'InSinhala', + bmp: '\u0D80-\u0DFF' + }, { + name: 'InSinhala_Archaic_Numbers', + astral: '\uD804[\uDDE0-\uDDFF]' + }, { + name: 'InSmall_Form_Variants', + bmp: '\uFE50-\uFE6F' + }, { + name: 'InSora_Sompeng', + astral: '\uD804[\uDCD0-\uDCFF]' + }, { + name: 'InSpacing_Modifier_Letters', + bmp: '\u02B0-\u02FF' + }, { + name: 'InSpecials', + bmp: '\uFFF0-\uFFFF' + }, { + name: 'InSundanese', + bmp: '\u1B80-\u1BBF' + }, { + name: 'InSundanese_Supplement', + bmp: '\u1CC0-\u1CCF' + }, { + name: 'InSuperscripts_and_Subscripts', + bmp: '\u2070-\u209F' + }, { + name: 'InSupplemental_Arrows_A', + bmp: '\u27F0-\u27FF' + }, { + name: 'InSupplemental_Arrows_B', + bmp: '\u2900-\u297F' + }, { + name: 'InSupplemental_Arrows_C', + astral: '\uD83E[\uDC00-\uDCFF]' + }, { + name: 'InSupplemental_Mathematical_Operators', + bmp: '\u2A00-\u2AFF' + }, { + name: 'InSupplemental_Punctuation', + bmp: '\u2E00-\u2E7F' + }, { + name: 'InSupplemental_Symbols_and_Pictographs', + astral: '\uD83E[\uDD00-\uDDFF]' + }, { + name: 'InSupplementary_Private_Use_Area_A', + astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, { + name: 'InSupplementary_Private_Use_Area_B', + astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, { + name: 'InSutton_SignWriting', + astral: '\uD836[\uDC00-\uDEAF]' + }, { + name: 'InSyloti_Nagri', + bmp: '\uA800-\uA82F' + }, { + name: 'InSyriac', + bmp: '\u0700-\u074F' + }, { + name: 'InTagalog', + bmp: '\u1700-\u171F' + }, { + name: 'InTagbanwa', + bmp: '\u1760-\u177F' + }, { + name: 'InTags', + astral: '\uDB40[\uDC00-\uDC7F]' + }, { + name: 'InTai_Le', + bmp: '\u1950-\u197F' + }, { + name: 'InTai_Tham', + bmp: '\u1A20-\u1AAF' + }, { + name: 'InTai_Viet', + bmp: '\uAA80-\uAADF' + }, { + name: 'InTai_Xuan_Jing_Symbols', + astral: '\uD834[\uDF00-\uDF5F]' + }, { + name: 'InTakri', + astral: '\uD805[\uDE80-\uDECF]' + }, { + name: 'InTamil', + bmp: '\u0B80-\u0BFF' + }, { + name: 'InTangut', + astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' + }, { + name: 'InTangut_Components', + astral: '\uD822[\uDC00-\uDEFF]' + }, { + name: 'InTelugu', + bmp: '\u0C00-\u0C7F' + }, { + name: 'InThaana', + bmp: '\u0780-\u07BF' + }, { + name: 'InThai', + bmp: '\u0E00-\u0E7F' + }, { + name: 'InTibetan', + bmp: '\u0F00-\u0FFF' + }, { + name: 'InTifinagh', + bmp: '\u2D30-\u2D7F' + }, { + name: 'InTirhuta', + astral: '\uD805[\uDC80-\uDCDF]' + }, { + name: 'InTransport_and_Map_Symbols', + astral: '\uD83D[\uDE80-\uDEFF]' + }, { + name: 'InUgaritic', + astral: '\uD800[\uDF80-\uDF9F]' + }, { + name: 'InUnified_Canadian_Aboriginal_Syllabics', + bmp: '\u1400-\u167F' + }, { + name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + bmp: '\u18B0-\u18FF' + }, { + name: 'InVai', + bmp: '\uA500-\uA63F' + }, { + name: 'InVariation_Selectors', + bmp: '\uFE00-\uFE0F' + }, { + name: 'InVariation_Selectors_Supplement', + astral: '\uDB40[\uDD00-\uDDEF]' + }, { + name: 'InVedic_Extensions', + bmp: '\u1CD0-\u1CFF' + }, { + name: 'InVertical_Forms', + bmp: '\uFE10-\uFE1F' + }, { + name: 'InWarang_Citi', + astral: '\uD806[\uDCA0-\uDCFF]' + }, { + name: 'InYi_Radicals', + bmp: '\uA490-\uA4CF' + }, { + name: 'InYi_Syllables', + bmp: '\uA000-\uA48F' + }, { + name: 'InYijing_Hexagram_Symbols', + bmp: '\u4DC0-\u4DFF' + }]); +}; + +module.exports = exports['default']; +},{}],5:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Categories 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token + * names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData([{ + name: 'C', + alias: 'Other', + isBmpLast: true, + bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' + }, { + name: 'Cc', + alias: 'Control', + bmp: '\0-\x1F\x7F-\x9F' + }, { + name: 'Cf', + alias: 'Format', + bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, { + name: 'Cn', + alias: 'Unassigned', + bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, { + name: 'Co', + alias: 'Private_Use', + bmp: '\uE000-\uF8FF', + astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, { + name: 'Cs', + alias: 'Surrogate', + bmp: '\uD800-\uDFFF' + }, { + name: 'L', + alias: 'Letter', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Ll', + alias: 'Lowercase_Letter', + bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, { + name: 'Lm', + alias: 'Modifier_Letter', + bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' + }, { + name: 'Lo', + alias: 'Other_Letter', + bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Lt', + alias: 'Titlecase_Letter', + bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, { + name: 'Lu', + alias: 'Uppercase_Letter', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' + }, { + name: 'M', + alias: 'Mark', + bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'Mc', + alias: 'Spacing_Mark', + bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' + }, { + name: 'Me', + alias: 'Enclosing_Mark', + bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, { + name: 'Mn', + alias: 'Nonspacing_Mark', + bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'N', + alias: 'Number', + bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' + }, { + name: 'Nd', + alias: 'Decimal_Number', + bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' + }, { + name: 'Nl', + alias: 'Letter_Number', + bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' + }, { + name: 'No', + alias: 'Other_Number', + bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' + }, { + name: 'P', + alias: 'Punctuation', + bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, { + name: 'Pc', + alias: 'Connector_Punctuation', + bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, { + name: 'Pd', + alias: 'Dash_Punctuation', + bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, { + name: 'Pe', + alias: 'Close_Punctuation', + bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, { + name: 'Pf', + alias: 'Final_Punctuation', + bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, { + name: 'Pi', + alias: 'Initial_Punctuation', + bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, { + name: 'Po', + alias: 'Other_Punctuation', + bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' + }, { + name: 'Ps', + alias: 'Open_Punctuation', + bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, { + name: 'S', + alias: 'Symbol', + bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, { + name: 'Sc', + alias: 'Currency_Symbol', + bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' + }, { + name: 'Sk', + alias: 'Modifier_Symbol', + bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + astral: '\uD83C[\uDFFB-\uDFFF]' + }, { + name: 'Sm', + alias: 'Math_Symbol', + bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' + }, { + name: 'So', + alias: 'Other_Symbol', + bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' + }, { + name: 'Z', + alias: 'Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, { + name: 'Zl', + alias: 'Line_Separator', + bmp: '\u2028' + }, { + name: 'Zp', + alias: 'Paragraph_Separator', + bmp: '\u2029' + }, { + name: 'Zs', + alias: 'Space_Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + }]); +}; + +module.exports = exports['default']; +},{}],6:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Properties 4.0.0 + * + * Steven Levithan (c) 2012-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from + * UAX #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + + * Lo + Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should + * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, + * permitting programs to correctly handle the default rendering of such characters when not + * otherwise supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS + * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = [{ + name: 'ASCII', + bmp: '\0-\x7F' + }, { + name: 'Alphabetic', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Any', + isBmpLast: true, + bmp: '\0-\uFFFF', + astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, { + name: 'Default_Ignorable_Code_Point', + bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' + }, { + name: 'Lowercase', + bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' + }, { + name: 'Noncharacter_Code_Point', + bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', + astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' + }, { + name: 'Uppercase', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, { + name: 'White_Space', + bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }]; + + // Add non-generated data + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + + XRegExp.addUnicodeData(unicodeData); +}; + +module.exports = exports['default']; +},{}],7:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/*! + * XRegExp Unicode Scripts 4.0.0 + * + * Steven Levithan (c) 2010-2017 MIT License + * Unicode data by Mathias Bynens + */ + +exports.default = function (XRegExp) { + + /** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, + * and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 9.0.0. + * + * @requires XRegExp, Unicode Base + */ + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData([{ + name: 'Adlam', + astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' + }, { + name: 'Ahom', + astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, { + name: 'Anatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE46]' + }, { + name: 'Arabic', + bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, { + name: 'Armenian', + bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' + }, { + name: 'Avestan', + astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, { + name: 'Balinese', + bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' + }, { + name: 'Bamum', + bmp: '\uA6A0-\uA6F7', + astral: '\uD81A[\uDC00-\uDE38]' + }, { + name: 'Bassa_Vah', + astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, { + name: 'Batak', + bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, { + name: 'Bengali', + bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' + }, { + name: 'Bhaiksuki', + astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' + }, { + name: 'Bopomofo', + bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' + }, { + name: 'Brahmi', + astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, { + name: 'Braille', + bmp: '\u2800-\u28FF' + }, { + name: 'Buginese', + bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' + }, { + name: 'Buhid', + bmp: '\u1740-\u1753' + }, { + name: 'Canadian_Aboriginal', + bmp: '\u1400-\u167F\u18B0-\u18F5' + }, { + name: 'Carian', + astral: '\uD800[\uDEA0-\uDED0]' + }, { + name: 'Caucasian_Albanian', + astral: '\uD801[\uDD30-\uDD63\uDD6F]' + }, { + name: 'Chakma', + astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' + }, { + name: 'Cham', + bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, { + name: 'Cherokee', + bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, { + name: 'Common', + bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' + }, { + name: 'Coptic', + bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, { + name: 'Cuneiform', + astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' + }, { + name: 'Cypriot', + astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, { + name: 'Cyrillic', + bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, { + name: 'Deseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, { + name: 'Devanagari', + bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' + }, { + name: 'Duployan', + astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, { + name: 'Egyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, { + name: 'Elbasan', + astral: '\uD801[\uDD00-\uDD27]' + }, { + name: 'Ethiopic', + bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, { + name: 'Georgian', + bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' + }, { + name: 'Glagolitic', + bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', + astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' + }, { + name: 'Gothic', + astral: '\uD800[\uDF30-\uDF4A]' + }, { + name: 'Grantha', + astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, { + name: 'Greek', + bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' + }, { + name: 'Gujarati', + bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' + }, { + name: 'Gurmukhi', + bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' + }, { + name: 'Han', + bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', + astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' + }, { + name: 'Hangul', + bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, { + name: 'Hanunoo', + bmp: '\u1720-\u1734' + }, { + name: 'Hatran', + astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, { + name: 'Hebrew', + bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, { + name: 'Hiragana', + bmp: '\u3041-\u3096\u309D-\u309F', + astral: '\uD82C\uDC01|\uD83C\uDE00' + }, { + name: 'Imperial_Aramaic', + astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, { + name: 'Inherited', + bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' + }, { + name: 'Inscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, { + name: 'Inscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, { + name: 'Javanese', + bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, { + name: 'Kaithi', + astral: '\uD804[\uDC80-\uDCC1]' + }, { + name: 'Kannada', + bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, { + name: 'Katakana', + bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + astral: '\uD82C\uDC00' + }, { + name: 'Kayah_Li', + bmp: '\uA900-\uA92D\uA92F' + }, { + name: 'Kharoshthi', + astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' + }, { + name: 'Khmer', + bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, { + name: 'Khojki', + astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' + }, { + name: 'Khudawadi', + astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, { + name: 'Lao', + bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, { + name: 'Latin', + bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, { + name: 'Lepcha', + bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, { + name: 'Limbu', + bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, { + name: 'Linear_A', + astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, { + name: 'Linear_B', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, { + name: 'Lisu', + bmp: '\uA4D0-\uA4FF' + }, { + name: 'Lycian', + astral: '\uD800[\uDE80-\uDE9C]' + }, { + name: 'Lydian', + astral: '\uD802[\uDD20-\uDD39\uDD3F]' + }, { + name: 'Mahajani', + astral: '\uD804[\uDD50-\uDD76]' + }, { + name: 'Malayalam', + bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' + }, { + name: 'Mandaic', + bmp: '\u0840-\u085B\u085E' + }, { + name: 'Manichaean', + astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, { + name: 'Marchen', + astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' + }, { + name: 'Meetei_Mayek', + bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, { + name: 'Mende_Kikakui', + astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, { + name: 'Meroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, { + name: 'Meroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, { + name: 'Miao', + astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, { + name: 'Modi', + astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, { + name: 'Mongolian', + bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', + astral: '\uD805[\uDE60-\uDE6C]' + }, { + name: 'Mro', + astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, { + name: 'Multani', + astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, { + name: 'Myanmar', + bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, { + name: 'Nabataean', + astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, { + name: 'New_Tai_Lue', + bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, { + name: 'Newa', + astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' + }, { + name: 'Nko', + bmp: '\u07C0-\u07FA' + }, { + name: 'Ogham', + bmp: '\u1680-\u169C' + }, { + name: 'Ol_Chiki', + bmp: '\u1C50-\u1C7F' + }, { + name: 'Old_Hungarian', + astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, { + name: 'Old_Italic', + astral: '\uD800[\uDF00-\uDF23]' + }, { + name: 'Old_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, { + name: 'Old_Permic', + astral: '\uD800[\uDF50-\uDF7A]' + }, { + name: 'Old_Persian', + astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, { + name: 'Old_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, { + name: 'Old_Turkic', + astral: '\uD803[\uDC00-\uDC48]' + }, { + name: 'Oriya', + bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, { + name: 'Osage', + astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' + }, { + name: 'Osmanya', + astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, { + name: 'Pahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, { + name: 'Palmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, { + name: 'Pau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEF8]' + }, { + name: 'Phags_Pa', + bmp: '\uA840-\uA877' + }, { + name: 'Phoenician', + astral: '\uD802[\uDD00-\uDD1B\uDD1F]' + }, { + name: 'Psalter_Pahlavi', + astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, { + name: 'Rejang', + bmp: '\uA930-\uA953\uA95F' + }, { + name: 'Runic', + bmp: '\u16A0-\u16EA\u16EE-\u16F8' + }, { + name: 'Samaritan', + bmp: '\u0800-\u082D\u0830-\u083E' + }, { + name: 'Saurashtra', + bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' + }, { + name: 'Sharada', + astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, { + name: 'Shavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, { + name: 'Siddham', + astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, { + name: 'SignWriting', + astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, { + name: 'Sinhala', + bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + astral: '\uD804[\uDDE1-\uDDF4]' + }, { + name: 'Sora_Sompeng', + astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, { + name: 'Sundanese', + bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, { + name: 'Syloti_Nagri', + bmp: '\uA800-\uA82B' + }, { + name: 'Syriac', + bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' + }, { + name: 'Tagalog', + bmp: '\u1700-\u170C\u170E-\u1714' + }, { + name: 'Tagbanwa', + bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, { + name: 'Tai_Le', + bmp: '\u1950-\u196D\u1970-\u1974' + }, { + name: 'Tai_Tham', + bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, { + name: 'Tai_Viet', + bmp: '\uAA80-\uAAC2\uAADB-\uAADF' + }, { + name: 'Takri', + astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, { + name: 'Tamil', + bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, { + name: 'Tangut', + astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' + }, { + name: 'Telugu', + bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, { + name: 'Thaana', + bmp: '\u0780-\u07B1' + }, { + name: 'Thai', + bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' + }, { + name: 'Tibetan', + bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, { + name: 'Tifinagh', + bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, { + name: 'Tirhuta', + astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, { + name: 'Ugaritic', + astral: '\uD800[\uDF80-\uDF9D\uDF9F]' + }, { + name: 'Vai', + bmp: '\uA500-\uA62B' + }, { + name: 'Warang_Citi', + astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, { + name: 'Yi', + bmp: '\uA000-\uA48C\uA490-\uA4C6' + }]); +}; + +module.exports = exports['default']; +},{}],8:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _xregexp = require('./xregexp'); + +var _xregexp2 = _interopRequireDefault(_xregexp); + +var _build = require('./addons/build'); + +var _build2 = _interopRequireDefault(_build); + +var _matchrecursive = require('./addons/matchrecursive'); + +var _matchrecursive2 = _interopRequireDefault(_matchrecursive); + +var _unicodeBase = require('./addons/unicode-base'); + +var _unicodeBase2 = _interopRequireDefault(_unicodeBase); + +var _unicodeBlocks = require('./addons/unicode-blocks'); + +var _unicodeBlocks2 = _interopRequireDefault(_unicodeBlocks); + +var _unicodeCategories = require('./addons/unicode-categories'); + +var _unicodeCategories2 = _interopRequireDefault(_unicodeCategories); + +var _unicodeProperties = require('./addons/unicode-properties'); + +var _unicodeProperties2 = _interopRequireDefault(_unicodeProperties); + +var _unicodeScripts = require('./addons/unicode-scripts'); + +var _unicodeScripts2 = _interopRequireDefault(_unicodeScripts); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _build2.default)(_xregexp2.default); +(0, _matchrecursive2.default)(_xregexp2.default); +(0, _unicodeBase2.default)(_xregexp2.default); +(0, _unicodeBlocks2.default)(_xregexp2.default); +(0, _unicodeCategories2.default)(_xregexp2.default); +(0, _unicodeProperties2.default)(_xregexp2.default); +(0, _unicodeScripts2.default)(_xregexp2.default); + +exports.default = _xregexp2.default; +module.exports = exports['default']; +},{"./addons/build":1,"./addons/matchrecursive":2,"./addons/unicode-base":3,"./addons/unicode-blocks":4,"./addons/unicode-categories":5,"./addons/unicode-properties":6,"./addons/unicode-scripts":7,"./xregexp":9}],9:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/*! + * XRegExp 4.0.0 + * + * Steven Levithan (c) 2007-2017 MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ + +// ==--------------------------== +// Private stuff +// ==--------------------------== + +// Property name used for extended regex instance data +var REGEX_DATA = 'xregexp'; +// Optional features that can be installed and uninstalled +var features = { + astral: false +}; +// Native methods to use and restore ('native' is an ES3 reserved keyword) +var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split +}; +// Storage for fixed/extended native methods +var fixed = {}; +// Storage for regexes cached by `XRegExp.cache` +var regexCache = {}; +// Storage for pattern details cached by the `XRegExp` constructor +var patternCache = {}; +// Storage for regex syntax tokens added internally or by `XRegExp.addToken` +var tokens = []; +// Token scopes +var defaultScope = 'default'; +var classScope = 'class'; +// Regexes that match native regex syntax, including octals +var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ +}; +// Any backreference or dollar-prefixed character in replacement strings +var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; +// Check for correct `exec` handling of nonparticipating capturing groups +var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; +// Check for ES6 `flags` prop support +var hasFlagsProp = /x/.flags !== undefined; +// Shortcut to `Object.prototype.toString` +var toString = {}.toString; + +function hasNativeFlag(flag) { + // Can't check based on the presence of properties/getters since browsers might support such + // properties even when they don't support the corresponding flag in regex construction (tested + // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` + // throws an error) + var isSupported = true; + try { + // Can't use regex literals for testing even in a `try` because regex literals with + // unsupported flags cause a compilation error in IE + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + return isSupported; +} +// Check for ES6 `u` flag support +var hasNativeU = hasNativeFlag('u'); +// Check for ES6 `y` flag support +var hasNativeY = hasNativeFlag('y'); +// Tracker for known flags, including addon flags +var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY +}; + +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ +function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + var p = void 0; + + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } + + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this + // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` + // extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; + // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + + return regex; +} + +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ +function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); +} + +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + * - `addG` {Boolean} Add flag g while copying the regex. + * - `addY` {Boolean} Add flag y while copying the regex. + * - `removeG` {Boolean} Remove flag g while copying the regex. + * - `removeY` {Boolean} Remove flag y while copying the regex. + * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * - `source` {String} Overrides `.source`, for special cases. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ +function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}; + var flags = getNativeFlags(regex); + var flagsToAdd = ''; + var flagsToRemove = ''; + var xregexpSource = null; + var xregexpFlags = null; + + options = options || {}; + + if (options.removeG) { + flagsToRemove += 'g'; + } + if (options.removeY) { + flagsToRemove += 'y'; + } + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); + } + + if (options.addG) { + flagsToAdd += 'g'; + } + if (options.addY) { + flagsToAdd += 'y'; + } + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } + // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never + // removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } + + // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid + // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and + // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the + // translation to native regex syntax + regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); + + return regex; +} + +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ +function dec(hex) { + return parseInt(hex, 16); +} + +/** + * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an + * inline comment or whitespace with flag x. This is used directly as a token handler function + * passed to `XRegExp.addToken`. + * + * @private + * @param {String} match Match arg of `XRegExp.addToken` handler + * @param {String} scope Scope arg of `XRegExp.addToken` handler + * @param {String} flags Flags arg of `XRegExp.addToken` handler + * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. + */ +function getContextualTokenSeparator(match, scope, flags) { + if ( + // No need to separate tokens if at the beginning or end of a group + match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || + // Avoid separating tokens when the following token is a quantifier + isQuantifierNext(match.input, match.index + match[0].length, flags)) { + return ''; + } + // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. + // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax + // error `(? :` into `(?:`. + return '(?:)'; +} + +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ +function getNativeFlags(regex) { + return hasFlagsProp ? regex.flags : + // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation + // with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overridden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; +} + +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ +function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); +} + +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ +function hex(dec) { + return parseInt(dec, 10).toString(16); +} + +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next nonignorable token is a quantifier. + */ +function isQuantifierNext(pattern, pos, flags) { + var inlineCommentPattern = '\\(\\?#[^)]*\\)'; + var lineCommentPattern = '#[^#\\n]*'; + var quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; + return nativ.test.call(flags.indexOf('x') !== -1 ? + // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : + // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); +} + +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ +function isType(value, type) { + return toString.call(value) === '[object ' + type + ']'; +} + +/** + * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ +function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; +} + +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ +function prepareFlags(pattern, flags) { + var i = void 0; + + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError('Invalid duplicate regex flag ' + flags); + } + + // Strip and apply a leading mode modifier with any combination of flags except g or y + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); + } + // Allow duplicate flags within the mode modifier + flags = clipDuplicates(flags + $1); + return ''; + }); + + // Throw on unknown native or nonnative flags + for (i = 0; i < flags.length; ++i) { + if (!registeredFlags[flags[i]]) { + throw new SyntaxError('Unknown regex flag ' + flags[i]); + } + } + + return { + pattern: pattern, + flags: flags + }; +} + +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ +function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function (match) { + options[match] = true; + }); + + return options; + } + + return value; +} + +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ +function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; +} + +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ +function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length; + var leadChar = pattern[pos]; + var result = null; + var match = void 0; + var t = void 0; + + // Run in reverse insertion order + while (i--) { + t = tokens[i]; + if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; + // Finished with token tests + break; + } + } + + return result; +} + +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ +function setAstral(on) { + features.astral = on; +} + +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ +function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; +} + +// ==--------------------------== +// Constructor +// ==--------------------------== + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + * - `g` - global + * - `i` - ignore case + * - `m` - multiline anchors + * - `u` - unicode (ES6) + * - `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + * - `n` - explicit capture + * - `s` - dot matches all (aka singleline) + * - `x` - free-spacing and line comments (aka extended) + * - `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp(`(? [0-9]{4} ) -? # year + * (? [0-9]{2} ) -? # month + * (? [0-9]{2} ) # day`, 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ +function XRegExp(pattern, flags) { + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + return copyRegex(pattern); + } + + // Copy the argument behavior of `RegExp` + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + var context = { + hasNamedCapture: false, + captureNames: [] + }; + var scope = defaultScope; + var output = ''; + var pos = 0; + var result = void 0; + + // Check for flag-related errors, and strip/apply flags in a leading mode modifier + var applied = prepareFlags(pattern, flags); + var appliedPattern = applied.pattern; + var appliedFlags = applied.flags; + + // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); + // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += result.matchLength || 1; + } else { + // Get the native token at the current position + var token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; + output += token; + pos += token.length; + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty + // groups are sometimes inserted during regex transpilation in order to keep tokens + // separated. However, more than one empty group in a row is never needed. + pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + var generated = patternCache[pattern][flags]; + return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); +} + +// Add `RegExp.prototype` to the prototype chain +XRegExp.prototype = /(?:)/; + +// ==--------------------------== +// Public properties +// ==--------------------------== + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ +XRegExp.version = '4.0.0'; + +// ==--------------------------== +// Public methods +// ==--------------------------== + +// Intentionally undocumented; used in tests and addons +XRegExp._clipDuplicates = clipDuplicates; +XRegExp._hasNativeFlag = hasNativeFlag; +XRegExp._dec = dec; +XRegExp._hex = hex; +XRegExp._pad4 = pad4; + +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + * - The match array, with named backreference properties. + * - The regex scope where the match was found: 'default' or 'class'. + * - The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + * - `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + * - `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * () => '\\x07', + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * (match) => `${match[1]}${match[2] ? '' : '?'}`, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ +XRegExp.addToken = function (regex, handler, options) { + options = options || {}; + var optionalFlags = options.optionalFlags; + var i = void 0; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + for (i = 0; i < optionalFlags.length; ++i) { + registerFlag(optionalFlags[i]); + } + } + + // Add to the private list of syntax tokens + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags + // might now produce different results + XRegExp.cache.flush('patterns'); +}; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ +XRegExp.cache = function (pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); +}; + +// Intentionally undocumented; used in tests +XRegExp.cache.flush = function (cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } +}; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ +XRegExp.escape = function (str) { + return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * let pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ +XRegExp.exec = function (str, regex, pos, sticky) { + var cacheKey = 'g'; + var addY = false; + var fakeY = false; + var match = void 0; + + addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); + if (addY) { + cacheKey += 'y'; + } else if (sticky) { + // Simulate sticky matching by appending an empty capture to the original regex. The + // resulting regex will succeed no matter what at the current index (set with `lastIndex`), + // and will not search the rest of the subject string. We'll know that the original regex + // has failed if that last capture is `''` rather than `undefined` (i.e., if that last + // capture participated in the match). + fakeY = true; + cacheKey += 'FakeY'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.match`/`replace` + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + source: fakeY ? regex.source + '|()' : undefined, + removeY: sticky === false, + isInternalOnly: true + })); + + pos = pos || 0; + r2.lastIndex = pos; + + // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + match = fixed.exec.call(r2, str); + + // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means + // the original regexp failed (see above). + if (fakeY && match && match.pop() === '') { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; +}; + +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + * - The match array, with named backreference properties. + * - The zero-based match index. + * - The string being traversed. + * - The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * const evens = []; + * XRegExp.forEach('1a2345', /\d/, (match, i) => { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ +XRegExp.forEach = function (str, regex, callback) { + var pos = 0; + var i = -1; + var match = void 0; + + while (match = XRegExp.exec(str, regex, pos)) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` + // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, + // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of + // regexes, mutating the regex will not have any effect on the iteration or matched strings, + // which is a nice side effect that brings extra safety. + callback(match, ++i, str, regex); + + pos = match.index + (match[0].length || 1); + } +}; + +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * const globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ +XRegExp.globalize = function (regex) { + return copyRegex(regex, { addG: true }); +}; + +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true + * }); + * + * // With an options string + * XRegExp.install('astral'); + */ +XRegExp.install = function (options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } +}; + +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + * - `astral` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ +XRegExp.isInstalled = function (feature) { + return !!features[feature]; +}; + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ +XRegExp.isRegExp = function (value) { + return toString.call(value) === '[object RegExp]'; +}; // isType(value, 'RegExp'); + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ +XRegExp.match = function (str, regex, scope) { + var global = regex.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`replace` + var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + + var result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = scope === 'one' && result ? + // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + result.index + result[0].length : 0; + } + + return global ? result || [] : result && result[0]; +}; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = '
XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ +XRegExp.matchChain = function (str, chain) { + return function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : { regex: chain[level] }; + var matches = []; + + function addMatch(match) { + if (item.backref) { + // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the + // `undefined`s for backreferences to nonparticipating capturing groups. In such + // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw + // the exception, so also check if the backreference is a number that is within the + // bounds of the array. + if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { + throw new ReferenceError('Backreference to undefined group: ' + item.backref); + } + + matches.push(match[item.backref] || ''); + } else { + matches.push(match[0]); + } + } + + for (var i = 0; i < values.length; ++i) { + XRegExp.forEach(values[i], item.regex, addMatch); + } + + return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); + }([str], 0); +}; + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + * - $$ - Inserts a literal $ character. + * - $&, $0 - Inserts the matched substring. + * - $` - Inserts the string that precedes the matched substring (left context). + * - $' - Inserts the string that follows the matched substring (right context). + * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + * - The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + * - The zero-based index of the match within the total search string. + * - The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * const name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '$, $'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ +XRegExp.replace = function (str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search); + var global = search.global && scope !== 'one' || scope === 'all'; + var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; + var s2 = search; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + })); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } + + // Fixed `replace` required for named backreferences, etc. + var result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; +}; + +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}` or + * `$`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, ($0) => $0.toUpperCase()] + * ]); + */ +XRegExp.replaceEach = function (str, replacements) { + var i = void 0; + var r = void 0; + + for (i = 0; i < replacements.length; ++i) { + r = replacements[i]; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + + return str; +}; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ +XRegExp.split = function (str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); +}; + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ +// Do this the easy way :-) +XRegExp.test = function (str, regex, pos, sticky) { + return !!XRegExp.exec(str, regex, pos, sticky); +}; + +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral'); + */ +XRegExp.uninstall = function (options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } +}; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @param {Object} [options] Options object with optional properties: + * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); + * // -> /manbearpig/i + */ +XRegExp.union = function (patterns, flags, options) { + options = options || {}; + var conjunction = options.conjunction || 'or'; + var numCaptures = 0; + var numPriorCaptures = void 0; + var captureNames = void 0; + + function rewrite(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; + + // Capturing group + if (paren) { + ++numCaptures; + // If the current capture has a name, preserve the name + if (name) { + return '(?<' + name + '>'; + } + // Backreference + } else if (backref) { + // Rewrite the backreference + return '\\' + (+backref + numPriorCaptures); + } + + return match; + } + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; + var output = []; + var pattern = void 0; + for (var i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; + + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are + // independently valid; helps keep this simple. Named captures are put back + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + + var separator = conjunction === 'none' ? '' : '|'; + return XRegExp(output.join(separator), flags); +}; + +// ==--------------------------== +// Fixed/extended native methods +// ==--------------------------== + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ +fixed.exec = function (str) { + var origLastIndex = this.lastIndex; + var match = nativ.exec.apply(this, arguments); + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing + // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 + // in standards mode follows the spec. + if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { + var r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var len = args.length; + // Skip index 0 and the last 2 + for (var i = 1; i < len - 2; ++i) { + if (args[i] === undefined) { + match[i] = undefined; + } + } + }); + } + + // Attach named capture properties + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (var i = 1; i < match.length; ++i) { + var name = this[REGEX_DATA].captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && this.lastIndex > match.index) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; +}; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. + * + * @memberOf RegExp + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ +fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); +}; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. + * + * @memberOf String + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ +fixed.match = function (regex) { + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); + // Fixes IE bug + regex.lastIndex = 0; + + return result; + } + + return fixed.exec.call(regex, toObject(this)); +}; + +/** + * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement + * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also + * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex + * search value, and the value of a replacement regex's `lastIndex` property during replacement + * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third + * (`flags`) argument. Use via `XRegExp.replace`. + * + * @memberOf String + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ +fixed.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search); + var origLastIndex = void 0; + var captureNames = void 0; + var result = void 0; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } + // Only needed if `search` is nonglobal + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } + + // Don't use `typeof`; some older browsers return 'function' for regex objects + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (captureNames) { + // Change the `args[0]` string primitive to a `String` object that can store + // properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (var i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari + // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + // ES6 specs the context for replacement functions as `undefined` + return replacement.apply(undefined, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return nativ.replace.call(String(replacement), replacementToken, replacer); + + function replacer($0, bracketed, angled, dollarToken) { + bracketed = bracketed || angled; + // Named or numbered backreference with curly or angled braces + if (bracketed) { + // XRegExp behavior for `${n}` or `$`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the + // entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an integer + // overridden by numbered capture. In practice, this does not overlap with + // numbered capture since XRegExp does not allow named capture to use a bare + // integer as the name. + // 3. If the name or number does not refer to an existing capturing group, it's + // an error. + var n = +bracketed; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ''; + } + // Groups with the same name is an error, else would need `lastIndexOf` + n = captureNames ? captureNames.indexOf(bracketed) : -1; + if (n < 0) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[n + 1] || ''; + } + // Else, special variable or numbered backreference without curly braces + if (dollarToken === '$') { + // $$ + return '$'; + } + if (dollarToken === '&' || +dollarToken === 0) { + // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + if (dollarToken === '`') { + // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + if (dollarToken === "'") { + // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } + // Else, numbered backreference without braces + dollarToken = +dollarToken; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` + // instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + if (!isNaN(dollarToken)) { + if (dollarToken > args.length - 3) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[dollarToken] || ''; + } + // `$` followed by an unsupported char is an error, unlike native JS + throw new SyntaxError('Invalid token ' + $0); + } + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; +}; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. + * + * @memberOf String + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ +fixed.split = function (separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this); + var output = []; + var origLastIndex = separator.lastIndex; + var lastLastIndex = 0; + var lastLength = void 0; + + // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless + // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + limit = (limit === undefined ? -1 : limit) >>> 0; + + XRegExp.forEach(str, separator, function (match) { + // This condition is not the same as `if (match[0].length)` + if (match.index + match[0].length > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; +}; + +// ==--------------------------== +// Built-in syntax/flag tokens +// ==--------------------------== + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ +XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError('Invalid escape ' + match[0]); +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ +XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { + var code = dec(match[1]); + if (code > 0x10FFFF) { + throw new SyntaxError('Invalid Unicode code point ' + match[0]); + } + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return '\\u' + pad4(hex(code)); + } + // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + if (hasNativeU && flags.indexOf('u') !== -1) { + return match[0]; + } + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ +XRegExp.addToken(/\[(\^?)\]/, +// For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. +// (?!) should work like \b\B, but is unreliable in some versions of Firefox +/* eslint-disable no-confusing-arrow */ +function (match) { + return match[1] ? '[\\s\\S]' : '\\b\\B'; +}, +/* eslint-enable no-confusing-arrow */ +{ leadChar: '[' }); + +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ +XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { leadChar: '(' }); + +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ +XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { flag: 'x' }); + +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ +XRegExp.addToken(/\./, function () { + return '[\\s\\S]'; +}, { + flag: 's', + leadChar: '.' +}); + +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ +XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; + var endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError('Backreference to undefined group ' + match[0]); + } + // Keep backreferences separate from subsequent literal numbers. This avoids e.g. + // inadvertedly changing `(?)\k1` to `()\11`. + return '\\' + index + (endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); +}, { leadChar: '\\' }); + +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ +XRegExp.addToken(/\\(\d+)/, function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { + throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + match[0]); + } + return match[0]; +}, { + scope: 'all', + leadChar: '\\' +}); + +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ +XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { + // Disallow bare integers as names because named backreferences are added to match arrays + // and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError('Cannot use integer as capture name ' + match[0]); + } + if (match[1] === 'length' || match[1] === '__proto__') { + throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); + } + if (this.captureNames.indexOf(match[1]) !== -1) { + throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; +}, { leadChar: '(' }); + +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ +XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { + if (flags.indexOf('n') !== -1) { + return '(?:'; + } + this.captureNames.push(null); + return '('; +}, { + optionalFlags: 'n', + leadChar: '(' +}); + +exports.default = XRegExp; +module.exports = exports['default']; +},{}]},{},[8])(8) +}); \ No newline at end of file diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 00000000..34c7436c --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,15 @@ +{ + "name": "scripts", + "version": "1.0.0", + "description": "Maintaining clean the All ▲lgorithms Project", + "main": "formatter.js", + "scripts": { + "validate": "node validate.js", + "format": "node formatter.js" + }, + "license": "MIT", + "private": true, + "dependencies": { + "glob": "^7.1.3" + } +} \ No newline at end of file diff --git a/scripts/validate.js b/scripts/validate.js new file mode 100644 index 00000000..6e527ca4 --- /dev/null +++ b/scripts/validate.js @@ -0,0 +1,34 @@ +/** + * The All Algorithms C++ Validate.js + * + * Author: Carlos Abraham Hernandez + * https://abranhe.com (abraham@abranhe.com) + */ +'use strict'; + +const glob = require('glob'); +const path = require('path'); +const decamelize = require('decamelize'); +const shell = require('child_process').execSync; + +const getFiles = (src, callback) => { + glob(src + '/**', callback); +}; + +getFiles('../', (err, res) => { + if (err) { + console.log('Error', err); + } else { + res.map((file) => { + // Accept only valid C++ Files (.cpp,.hpp,.h) + if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { + return; + } + + if(file !== decamelize(file)){ + console.log('Don\'t follow the All ▲lgorithms structure. :/'); + process.exit(); + } + }); + } +}); \ No newline at end of file diff --git a/scripts/yarn.lock b/scripts/yarn.lock new file mode 100644 index 00000000..725f35de --- /dev/null +++ b/scripts/yarn.lock @@ -0,0 +1,87 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" + integrity sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg== + dependencies: + xregexp "4.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xregexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== From c0ad89cd12fb3ec6ae0614f47c86ec9b81a62b44 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Wed, 20 Feb 2019 02:44:39 -0500 Subject: [PATCH 117/285] validator fix --- .gitignore | 6 + scripts/node_modules/.yarn-integrity | 29 - .../node_modules/balanced-match/.npmignore | 5 - .../node_modules/balanced-match/LICENSE.md | 21 - scripts/node_modules/balanced-match/README.md | 91 - scripts/node_modules/balanced-match/index.js | 59 - .../node_modules/balanced-match/package.json | 49 - scripts/node_modules/brace-expansion/LICENSE | 21 - .../node_modules/brace-expansion/README.md | 129 - scripts/node_modules/brace-expansion/index.js | 201 - .../node_modules/brace-expansion/package.json | 47 - scripts/node_modules/concat-map/.travis.yml | 4 - scripts/node_modules/concat-map/LICENSE | 18 - .../node_modules/concat-map/README.markdown | 62 - .../node_modules/concat-map/example/map.js | 6 - scripts/node_modules/concat-map/index.js | 13 - scripts/node_modules/concat-map/package.json | 43 - scripts/node_modules/concat-map/test/map.js | 39 - scripts/node_modules/decamelize/index.js | 21 - scripts/node_modules/decamelize/license | 9 - scripts/node_modules/decamelize/package.json | 41 - scripts/node_modules/decamelize/readme.md | 48 - scripts/node_modules/fs.realpath/LICENSE | 43 - scripts/node_modules/fs.realpath/README.md | 33 - scripts/node_modules/fs.realpath/index.js | 66 - scripts/node_modules/fs.realpath/old.js | 303 -- scripts/node_modules/fs.realpath/package.json | 26 - scripts/node_modules/glob/LICENSE | 15 - scripts/node_modules/glob/README.md | 368 -- scripts/node_modules/glob/changelog.md | 67 - scripts/node_modules/glob/common.js | 240 - scripts/node_modules/glob/glob.js | 790 ---- scripts/node_modules/glob/package.json | 43 - scripts/node_modules/glob/sync.js | 486 -- scripts/node_modules/inflight/LICENSE | 15 - scripts/node_modules/inflight/README.md | 37 - scripts/node_modules/inflight/inflight.js | 54 - scripts/node_modules/inflight/package.json | 29 - scripts/node_modules/inherits/LICENSE | 16 - scripts/node_modules/inherits/README.md | 42 - scripts/node_modules/inherits/inherits.js | 7 - .../node_modules/inherits/inherits_browser.js | 23 - scripts/node_modules/inherits/package.json | 29 - scripts/node_modules/minimatch/LICENSE | 15 - scripts/node_modules/minimatch/README.md | 209 - scripts/node_modules/minimatch/minimatch.js | 923 ---- scripts/node_modules/minimatch/package.json | 30 - scripts/node_modules/once/LICENSE | 15 - scripts/node_modules/once/README.md | 79 - scripts/node_modules/once/once.js | 42 - scripts/node_modules/once/package.json | 33 - .../node_modules/path-is-absolute/index.js | 20 - scripts/node_modules/path-is-absolute/license | 21 - .../path-is-absolute/package.json | 43 - .../node_modules/path-is-absolute/readme.md | 59 - scripts/node_modules/wrappy/LICENSE | 15 - scripts/node_modules/wrappy/README.md | 36 - scripts/node_modules/wrappy/package.json | 29 - scripts/node_modules/wrappy/wrappy.js | 33 - scripts/node_modules/xregexp/LICENSE | 21 - scripts/node_modules/xregexp/README.md | 237 - .../node_modules/xregexp/lib/addons/build.js | 241 - .../xregexp/lib/addons/matchrecursive.js | 202 - .../xregexp/lib/addons/unicode-base.js | 247 - .../xregexp/lib/addons/unicode-blocks.js | 852 ---- .../xregexp/lib/addons/unicode-categories.js | 204 - .../xregexp/lib/addons/unicode-properties.js | 103 - .../xregexp/lib/addons/unicode-scripts.js | 454 -- scripts/node_modules/xregexp/lib/index.js | 50 - scripts/node_modules/xregexp/lib/xregexp.js | 1792 ------- scripts/node_modules/xregexp/package.json | 47 - .../node_modules/xregexp/src/addons/build.js | 234 - .../xregexp/src/addons/matchrecursive.js | 197 - .../xregexp/src/addons/unicode-base.js | 258 - .../xregexp/src/addons/unicode-blocks.js | 1118 ----- .../xregexp/src/addons/unicode-categories.js | 234 - .../xregexp/src/addons/unicode-properties.js | 104 - .../xregexp/src/addons/unicode-scripts.js | 584 --- scripts/node_modules/xregexp/src/index.js | 19 - scripts/node_modules/xregexp/src/xregexp.js | 1827 -------- scripts/node_modules/xregexp/xregexp-all.js | 4156 ----------------- scripts/yarn.lock | 87 - 82 files changed, 6 insertions(+), 18558 deletions(-) create mode 100644 .gitignore delete mode 100644 scripts/node_modules/.yarn-integrity delete mode 100644 scripts/node_modules/balanced-match/.npmignore delete mode 100644 scripts/node_modules/balanced-match/LICENSE.md delete mode 100644 scripts/node_modules/balanced-match/README.md delete mode 100644 scripts/node_modules/balanced-match/index.js delete mode 100644 scripts/node_modules/balanced-match/package.json delete mode 100644 scripts/node_modules/brace-expansion/LICENSE delete mode 100644 scripts/node_modules/brace-expansion/README.md delete mode 100644 scripts/node_modules/brace-expansion/index.js delete mode 100644 scripts/node_modules/brace-expansion/package.json delete mode 100644 scripts/node_modules/concat-map/.travis.yml delete mode 100644 scripts/node_modules/concat-map/LICENSE delete mode 100644 scripts/node_modules/concat-map/README.markdown delete mode 100644 scripts/node_modules/concat-map/example/map.js delete mode 100644 scripts/node_modules/concat-map/index.js delete mode 100644 scripts/node_modules/concat-map/package.json delete mode 100644 scripts/node_modules/concat-map/test/map.js delete mode 100644 scripts/node_modules/decamelize/index.js delete mode 100644 scripts/node_modules/decamelize/license delete mode 100644 scripts/node_modules/decamelize/package.json delete mode 100644 scripts/node_modules/decamelize/readme.md delete mode 100644 scripts/node_modules/fs.realpath/LICENSE delete mode 100644 scripts/node_modules/fs.realpath/README.md delete mode 100644 scripts/node_modules/fs.realpath/index.js delete mode 100644 scripts/node_modules/fs.realpath/old.js delete mode 100644 scripts/node_modules/fs.realpath/package.json delete mode 100644 scripts/node_modules/glob/LICENSE delete mode 100644 scripts/node_modules/glob/README.md delete mode 100644 scripts/node_modules/glob/changelog.md delete mode 100644 scripts/node_modules/glob/common.js delete mode 100644 scripts/node_modules/glob/glob.js delete mode 100644 scripts/node_modules/glob/package.json delete mode 100644 scripts/node_modules/glob/sync.js delete mode 100644 scripts/node_modules/inflight/LICENSE delete mode 100644 scripts/node_modules/inflight/README.md delete mode 100644 scripts/node_modules/inflight/inflight.js delete mode 100644 scripts/node_modules/inflight/package.json delete mode 100644 scripts/node_modules/inherits/LICENSE delete mode 100644 scripts/node_modules/inherits/README.md delete mode 100644 scripts/node_modules/inherits/inherits.js delete mode 100644 scripts/node_modules/inherits/inherits_browser.js delete mode 100644 scripts/node_modules/inherits/package.json delete mode 100644 scripts/node_modules/minimatch/LICENSE delete mode 100644 scripts/node_modules/minimatch/README.md delete mode 100644 scripts/node_modules/minimatch/minimatch.js delete mode 100644 scripts/node_modules/minimatch/package.json delete mode 100644 scripts/node_modules/once/LICENSE delete mode 100644 scripts/node_modules/once/README.md delete mode 100644 scripts/node_modules/once/once.js delete mode 100644 scripts/node_modules/once/package.json delete mode 100644 scripts/node_modules/path-is-absolute/index.js delete mode 100644 scripts/node_modules/path-is-absolute/license delete mode 100644 scripts/node_modules/path-is-absolute/package.json delete mode 100644 scripts/node_modules/path-is-absolute/readme.md delete mode 100644 scripts/node_modules/wrappy/LICENSE delete mode 100644 scripts/node_modules/wrappy/README.md delete mode 100644 scripts/node_modules/wrappy/package.json delete mode 100644 scripts/node_modules/wrappy/wrappy.js delete mode 100644 scripts/node_modules/xregexp/LICENSE delete mode 100644 scripts/node_modules/xregexp/README.md delete mode 100644 scripts/node_modules/xregexp/lib/addons/build.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/matchrecursive.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-base.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-blocks.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-categories.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-properties.js delete mode 100644 scripts/node_modules/xregexp/lib/addons/unicode-scripts.js delete mode 100644 scripts/node_modules/xregexp/lib/index.js delete mode 100644 scripts/node_modules/xregexp/lib/xregexp.js delete mode 100644 scripts/node_modules/xregexp/package.json delete mode 100644 scripts/node_modules/xregexp/src/addons/build.js delete mode 100644 scripts/node_modules/xregexp/src/addons/matchrecursive.js delete mode 100644 scripts/node_modules/xregexp/src/addons/unicode-base.js delete mode 100644 scripts/node_modules/xregexp/src/addons/unicode-blocks.js delete mode 100644 scripts/node_modules/xregexp/src/addons/unicode-categories.js delete mode 100644 scripts/node_modules/xregexp/src/addons/unicode-properties.js delete mode 100644 scripts/node_modules/xregexp/src/addons/unicode-scripts.js delete mode 100644 scripts/node_modules/xregexp/src/index.js delete mode 100644 scripts/node_modules/xregexp/src/xregexp.js delete mode 100644 scripts/node_modules/xregexp/xregexp-all.js delete mode 100644 scripts/yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fc31440f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +DS_Store +*.o + +/scripts/node_modules +/scripts/yarn.lock +/scripts/package-lock.json \ No newline at end of file diff --git a/scripts/node_modules/.yarn-integrity b/scripts/node_modules/.yarn-integrity deleted file mode 100644 index 785c8e63..00000000 --- a/scripts/node_modules/.yarn-integrity +++ /dev/null @@ -1,29 +0,0 @@ -{ - "systemParams": "darwin-x64-67", - "modulesFolders": [ - "node_modules" - ], - "flags": [], - "linkedModules": [], - "topLevelPatterns": [ - "decamelize@^2.0.0", - "glob@^7.1.3" - ], - "lockfileEntries": { - "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767", - "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "decamelize@^2.0.0": "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7", - "fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f", - "glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1", - "inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9", - "inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de", - "minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083", - "once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", - "path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", - "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "xregexp@4.0.0": "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" - }, - "files": [], - "artifacts": {} -} \ No newline at end of file diff --git a/scripts/node_modules/balanced-match/.npmignore b/scripts/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c36..00000000 --- a/scripts/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/scripts/node_modules/balanced-match/LICENSE.md b/scripts/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e41..00000000 --- a/scripts/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/scripts/node_modules/balanced-match/README.md b/scripts/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c0..00000000 --- a/scripts/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/scripts/node_modules/balanced-match/index.js b/scripts/node_modules/balanced-match/index.js deleted file mode 100644 index 1685a762..00000000 --- a/scripts/node_modules/balanced-match/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/scripts/node_modules/balanced-match/package.json b/scripts/node_modules/balanced-match/package.json deleted file mode 100644 index 61349c6e..00000000 --- a/scripts/node_modules/balanced-match/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test", - "bench": "make bench" - }, - "dependencies": {}, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/scripts/node_modules/brace-expansion/LICENSE b/scripts/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de322667..00000000 --- a/scripts/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/scripts/node_modules/brace-expansion/README.md b/scripts/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e16..00000000 --- a/scripts/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/scripts/node_modules/brace-expansion/index.js b/scripts/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be81..00000000 --- a/scripts/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/scripts/node_modules/brace-expansion/package.json b/scripts/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8f..00000000 --- a/scripts/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/scripts/node_modules/concat-map/.travis.yml b/scripts/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c..00000000 --- a/scripts/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/scripts/node_modules/concat-map/LICENSE b/scripts/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4b..00000000 --- a/scripts/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/concat-map/README.markdown b/scripts/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1..00000000 --- a/scripts/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/scripts/node_modules/concat-map/example/map.js b/scripts/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217..00000000 --- a/scripts/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/scripts/node_modules/concat-map/index.js b/scripts/node_modules/concat-map/index.js deleted file mode 100644 index b29a7812..00000000 --- a/scripts/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/scripts/node_modules/concat-map/package.json b/scripts/node_modules/concat-map/package.json deleted file mode 100644 index d3640e6b..00000000 --- a/scripts/node_modules/concat-map/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name" : "concat-map", - "description" : "concatenative mapdashery", - "version" : "0.0.1", - "repository" : { - "type" : "git", - "url" : "git://github.com/substack/node-concat-map.git" - }, - "main" : "index.js", - "keywords" : [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "directories" : { - "example" : "example", - "test" : "test" - }, - "scripts" : { - "test" : "tape test/*.js" - }, - "devDependencies" : { - "tape" : "~2.4.0" - }, - "license" : "MIT", - "author" : { - "name" : "James Halliday", - "email" : "mail@substack.net", - "url" : "http://substack.net" - }, - "testling" : { - "files" : "test/*.js", - "browsers" : { - "ie" : [ 6, 7, 8, 9 ], - "ff" : [ 3.5, 10, 15.0 ], - "chrome" : [ 10, 22 ], - "safari" : [ 5.1 ], - "opera" : [ 12 ] - } - } -} diff --git a/scripts/node_modules/concat-map/test/map.js b/scripts/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022..00000000 --- a/scripts/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/scripts/node_modules/decamelize/index.js b/scripts/node_modules/decamelize/index.js deleted file mode 100644 index 1b8327b8..00000000 --- a/scripts/node_modules/decamelize/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -const xRegExp = require('xregexp'); - -module.exports = (text, separator) => { - if (typeof text !== 'string') { - throw new TypeError('Expected a string'); - } - - separator = typeof separator === 'undefined' ? '_' : separator; - - const regex1 = xRegExp('([\\p{Ll}\\d])(\\p{Lu})', 'g'); - const regex2 = xRegExp('(\\p{Lu}+)(\\p{Lu}[\\p{Ll}\\d]+)', 'g'); - - return text - // TODO: Use this instead of `xregexp` when targeting Node.js 10: - // .replace(/([\p{Lowercase_Letter}\d])(\p{Uppercase_Letter})/gu, `$1${separator}$2`) - // .replace(/(\p{Lowercase_Letter}+)(\p{Uppercase_Letter}[\p{Lowercase_Letter}\d]+)/gu, `$1${separator}$2`) - .replace(regex1, `$1${separator}$2`) - .replace(regex2, `$1${separator}$2`) - .toLowerCase(); -}; diff --git a/scripts/node_modules/decamelize/license b/scripts/node_modules/decamelize/license deleted file mode 100644 index e7af2f77..00000000 --- a/scripts/node_modules/decamelize/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/decamelize/package.json b/scripts/node_modules/decamelize/package.json deleted file mode 100644 index b5d5f8ef..00000000 --- a/scripts/node_modules/decamelize/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "decamelize", - "version": "2.0.0", - "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", - "license": "MIT", - "repository": "sindresorhus/decamelize", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "decamelize", - "decamelcase", - "camelcase", - "lowercase", - "case", - "dash", - "hyphen", - "string", - "str", - "text", - "convert" - ], - "dependencies": { - "xregexp": "4.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/scripts/node_modules/decamelize/readme.md b/scripts/node_modules/decamelize/readme.md deleted file mode 100644 index 7ab31a98..00000000 --- a/scripts/node_modules/decamelize/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) - -> Convert a camelized string into a lowercased one with a custom separator
-> Example: `unicornRainbow` → `unicorn_rainbow` - - -## Install - -``` -$ npm install decamelize -``` - - -## Usage - -```js -const decamelize = require('decamelize'); - -decamelize('unicornRainbow'); -//=> 'unicorn_rainbow' - -decamelize('unicornRainbow', '-'); -//=> 'unicorn-rainbow' -``` - - -## API - -### decamelize(input, [separator]) - -#### input - -Type: `string` - -#### separator - -Type: `string`
-Default: `_` - - -## Related - -See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/scripts/node_modules/fs.realpath/LICENSE b/scripts/node_modules/fs.realpath/LICENSE deleted file mode 100644 index 5bd884c2..00000000 --- a/scripts/node_modules/fs.realpath/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----- - -This library bundles a version of the `fs.realpath` and `fs.realpathSync` -methods from Node.js v0.10 under the terms of the Node.js MIT license. - -Node's license follows, also included at the header of `old.js` which contains -the licensed code: - - Copyright Joyent, Inc. and other Node contributors. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. diff --git a/scripts/node_modules/fs.realpath/README.md b/scripts/node_modules/fs.realpath/README.md deleted file mode 100644 index a42ceac6..00000000 --- a/scripts/node_modules/fs.realpath/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# fs.realpath - -A backwards-compatible fs.realpath for Node v6 and above - -In Node v6, the JavaScript implementation of fs.realpath was replaced -with a faster (but less resilient) native implementation. That raises -new and platform-specific errors and cannot handle long or excessively -symlink-looping paths. - -This module handles those cases by detecting the new errors and -falling back to the JavaScript implementation. On versions of Node -prior to v6, it has no effect. - -## USAGE - -```js -var rp = require('fs.realpath') - -// async version -rp.realpath(someLongAndLoopingPath, function (er, real) { - // the ELOOP was handled, but it was a bit slower -}) - -// sync version -var real = rp.realpathSync(someLongAndLoopingPath) - -// monkeypatch at your own risk! -// This replaces the fs.realpath/fs.realpathSync builtins -rp.monkeypatch() - -// un-do the monkeypatching -rp.unmonkeypatch() -``` diff --git a/scripts/node_modules/fs.realpath/index.js b/scripts/node_modules/fs.realpath/index.js deleted file mode 100644 index b09c7c7e..00000000 --- a/scripts/node_modules/fs.realpath/index.js +++ /dev/null @@ -1,66 +0,0 @@ -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = require('fs') -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = require('./old.js') - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} diff --git a/scripts/node_modules/fs.realpath/old.js b/scripts/node_modules/fs.realpath/old.js deleted file mode 100644 index b40305e7..00000000 --- a/scripts/node_modules/fs.realpath/old.js +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var pathModule = require('path'); -var isWindows = process.platform === 'win32'; -var fs = require('fs'); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; diff --git a/scripts/node_modules/fs.realpath/package.json b/scripts/node_modules/fs.realpath/package.json deleted file mode 100644 index 3edc57d2..00000000 --- a/scripts/node_modules/fs.realpath/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "fs.realpath", - "version": "1.0.0", - "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "scripts": { - "test": "tap test/*.js --cov" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/fs.realpath.git" - }, - "keywords": [ - "realpath", - "fs", - "polyfill" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "files": [ - "old.js", - "index.js" - ] -} diff --git a/scripts/node_modules/glob/LICENSE b/scripts/node_modules/glob/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/scripts/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/glob/README.md b/scripts/node_modules/glob/README.md deleted file mode 100644 index baa1d1ba..00000000 --- a/scripts/node_modules/glob/README.md +++ /dev/null @@ -1,368 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/scripts/node_modules/glob/changelog.md b/scripts/node_modules/glob/changelog.md deleted file mode 100644 index 41636771..00000000 --- a/scripts/node_modules/glob/changelog.md +++ /dev/null @@ -1,67 +0,0 @@ -## 7.0 - -- Raise error if `options.cwd` is specified, and not a directory - -## 6.0 - -- Remove comment and negation pattern support -- Ignore patterns are always in `dot:true` mode - -## 5.0 - -- Deprecate comment and negation patterns -- Fix regression in `mark` and `nodir` options from making all cache - keys absolute path. -- Abort if `fs.readdir` returns an error that's unexpected -- Don't emit `match` events for ignored items -- Treat ENOTSUP like ENOTDIR in readdir - -## 4.5 - -- Add `options.follow` to always follow directory symlinks in globstar -- Add `options.realpath` to call `fs.realpath` on all results -- Always cache based on absolute path - -## 4.4 - -- Add `options.ignore` -- Fix handling of broken symlinks - -## 4.3 - -- Bump minimatch to 2.x -- Pass all tests on Windows - -## 4.2 - -- Add `glob.hasMagic` function -- Add `options.nodir` flag - -## 4.1 - -- Refactor sync and async implementations for performance -- Throw if callback provided to sync glob function -- Treat symbolic links in globstar results the same as Bash 4.3 - -## 4.0 - -- Use `^` for dependency versions (bumped major because this breaks - older npm versions) -- Ensure callbacks are only ever called once -- switch to ISC license - -## 3.x - -- Rewrite in JavaScript -- Add support for setting root, cwd, and windows support -- Cache many fs calls -- Add globstar support -- emit match events - -## 2.x - -- Use `glob.h` and `fnmatch.h` from NetBSD - -## 1.x - -- `glob.h` static binding. diff --git a/scripts/node_modules/glob/common.js b/scripts/node_modules/glob/common.js deleted file mode 100644 index 66651bb3..00000000 --- a/scripts/node_modules/glob/common.js +++ /dev/null @@ -1,240 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/scripts/node_modules/glob/glob.js b/scripts/node_modules/glob/glob.js deleted file mode 100644 index 58dec0f6..00000000 --- a/scripts/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/scripts/node_modules/glob/package.json b/scripts/node_modules/glob/package.json deleted file mode 100644 index a4faae1b..00000000 --- a/scripts/node_modules/glob/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "glob", - "description": "a little globber", - "version": "7.1.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" - }, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^12.0.1", - "tick": "0.0.6" - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "node benchclean.js" - }, - "license": "ISC" -} diff --git a/scripts/node_modules/glob/sync.js b/scripts/node_modules/glob/sync.js deleted file mode 100644 index c952134b..00000000 --- a/scripts/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/scripts/node_modules/inflight/LICENSE b/scripts/node_modules/inflight/LICENSE deleted file mode 100644 index 05eeeb88..00000000 --- a/scripts/node_modules/inflight/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/inflight/README.md b/scripts/node_modules/inflight/README.md deleted file mode 100644 index 6dc89291..00000000 --- a/scripts/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/scripts/node_modules/inflight/inflight.js b/scripts/node_modules/inflight/inflight.js deleted file mode 100644 index 48202b3c..00000000 --- a/scripts/node_modules/inflight/inflight.js +++ /dev/null @@ -1,54 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/scripts/node_modules/inflight/package.json b/scripts/node_modules/inflight/package.json deleted file mode 100644 index 6084d350..00000000 --- a/scripts/node_modules/inflight/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inflight", - "version": "1.0.6", - "description": "Add callbacks to requests in flight to avoid async duplication", - "main": "inflight.js", - "files": [ - "inflight.js" - ], - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.1.2" - }, - "scripts": { - "test": "tap test.js --100" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/inflight.git" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC" -} diff --git a/scripts/node_modules/inherits/LICENSE b/scripts/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d..00000000 --- a/scripts/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/scripts/node_modules/inherits/README.md b/scripts/node_modules/inherits/README.md deleted file mode 100644 index b1c56658..00000000 --- a/scripts/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/scripts/node_modules/inherits/inherits.js b/scripts/node_modules/inherits/inherits.js deleted file mode 100644 index 3b94763a..00000000 --- a/scripts/node_modules/inherits/inherits.js +++ /dev/null @@ -1,7 +0,0 @@ -try { - var util = require('util'); - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - module.exports = require('./inherits_browser.js'); -} diff --git a/scripts/node_modules/inherits/inherits_browser.js b/scripts/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a75..00000000 --- a/scripts/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} diff --git a/scripts/node_modules/inherits/package.json b/scripts/node_modules/inherits/package.json deleted file mode 100644 index 7cf62b95..00000000 --- a/scripts/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.3", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": "git://github.com/isaacs/inherits", - "license": "ISC", - "scripts": { - "test": "node test" - }, - "devDependencies": { - "tap": "^7.1.0" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ] -} diff --git a/scripts/node_modules/minimatch/LICENSE b/scripts/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/scripts/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/minimatch/README.md b/scripts/node_modules/minimatch/README.md deleted file mode 100644 index ad72b813..00000000 --- a/scripts/node_modules/minimatch/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/scripts/node_modules/minimatch/minimatch.js b/scripts/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5b5f8cf4..00000000 --- a/scripts/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,923 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/scripts/node_modules/minimatch/package.json b/scripts/node_modules/minimatch/package.json deleted file mode 100644 index c4514c80..00000000 --- a/scripts/node_modules/minimatch/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.4", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test/*.js --cov", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "devDependencies": { - "tap": "^10.3.2" - }, - "license": "ISC", - "files": [ - "minimatch.js" - ] -} diff --git a/scripts/node_modules/once/LICENSE b/scripts/node_modules/once/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/scripts/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/once/README.md b/scripts/node_modules/once/README.md deleted file mode 100644 index 1f1ffca9..00000000 --- a/scripts/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/scripts/node_modules/once/once.js b/scripts/node_modules/once/once.js deleted file mode 100644 index 23540673..00000000 --- a/scripts/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/scripts/node_modules/once/package.json b/scripts/node_modules/once/package.json deleted file mode 100644 index 16815b2f..00000000 --- a/scripts/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.0.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/scripts/node_modules/path-is-absolute/index.js b/scripts/node_modules/path-is-absolute/index.js deleted file mode 100644 index 22aa6c35..00000000 --- a/scripts/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -} - -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); - - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/scripts/node_modules/path-is-absolute/license b/scripts/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe..00000000 --- a/scripts/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/scripts/node_modules/path-is-absolute/package.json b/scripts/node_modules/path-is-absolute/package.json deleted file mode 100644 index 91196d5e..00000000 --- a/scripts/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "path-is-absolute", - "version": "1.0.1", - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "license": "MIT", - "repository": "sindresorhus/path-is-absolute", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "devDependencies": { - "xo": "^0.16.0" - } -} diff --git a/scripts/node_modules/path-is-absolute/readme.md b/scripts/node_modules/path-is-absolute/readme.md deleted file mode 100644 index 8dbdf5fc..00000000 --- a/scripts/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -const pathIsAbsolute = require('path-is-absolute'); - -// Running on Linux -pathIsAbsolute('/home/foo'); -//=> true -pathIsAbsolute('C:/Users/foo'); -//=> false - -// Running on Windows -pathIsAbsolute('C:/Users/foo'); -//=> true -pathIsAbsolute('/home/foo'); -//=> false - -// Running on any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -pathIsAbsolute.posix('C:/Users/foo'); -//=> false -pathIsAbsolute.win32('C:/Users/foo'); -//=> true -pathIsAbsolute.win32('/home/foo'); -//=> false -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -POSIX specific version. - -### pathIsAbsolute.win32(path) - -Windows specific version. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/scripts/node_modules/wrappy/LICENSE b/scripts/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/scripts/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/scripts/node_modules/wrappy/README.md b/scripts/node_modules/wrappy/README.md deleted file mode 100644 index 98eab252..00000000 --- a/scripts/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/scripts/node_modules/wrappy/package.json b/scripts/node_modules/wrappy/package.json deleted file mode 100644 index 13075204..00000000 --- a/scripts/node_modules/wrappy/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.2", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "files": [ - "wrappy.js" - ], - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^2.3.1" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/wrappy" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy" -} diff --git a/scripts/node_modules/wrappy/wrappy.js b/scripts/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6f..00000000 --- a/scripts/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/scripts/node_modules/xregexp/LICENSE b/scripts/node_modules/xregexp/LICENSE deleted file mode 100644 index 43f08b4c..00000000 --- a/scripts/node_modules/xregexp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2007-2017 Steven Levithan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/scripts/node_modules/xregexp/README.md b/scripts/node_modules/xregexp/README.md deleted file mode 100644 index 172a6321..00000000 --- a/scripts/node_modules/xregexp/README.md +++ /dev/null @@ -1,237 +0,0 @@ -# XRegExp 4.0.0 - -[![Build Status](https://travis-ci.org/slevithan/xregexp.svg?branch=master)](https://travis-ci.org/slevithan/xregexp) - -XRegExp provides augmented (and extensible) JavaScript regular expressions. You get modern syntax and flags beyond what browsers support natively. XRegExp is also a regex utility belt with tools to make your grepping and parsing easier, while freeing you from regex cross-browser inconsistencies and other annoyances. - -XRegExp supports all native ES6 regular expression syntax. It supports ES5+ browsers, and you can use it with Node.js or as a RequireJS module. - -## Performance - -XRegExp compiles to native `RegExp` objects. Therefore regexes built with XRegExp perform just as fast as native regular expressions. There is a tiny extra cost when compiling a pattern for the first time. - -## Usage examples - -```js -// Using named capture and flag x for free-spacing and line comments -const date = XRegExp( - `(? [0-9]{4} ) -? # year - (? [0-9]{2} ) -? # month - (? [0-9]{2} ) # day`, 'x'); - -// XRegExp.exec gives you named backreferences on the match result -let match = XRegExp.exec('2017-02-22', date); -match.year; // -> '2017' - -// It also includes optional pos and sticky arguments -let pos = 3; -const result = []; -while (match = XRegExp.exec('<1><2><3>4<5>', /<(\d+)>/, pos, 'sticky')) { - result.push(match[1]); - pos = match.index + match[0].length; -} -// result -> ['2', '3'] - -// XRegExp.replace allows named backreferences in replacements -XRegExp.replace('2017-02-22', date, '$/$/$'); -// -> '02/22/2017' -XRegExp.replace('2017-02-22', date, (match) => { - return `${match.month}/${match.day}/${match.year}`; -}); -// -> '02/22/2017' - -// XRegExps compile to RegExps and work perfectly with native methods -date.test('2017-02-22'); -// -> true - -// The only caveat is that named captures must be referenced using -// numbered backreferences if used with native methods -'2017-02-22'.replace(date, '$2/$3/$1'); -// -> '02/22/2017' - -// Use XRegExp.forEach to extract every other digit from a string -const evens = []; -XRegExp.forEach('1a2345', /\d/, (match, i) => { - if (i % 2) evens.push(+match[0]); -}); -// evens -> [2, 4] - -// Use XRegExp.matchChain to get numbers within tags -XRegExp.matchChain('1 2 3 4 \n 56', [ - XRegExp('(?is).*?'), - /\d+/ -]); -// -> ['2', '4', '56'] - -// You can also pass forward and return specific backreferences -const html = - `
XRegExp - Google`; -XRegExp.matchChain(html, [ - {regex: //i, backref: 1}, - {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} -]); -// -> ['xregexp.com', 'www.google.com'] - -// Merge strings and regexes, with updated backreferences -XRegExp.union(['m+a*n', /(bear)\1/, /(pig)\1/], 'i', {conjunction: 'or'}); -// -> /m\+a\*n|(bear)\1|(pig)\2/i -``` - -These examples give the flavor of what's possible, but XRegExp has more syntax, flags, methods, options, and browser fixes that aren't shown here. You can also augment XRegExp's regular expression syntax with addons (see below) or write your own. See [xregexp.com](http://xregexp.com/) for details. - -## Addons - -You can either load addons individually, or bundle all addons with XRegExp by loading `xregexp-all.js` from https://unpkg.com/xregexp/xregexp-all.js. - -### Unicode - -If not using `xregexp-all.js`, first include the Unicode Base script and then one or more of the addons for Unicode blocks, categories, properties, or scripts. - -Then you can do this: - -```js -// Test the Unicode category L (Letter) -const unicodeWord = XRegExp('^\\pL+$'); -unicodeWord.test('Русский'); // -> true -unicodeWord.test('日本語'); // -> true -unicodeWord.test('العربية'); // -> true - -// Test some Unicode scripts -XRegExp('^\\p{Hiragana}+$').test('ひらがな'); // -> true -XRegExp('^[\\p{Latin}\\p{Common}]+$').test('Über Café.'); // -> true -``` - -By default, `\p{…}` and `\P{…}` support the Basic Multilingual Plane (i.e. code points up to `U+FFFF`). You can opt-in to full 21-bit Unicode support (with code points up to `U+10FFFF`) on a per-regex basis by using flag `A`. This is called *astral mode*. You can automatically add flag `A` for all new regexes by running `XRegExp.install('astral')`. When in astral mode, `\p{…}` and `\P{…}` always match a full code point rather than a code unit, using surrogate pairs for code points above `U+FFFF`. - -```js -// Using flag A to match astral code points -XRegExp('^\\pS$').test('💩'); // -> false -XRegExp('^\\pS$', 'A').test('💩'); // -> true -XRegExp('(?A)^\\pS$').test('💩'); // -> true -// Using surrogate pair U+D83D U+DCA9 to represent U+1F4A9 (pile of poo) -XRegExp('(?A)^\\pS$').test('\uD83D\uDCA9'); // -> true - -// Implicit flag A -XRegExp.install('astral'); -XRegExp('^\\pS$').test('💩'); // -> true -``` - -Opting in to astral mode disables the use of `\p{…}` and `\P{…}` within character classes. In astral mode, use e.g. `(\pL|[0-9_])+` instead of `[\pL0-9_]+`. - -XRegExp uses Unicode 9.0.0. - -### XRegExp.build - -Build regular expressions using named subpatterns, for readability and pattern reuse: - -```js -const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { - hours: XRegExp.build('{{h12}} : | {{h24}}', { - h12: /1[0-2]|0?[1-9]/, - h24: /2[0-3]|[01][0-9]/ - }), - minutes: /^[0-5][0-9]$/ -}); - -time.test('10:59'); // -> true -XRegExp.exec('10:59', time).minutes; // -> '59' -``` - -Named subpatterns can be provided as strings or regex objects. A leading `^` and trailing unescaped `$` are stripped from subpatterns if both are present, which allows embedding independently-useful anchored patterns. `{{…}}` tokens can be quantified as a single unit. Any backreferences in the outer pattern or provided subpatterns are automatically renumbered to work correctly within the larger combined pattern. The syntax `({{name}})` works as shorthand for named capture via `(?{{name}})`. Named subpatterns cannot be embedded within character classes. - -#### XRegExp.tag (included with XRegExp.build) - -Provides tagged template literals that create regexes with XRegExp syntax and flags: - -```js -const h12 = /1[0-2]|0?[1-9]/; -const h24 = /2[0-3]|[01][0-9]/; -const hours = XRegExp.tag('x')`${h12} : | ${h24}`; -const minutes = /^[0-5][0-9]$/; -// Note that explicitly naming the 'minutes' group is required for named backreferences -const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; -time.test('10:59'); // -> true -XRegExp.exec('10:59', time).minutes; // -> '59' -``` - -XRegExp.tag does more than just basic interpolation. For starters, you get all the XRegExp syntax and flags. Even better, since `XRegExp.tag` uses your pattern as a raw string, you no longer need to escape all your backslashes. And since it relies on `XRegExp.build` under the hood, you get all of its extras for free. Leading `^` and trailing unescaped `$` are stripped from interpolated patterns if both are present (to allow embedding independently useful anchored regexes), interpolating into a character class is an error (to avoid unintended meaning in edge cases), interpolated patterns are treated as atomic units when quantified, interpolated strings have their special characters escaped, and any backreferences within an interpolated regex are rewritten to work within the overall pattern. - -### XRegExp.matchRecursive - -Match recursive constructs using XRegExp pattern strings as left and right delimiters: - -```js -const str1 = '(t((e))s)t()(ing)'; -XRegExp.matchRecursive(str1, '\\(', '\\)', 'g'); -// -> ['t((e))s', '', 'ing'] - -// Extended information mode with valueNames -const str2 = 'Here is
an
example'; -XRegExp.matchRecursive(str2, '', '', 'gi', { - valueNames: ['between', 'left', 'match', 'right'] -}); -/* -> [ -{name: 'between', value: 'Here is ', start: 0, end: 8}, -{name: 'left', value: '
', start: 8, end: 13}, -{name: 'match', value: '
an
', start: 13, end: 27}, -{name: 'right', value: '
', start: 27, end: 33}, -{name: 'between', value: ' example', start: 33, end: 41} -] */ - -// Omitting unneeded parts with null valueNames, and using escapeChar -const str3 = '...{1}.\\{{function(x,y){return {y:x}}}'; -XRegExp.matchRecursive(str3, '{', '}', 'g', { - valueNames: ['literal', null, 'value', null], - escapeChar: '\\' -}); -/* -> [ -{name: 'literal', value: '...', start: 0, end: 3}, -{name: 'value', value: '1', start: 4, end: 5}, -{name: 'literal', value: '.\\{', start: 6, end: 9}, -{name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} -] */ - -// Sticky mode via flag y -const str4 = '<1><<<2>>><3>4<5>'; -XRegExp.matchRecursive(str4, '<', '>', 'gy'); -// -> ['1', '<<2>>', '3'] -``` - -`XRegExp.matchRecursive` throws an error if it scans past an unbalanced delimiter in the target string. - -## Installation and usage - -In browsers (bundle XRegExp with all of its addons): - -```html - -``` - -Using [npm](https://www.npmjs.com/): - -```bash -npm install xregexp -``` - -In [Node.js](http://nodejs.org/): - -```js -const XRegExp = require('xregexp'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({paths: {xregexp: 'xregexp-all'}}, ['xregexp'], (XRegExp) => { - console.log(XRegExp.version); -}); -``` - -## About - -XRegExp copyright 2007-2017 by [Steven Levithan](http://stevenlevithan.com/). Unicode data generators by [Mathias Bynens](http://mathiasbynens.be/), adapted from [unicode-data](http://git.io/unicode). XRegExp's syntax extensions and flags come from [Perl](http://www.perl.org/), [.NET](http://www.microsoft.com/net), etc. - -All code, including addons, tools, and tests, is released under the terms of the [MIT License](http://mit-license.org/). - -Learn more at [xregexp.com](http://xregexp.com/). diff --git a/scripts/node_modules/xregexp/lib/addons/build.js b/scripts/node_modules/xregexp/lib/addons/build.js deleted file mode 100644 index c1cdd338..00000000 --- a/scripts/node_modules/xregexp/lib/addons/build.js +++ /dev/null @@ -1,241 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp.build 4.0.0 - * - * Steven Levithan (c) 2012-2017 MIT License - */ - -exports.default = function (XRegExp) { - var REGEX_DATA = 'xregexp'; - var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { - conjunction: 'or' - }); - - /** - * Strips a leading `^` and trailing unescaped `$`, if both are present. - * - * @private - * @param {String} pattern Pattern to process. - * @returns {String} Pattern with edge anchors removed. - */ - function deanchor(pattern) { - // Allow any number of empty noncapturing groups before/after anchors, because regexes - // built/generated by XRegExp sometimes include them - var leadingAnchor = /^(?:\(\?:\))*\^/; - var trailingAnchor = /\$(?:\(\?:\))*$/; - - if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && - // Ensure that the trailing `$` isn't escaped - trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { - return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); - } - - return pattern; - } - - /** - * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. - * - * @private - * @param {String|RegExp} value Value to convert. - * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not - * already a regex generated by XRegExp - * @returns {RegExp} XRegExp object with XRegExp syntax applied. - */ - function asXRegExp(value, addFlagX) { - var flags = addFlagX ? 'x' : ''; - return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? - // Don't recompile, to preserve capture names - value : - // Recompile as XRegExp - XRegExp(value.source, flags) : - // Compile string as XRegExp - XRegExp(value, flags); - } - - function interpolate(substitution) { - return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); - } - - function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { - subpatterns['subpattern' + subpatternIndex] = interpolated; - return subpatterns; - } - - function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { - var hasSubpattern = subpatternIndex < rawLiterals.length - 1; - return raw + (hasSubpattern ? '{{subpattern' + subpatternIndex + '}}' : ''); - } - - /** - * Provides tagged template literals that create regexes with XRegExp syntax and flags. The - * provided pattern is handled as a raw string, so backslashes don't need to be escaped. - * - * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated - * patterns are treated as atomic units when quantified, interpolated strings have their special - * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated - * regexes if both are present, and any backreferences within an interpolated regex are - * rewritten to work within the overall pattern. - * - * @memberOf XRegExp - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. - * @example - * - * const h12 = /1[0-2]|0?[1-9]/; - * const h24 = /2[0-3]|[01][0-9]/; - * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; - * const minutes = /^[0-5][0-9]$/; - * // Note that explicitly naming the 'minutes' group is required for named backreferences - * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.tag = function (flags) { - return function (literals) { - for (var _len = arguments.length, substitutions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - substitutions[_key - 1] = arguments[_key]; - } - - var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); - var pattern = literals.raw.map(embedSubpatternAfter).join(''); - return XRegExp.build(pattern, subpatterns, flags); - }; - }; - - /** - * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in - * the outer pattern and provided subpatterns are automatically renumbered to work correctly. - * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. - * - * @memberOf XRegExp - * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows - * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within - * character classes. - * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A - * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Regex with interpolated subpatterns. - * @example - * - * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { - * hours: XRegExp.build('{{h12}} : | {{h24}}', { - * h12: /1[0-2]|0?[1-9]/, - * h24: /2[0-3]|[01][0-9]/ - * }, 'x'), - * minutes: /^[0-5][0-9]$/ - * }); - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.build = function (pattern, subs, flags) { - flags = flags || ''; - // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how - // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` - // and `n`. See more details at . - var addFlagX = flags.indexOf('x') !== -1; - var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); - // Add flags within a leading mode modifier to the overall pattern's flags - if (inlineFlags) { - flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); - } - - var data = {}; - for (var p in subs) { - if (subs.hasOwnProperty(p)) { - // Passing to XRegExp enables extended syntax and ensures independent validity, - // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For - // subpatterns provided as native regexes, it dies on octals and adds the property - // used to hold extended regex instance data, for simplicity. - var sub = asXRegExp(subs[p], addFlagX); - data[p] = { - // Deanchoring allows embedding independently useful anchored regexes. If you - // really need to keep your anchors, double them (i.e., `^^...$$`). - pattern: deanchor(sub.source), - names: sub[REGEX_DATA].captureNames || [] - }; - } - } - - // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; - // helps keep this simple. Named captures will be put back. - var patternAsRegex = asXRegExp(pattern, addFlagX); - - // 'Caps' is short for 'captures' - var numCaps = 0; - var numPriorCaps = void 0; - var numOuterCaps = 0; - var outerCapsMap = [0]; - var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; - var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { - var subName = $1 || $2; - var capName = void 0; - var intro = void 0; - var localCapIndex = void 0; - // Named subpattern - if (subName) { - if (!data.hasOwnProperty(subName)) { - throw new ReferenceError('Undefined property ' + $0); - } - // Named subpattern was wrapped in a capturing group - if ($1) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If it's a named group, preserve the name. Otherwise, use the subpattern name - // as the capture name - intro = '(?<' + (capName || subName) + '>'; - } else { - intro = '(?:'; - } - numPriorCaps = numCaps; - var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { - // Capturing group - if (paren) { - capName = data[subName].names[numCaps - numPriorCaps]; - ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return '(?<' + capName + '>'; - } - // Backreference - } else if (backref) { - localCapIndex = +backref - 1; - // Rewrite the backreference - return data[subName].names[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - '\\k<' + data[subName].names[localCapIndex] + '>' : '\\' + (+backref + numPriorCaps); - } - return match; - }); - return '' + intro + rewrittenSubpattern + ')'; - } - // Capturing group - if ($3) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return '(?<' + capName + '>'; - } - // Backreference - } else if ($4) { - localCapIndex = +$4 - 1; - // Rewrite the backreference - return outerCapNames[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - '\\k<' + outerCapNames[localCapIndex] + '>' : '\\' + outerCapsMap[+$4]; - } - return $0; - }); - - return XRegExp(output, flags); - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/matchrecursive.js b/scripts/node_modules/xregexp/lib/addons/matchrecursive.js deleted file mode 100644 index 95511e4c..00000000 --- a/scripts/node_modules/xregexp/lib/addons/matchrecursive.js +++ /dev/null @@ -1,202 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp.matchRecursive 4.0.0 - * - * Steven Levithan (c) 2009-2017 MIT License - */ - -exports.default = function (XRegExp) { - - /** - * Returns a match detail object composed of the provided values. - * - * @private - */ - function row(name, value, start, end) { - return { - name: name, - value: value, - start: start, - end: end - }; - } - - /** - * Returns an array of match strings between outermost left and right delimiters, or an array of - * objects with detailed match parts and position data. An error is thrown if delimiters are - * unbalanced within the data. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {String} left Left delimiter as an XRegExp pattern. - * @param {String} right Right delimiter as an XRegExp pattern. - * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. - * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. - * @returns {Array} Array of matches, or an empty array. - * @example - * - * // Basic usage - * let str = '(t((e))s)t()(ing)'; - * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); - * // -> ['t((e))s', '', 'ing'] - * - * // Extended information mode with valueNames - * str = 'Here is
an
example'; - * XRegExp.matchRecursive(str, '', '', 'gi', { - * valueNames: ['between', 'left', 'match', 'right'] - * }); - * // -> [ - * // {name: 'between', value: 'Here is ', start: 0, end: 8}, - * // {name: 'left', value: '
', start: 8, end: 13}, - * // {name: 'match', value: '
an
', start: 13, end: 27}, - * // {name: 'right', value: '
', start: 27, end: 33}, - * // {name: 'between', value: ' example', start: 33, end: 41} - * // ] - * - * // Omitting unneeded parts with null valueNames, and using escapeChar - * str = '...{1}.\\{{function(x,y){return {y:x}}}'; - * XRegExp.matchRecursive(str, '{', '}', 'g', { - * valueNames: ['literal', null, 'value', null], - * escapeChar: '\\' - * }); - * // -> [ - * // {name: 'literal', value: '...', start: 0, end: 3}, - * // {name: 'value', value: '1', start: 4, end: 5}, - * // {name: 'literal', value: '.\\{', start: 6, end: 9}, - * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} - * // ] - * - * // Sticky mode via flag y - * str = '<1><<<2>>><3>4<5>'; - * XRegExp.matchRecursive(str, '<', '>', 'gy'); - * // -> ['1', '<<2>>', '3'] - */ - XRegExp.matchRecursive = function (str, left, right, flags, options) { - flags = flags || ''; - options = options || {}; - var global = flags.indexOf('g') !== -1; - var sticky = flags.indexOf('y') !== -1; - // Flag `y` is controlled internally - var basicFlags = flags.replace(/y/g, ''); - var escapeChar = options.escapeChar; - var vN = options.valueNames; - var output = []; - var openTokens = 0; - var delimStart = 0; - var delimEnd = 0; - var lastOuterEnd = 0; - var outerStart = void 0; - var innerStart = void 0; - var leftMatch = void 0; - var rightMatch = void 0; - var esc = void 0; - left = XRegExp(left, basicFlags); - right = XRegExp(right, basicFlags); - - if (escapeChar) { - if (escapeChar.length > 1) { - throw new Error('Cannot use more than one escape character'); - } - escapeChar = XRegExp.escape(escapeChar); - // Example of concatenated `esc` regex: - // `escapeChar`: '%' - // `left`: '<' - // `right`: '>' - // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ - esc = new RegExp('(?:' + escapeChar + '[\\S\\s]|(?:(?!' + - // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. - // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax - // transformation resulting from those flags was already applied to `left` and - // `right` when they were passed through the XRegExp constructor above. - XRegExp.union([left, right], '', { conjunction: 'or' }).source + ')[^' + escapeChar + '])+)+', - // Flags `gy` not needed here - flags.replace(/[^imu]+/g, '')); - } - - while (true) { - // If using an escape character, advance to the delimiter's next starting position, - // skipping any escaped characters in between - if (escapeChar) { - delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; - } - leftMatch = XRegExp.exec(str, left, delimEnd); - rightMatch = XRegExp.exec(str, right, delimEnd); - // Keep the leftmost match only - if (leftMatch && rightMatch) { - if (leftMatch.index <= rightMatch.index) { - rightMatch = null; - } else { - leftMatch = null; - } - } - // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): - // LM | RM | OT | Result - // 1 | 0 | 1 | loop - // 1 | 0 | 0 | loop - // 0 | 1 | 1 | loop - // 0 | 1 | 0 | throw - // 0 | 0 | 1 | throw - // 0 | 0 | 0 | break - // The paths above don't include the sticky mode special case. The loop ends after the - // first completed match if not `global`. - if (leftMatch || rightMatch) { - delimStart = (leftMatch || rightMatch).index; - delimEnd = delimStart + (leftMatch || rightMatch)[0].length; - } else if (!openTokens) { - break; - } - if (sticky && !openTokens && delimStart > lastOuterEnd) { - break; - } - if (leftMatch) { - if (!openTokens) { - outerStart = delimStart; - innerStart = delimEnd; - } - ++openTokens; - } else if (rightMatch && openTokens) { - if (! --openTokens) { - if (vN) { - if (vN[0] && outerStart > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); - } - if (vN[1]) { - output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); - } - if (vN[2]) { - output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); - } - if (vN[3]) { - output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); - } - } else { - output.push(str.slice(innerStart, delimStart)); - } - lastOuterEnd = delimEnd; - if (!global) { - break; - } - } - } else { - throw new Error('Unbalanced delimiter found in string'); - } - // If the delimiter matched an empty string, avoid an infinite loop - if (delimStart === delimEnd) { - ++delimEnd; - } - } - - if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); - } - - return output; - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-base.js b/scripts/node_modules/xregexp/lib/addons/unicode-base.js deleted file mode 100644 index 7cc76c46..00000000 --- a/scripts/node_modules/xregexp/lib/addons/unicode-base.js +++ /dev/null @@ -1,247 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Base 4.0.0 - * - * Steven Levithan (c) 2008-2017 MIT License - */ - -exports.default = function (XRegExp) { - - /** - * Adds base support for Unicode matching: - * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or - * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the - * braces for token names that are a single letter (e.g. `\pL` or `PL`). - * - Adds flag A (astral), which enables 21-bit Unicode support. - * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. - * - * Unicode Base relies on externally provided Unicode character data. Official addons are - * available to provide data for Unicode categories, scripts, blocks, and properties. - * - * @requires XRegExp - */ - - // ==--------------------------== - // Private stuff - // ==--------------------------== - - // Storage for Unicode data - var unicode = {}; - - // Reuse utils - var dec = XRegExp._dec; - var hex = XRegExp._hex; - var pad4 = XRegExp._pad4; - - // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed - function normalize(name) { - return name.replace(/[- _]+/g, '').toLowerCase(); - } - - // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal - function charCode(chr) { - var esc = /^\\[xu](.+)/.exec(chr); - return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); - } - - // Inverts a list of ordered BMP characters and ranges - function invertBmp(range) { - var output = ''; - var lastEnd = -1; - - XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { - var start = charCode(m[1]); - if (start > lastEnd + 1) { - output += '\\u' + pad4(hex(lastEnd + 1)); - if (start > lastEnd + 2) { - output += '-\\u' + pad4(hex(start - 1)); - } - } - lastEnd = charCode(m[2] || m[1]); - }); - - if (lastEnd < 0xFFFF) { - output += '\\u' + pad4(hex(lastEnd + 1)); - if (lastEnd < 0xFFFE) { - output += '-\\uFFFF'; - } - } - - return output; - } - - // Generates an inverted BMP range on first use - function cacheInvertedBmp(slug) { - var prop = 'b!'; - return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); - } - - // Combines and optionally negates BMP and astral data - function buildAstral(slug, isNegated) { - var item = unicode[slug]; - var combined = ''; - - if (item.bmp && !item.isBmpLast) { - combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); - } - if (item.astral) { - combined += item.astral; - } - if (item.isBmpLast && item.bmp) { - combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; - } - - // Astral Unicode tokens always match a code point, never a code unit - return isNegated ? '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : '(?:' + combined + ')'; - } - - // Builds a complete astral pattern on first use - function cacheAstral(slug, isNegated) { - var prop = isNegated ? 'a!' : 'a='; - return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); - } - - // ==--------------------------== - // Core functionality - // ==--------------------------== - - /* - * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. - */ - XRegExp.addToken( - // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` - /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { - var ERR_DOUBLE_NEG = 'Invalid double negation '; - var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; - var ERR_UNKNOWN_REF = 'Unicode token missing data '; - var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; - var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; - // Negated via \P{..} or \p{^..} - var isNegated = match[1] === 'P' || !!match[2]; - // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A - var isAstralMode = flags.indexOf('A') !== -1; - // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` - var slug = normalize(match[4] || match[3]); - // Token data object - var item = unicode[slug]; - - if (match[1] === 'P' && match[2]) { - throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); - } - if (!unicode.hasOwnProperty(slug)) { - throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); - } - - // Switch to the negated form of the referenced Unicode token - if (item.inverseOf) { - slug = normalize(item.inverseOf); - if (!unicode.hasOwnProperty(slug)) { - throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); - } - item = unicode[slug]; - isNegated = !isNegated; - } - - if (!(item.bmp || isAstralMode)) { - throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); - } - if (isAstralMode) { - if (scope === 'class') { - throw new SyntaxError(ERR_ASTRAL_IN_CLASS); - } - - return cacheAstral(slug, isNegated); - } - - return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : (isNegated ? '[^' : '[') + item.bmp + ']'; - }, { - scope: 'all', - optionalFlags: 'A', - leadChar: '\\' - }); - - /** - * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. - * - * @memberOf XRegExp - * @param {Array} data Objects with named character ranges. Each object may have properties - * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are - * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If - * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, - * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are - * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and - * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan - * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and - * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape - * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be - * escaped, apart from range-creating hyphens. The `astral` data can additionally use - * character classes and alternation, and should use surrogate pairs to represent astral code - * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is - * defined as the exact inverse of another token. - * @example - * - * // Basic use - * XRegExp.addUnicodeData([{ - * name: 'XDigit', - * alias: 'Hexadecimal', - * bmp: '0-9A-Fa-f' - * }]); - * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true - */ - XRegExp.addUnicodeData = function (data) { - var ERR_NO_NAME = 'Unicode token requires name'; - var ERR_NO_DATA = 'Unicode token has no character data '; - var item = void 0; - - for (var i = 0; i < data.length; ++i) { - item = data[i]; - if (!item.name) { - throw new Error(ERR_NO_NAME); - } - if (!(item.inverseOf || item.bmp || item.astral)) { - throw new Error(ERR_NO_DATA + item.name); - } - unicode[normalize(item.name)] = item; - if (item.alias) { - unicode[normalize(item.alias)] = item; - } - } - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and - // flags might now produce different results - XRegExp.cache.flush('patterns'); - }; - - /** - * @ignore - * - * Return a reference to the internal Unicode definition structure for the given Unicode - * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex - * constructs. - * - * @memberOf XRegExp - * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), - * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode - * Properties and Property Aliases. - * @returns {Object} Reference to definition structure when the name matches a Unicode Property. - * - * @note - * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. - * - * @note - * This method is *not* part of the officially documented API and may change or be removed in - * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode - * structures set up by XRegExp. - */ - XRegExp._getUnicodeProperty = function (name) { - var slug = normalize(name); - return unicode[slug]; - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js b/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js deleted file mode 100644 index 69704aad..00000000 --- a/scripts/node_modules/xregexp/lib/addons/unicode-blocks.js +++ /dev/null @@ -1,852 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Blocks 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., - * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and - * underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); - } - - XRegExp.addUnicodeData([{ - name: 'InAdlam', - astral: '\uD83A[\uDD00-\uDD5F]' - }, { - name: 'InAegean_Numbers', - astral: '\uD800[\uDD00-\uDD3F]' - }, { - name: 'InAhom', - astral: '\uD805[\uDF00-\uDF3F]' - }, { - name: 'InAlchemical_Symbols', - astral: '\uD83D[\uDF00-\uDF7F]' - }, { - name: 'InAlphabetic_Presentation_Forms', - bmp: '\uFB00-\uFB4F' - }, { - name: 'InAnatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE7F]' - }, { - name: 'InAncient_Greek_Musical_Notation', - astral: '\uD834[\uDE00-\uDE4F]' - }, { - name: 'InAncient_Greek_Numbers', - astral: '\uD800[\uDD40-\uDD8F]' - }, { - name: 'InAncient_Symbols', - astral: '\uD800[\uDD90-\uDDCF]' - }, { - name: 'InArabic', - bmp: '\u0600-\u06FF' - }, { - name: 'InArabic_Extended_A', - bmp: '\u08A0-\u08FF' - }, { - name: 'InArabic_Mathematical_Alphabetic_Symbols', - astral: '\uD83B[\uDE00-\uDEFF]' - }, { - name: 'InArabic_Presentation_Forms_A', - bmp: '\uFB50-\uFDFF' - }, { - name: 'InArabic_Presentation_Forms_B', - bmp: '\uFE70-\uFEFF' - }, { - name: 'InArabic_Supplement', - bmp: '\u0750-\u077F' - }, { - name: 'InArmenian', - bmp: '\u0530-\u058F' - }, { - name: 'InArrows', - bmp: '\u2190-\u21FF' - }, { - name: 'InAvestan', - astral: '\uD802[\uDF00-\uDF3F]' - }, { - name: 'InBalinese', - bmp: '\u1B00-\u1B7F' - }, { - name: 'InBamum', - bmp: '\uA6A0-\uA6FF' - }, { - name: 'InBamum_Supplement', - astral: '\uD81A[\uDC00-\uDE3F]' - }, { - name: 'InBasic_Latin', - bmp: '\0-\x7F' - }, { - name: 'InBassa_Vah', - astral: '\uD81A[\uDED0-\uDEFF]' - }, { - name: 'InBatak', - bmp: '\u1BC0-\u1BFF' - }, { - name: 'InBengali', - bmp: '\u0980-\u09FF' - }, { - name: 'InBhaiksuki', - astral: '\uD807[\uDC00-\uDC6F]' - }, { - name: 'InBlock_Elements', - bmp: '\u2580-\u259F' - }, { - name: 'InBopomofo', - bmp: '\u3100-\u312F' - }, { - name: 'InBopomofo_Extended', - bmp: '\u31A0-\u31BF' - }, { - name: 'InBox_Drawing', - bmp: '\u2500-\u257F' - }, { - name: 'InBrahmi', - astral: '\uD804[\uDC00-\uDC7F]' - }, { - name: 'InBraille_Patterns', - bmp: '\u2800-\u28FF' - }, { - name: 'InBuginese', - bmp: '\u1A00-\u1A1F' - }, { - name: 'InBuhid', - bmp: '\u1740-\u175F' - }, { - name: 'InByzantine_Musical_Symbols', - astral: '\uD834[\uDC00-\uDCFF]' - }, { - name: 'InCJK_Compatibility', - bmp: '\u3300-\u33FF' - }, { - name: 'InCJK_Compatibility_Forms', - bmp: '\uFE30-\uFE4F' - }, { - name: 'InCJK_Compatibility_Ideographs', - bmp: '\uF900-\uFAFF' - }, { - name: 'InCJK_Compatibility_Ideographs_Supplement', - astral: '\uD87E[\uDC00-\uDE1F]' - }, { - name: 'InCJK_Radicals_Supplement', - bmp: '\u2E80-\u2EFF' - }, { - name: 'InCJK_Strokes', - bmp: '\u31C0-\u31EF' - }, { - name: 'InCJK_Symbols_and_Punctuation', - bmp: '\u3000-\u303F' - }, { - name: 'InCJK_Unified_Ideographs', - bmp: '\u4E00-\u9FFF' - }, { - name: 'InCJK_Unified_Ideographs_Extension_A', - bmp: '\u3400-\u4DBF' - }, { - name: 'InCJK_Unified_Ideographs_Extension_B', - astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_C', - astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_D', - astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_E', - astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' - }, { - name: 'InCarian', - astral: '\uD800[\uDEA0-\uDEDF]' - }, { - name: 'InCaucasian_Albanian', - astral: '\uD801[\uDD30-\uDD6F]' - }, { - name: 'InChakma', - astral: '\uD804[\uDD00-\uDD4F]' - }, { - name: 'InCham', - bmp: '\uAA00-\uAA5F' - }, { - name: 'InCherokee', - bmp: '\u13A0-\u13FF' - }, { - name: 'InCherokee_Supplement', - bmp: '\uAB70-\uABBF' - }, { - name: 'InCombining_Diacritical_Marks', - bmp: '\u0300-\u036F' - }, { - name: 'InCombining_Diacritical_Marks_Extended', - bmp: '\u1AB0-\u1AFF' - }, { - name: 'InCombining_Diacritical_Marks_Supplement', - bmp: '\u1DC0-\u1DFF' - }, { - name: 'InCombining_Diacritical_Marks_for_Symbols', - bmp: '\u20D0-\u20FF' - }, { - name: 'InCombining_Half_Marks', - bmp: '\uFE20-\uFE2F' - }, { - name: 'InCommon_Indic_Number_Forms', - bmp: '\uA830-\uA83F' - }, { - name: 'InControl_Pictures', - bmp: '\u2400-\u243F' - }, { - name: 'InCoptic', - bmp: '\u2C80-\u2CFF' - }, { - name: 'InCoptic_Epact_Numbers', - astral: '\uD800[\uDEE0-\uDEFF]' - }, { - name: 'InCounting_Rod_Numerals', - astral: '\uD834[\uDF60-\uDF7F]' - }, { - name: 'InCuneiform', - astral: '\uD808[\uDC00-\uDFFF]' - }, { - name: 'InCuneiform_Numbers_and_Punctuation', - astral: '\uD809[\uDC00-\uDC7F]' - }, { - name: 'InCurrency_Symbols', - bmp: '\u20A0-\u20CF' - }, { - name: 'InCypriot_Syllabary', - astral: '\uD802[\uDC00-\uDC3F]' - }, { - name: 'InCyrillic', - bmp: '\u0400-\u04FF' - }, { - name: 'InCyrillic_Extended_A', - bmp: '\u2DE0-\u2DFF' - }, { - name: 'InCyrillic_Extended_B', - bmp: '\uA640-\uA69F' - }, { - name: 'InCyrillic_Extended_C', - bmp: '\u1C80-\u1C8F' - }, { - name: 'InCyrillic_Supplement', - bmp: '\u0500-\u052F' - }, { - name: 'InDeseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, { - name: 'InDevanagari', - bmp: '\u0900-\u097F' - }, { - name: 'InDevanagari_Extended', - bmp: '\uA8E0-\uA8FF' - }, { - name: 'InDingbats', - bmp: '\u2700-\u27BF' - }, { - name: 'InDomino_Tiles', - astral: '\uD83C[\uDC30-\uDC9F]' - }, { - name: 'InDuployan', - astral: '\uD82F[\uDC00-\uDC9F]' - }, { - name: 'InEarly_Dynastic_Cuneiform', - astral: '\uD809[\uDC80-\uDD4F]' - }, { - name: 'InEgyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' - }, { - name: 'InElbasan', - astral: '\uD801[\uDD00-\uDD2F]' - }, { - name: 'InEmoticons', - astral: '\uD83D[\uDE00-\uDE4F]' - }, { - name: 'InEnclosed_Alphanumeric_Supplement', - astral: '\uD83C[\uDD00-\uDDFF]' - }, { - name: 'InEnclosed_Alphanumerics', - bmp: '\u2460-\u24FF' - }, { - name: 'InEnclosed_CJK_Letters_and_Months', - bmp: '\u3200-\u32FF' - }, { - name: 'InEnclosed_Ideographic_Supplement', - astral: '\uD83C[\uDE00-\uDEFF]' - }, { - name: 'InEthiopic', - bmp: '\u1200-\u137F' - }, { - name: 'InEthiopic_Extended', - bmp: '\u2D80-\u2DDF' - }, { - name: 'InEthiopic_Extended_A', - bmp: '\uAB00-\uAB2F' - }, { - name: 'InEthiopic_Supplement', - bmp: '\u1380-\u139F' - }, { - name: 'InGeneral_Punctuation', - bmp: '\u2000-\u206F' - }, { - name: 'InGeometric_Shapes', - bmp: '\u25A0-\u25FF' - }, { - name: 'InGeometric_Shapes_Extended', - astral: '\uD83D[\uDF80-\uDFFF]' - }, { - name: 'InGeorgian', - bmp: '\u10A0-\u10FF' - }, { - name: 'InGeorgian_Supplement', - bmp: '\u2D00-\u2D2F' - }, { - name: 'InGlagolitic', - bmp: '\u2C00-\u2C5F' - }, { - name: 'InGlagolitic_Supplement', - astral: '\uD838[\uDC00-\uDC2F]' - }, { - name: 'InGothic', - astral: '\uD800[\uDF30-\uDF4F]' - }, { - name: 'InGrantha', - astral: '\uD804[\uDF00-\uDF7F]' - }, { - name: 'InGreek_Extended', - bmp: '\u1F00-\u1FFF' - }, { - name: 'InGreek_and_Coptic', - bmp: '\u0370-\u03FF' - }, { - name: 'InGujarati', - bmp: '\u0A80-\u0AFF' - }, { - name: 'InGurmukhi', - bmp: '\u0A00-\u0A7F' - }, { - name: 'InHalfwidth_and_Fullwidth_Forms', - bmp: '\uFF00-\uFFEF' - }, { - name: 'InHangul_Compatibility_Jamo', - bmp: '\u3130-\u318F' - }, { - name: 'InHangul_Jamo', - bmp: '\u1100-\u11FF' - }, { - name: 'InHangul_Jamo_Extended_A', - bmp: '\uA960-\uA97F' - }, { - name: 'InHangul_Jamo_Extended_B', - bmp: '\uD7B0-\uD7FF' - }, { - name: 'InHangul_Syllables', - bmp: '\uAC00-\uD7AF' - }, { - name: 'InHanunoo', - bmp: '\u1720-\u173F' - }, { - name: 'InHatran', - astral: '\uD802[\uDCE0-\uDCFF]' - }, { - name: 'InHebrew', - bmp: '\u0590-\u05FF' - }, { - name: 'InHigh_Private_Use_Surrogates', - bmp: '\uDB80-\uDBFF' - }, { - name: 'InHigh_Surrogates', - bmp: '\uD800-\uDB7F' - }, { - name: 'InHiragana', - bmp: '\u3040-\u309F' - }, { - name: 'InIPA_Extensions', - bmp: '\u0250-\u02AF' - }, { - name: 'InIdeographic_Description_Characters', - bmp: '\u2FF0-\u2FFF' - }, { - name: 'InIdeographic_Symbols_and_Punctuation', - astral: '\uD81B[\uDFE0-\uDFFF]' - }, { - name: 'InImperial_Aramaic', - astral: '\uD802[\uDC40-\uDC5F]' - }, { - name: 'InInscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF7F]' - }, { - name: 'InInscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF5F]' - }, { - name: 'InJavanese', - bmp: '\uA980-\uA9DF' - }, { - name: 'InKaithi', - astral: '\uD804[\uDC80-\uDCCF]' - }, { - name: 'InKana_Supplement', - astral: '\uD82C[\uDC00-\uDCFF]' - }, { - name: 'InKanbun', - bmp: '\u3190-\u319F' - }, { - name: 'InKangxi_Radicals', - bmp: '\u2F00-\u2FDF' - }, { - name: 'InKannada', - bmp: '\u0C80-\u0CFF' - }, { - name: 'InKatakana', - bmp: '\u30A0-\u30FF' - }, { - name: 'InKatakana_Phonetic_Extensions', - bmp: '\u31F0-\u31FF' - }, { - name: 'InKayah_Li', - bmp: '\uA900-\uA92F' - }, { - name: 'InKharoshthi', - astral: '\uD802[\uDE00-\uDE5F]' - }, { - name: 'InKhmer', - bmp: '\u1780-\u17FF' - }, { - name: 'InKhmer_Symbols', - bmp: '\u19E0-\u19FF' - }, { - name: 'InKhojki', - astral: '\uD804[\uDE00-\uDE4F]' - }, { - name: 'InKhudawadi', - astral: '\uD804[\uDEB0-\uDEFF]' - }, { - name: 'InLao', - bmp: '\u0E80-\u0EFF' - }, { - name: 'InLatin_Extended_Additional', - bmp: '\u1E00-\u1EFF' - }, { - name: 'InLatin_Extended_A', - bmp: '\u0100-\u017F' - }, { - name: 'InLatin_Extended_B', - bmp: '\u0180-\u024F' - }, { - name: 'InLatin_Extended_C', - bmp: '\u2C60-\u2C7F' - }, { - name: 'InLatin_Extended_D', - bmp: '\uA720-\uA7FF' - }, { - name: 'InLatin_Extended_E', - bmp: '\uAB30-\uAB6F' - }, { - name: 'InLatin_1_Supplement', - bmp: '\x80-\xFF' - }, { - name: 'InLepcha', - bmp: '\u1C00-\u1C4F' - }, { - name: 'InLetterlike_Symbols', - bmp: '\u2100-\u214F' - }, { - name: 'InLimbu', - bmp: '\u1900-\u194F' - }, { - name: 'InLinear_A', - astral: '\uD801[\uDE00-\uDF7F]' - }, { - name: 'InLinear_B_Ideograms', - astral: '\uD800[\uDC80-\uDCFF]' - }, { - name: 'InLinear_B_Syllabary', - astral: '\uD800[\uDC00-\uDC7F]' - }, { - name: 'InLisu', - bmp: '\uA4D0-\uA4FF' - }, { - name: 'InLow_Surrogates', - bmp: '\uDC00-\uDFFF' - }, { - name: 'InLycian', - astral: '\uD800[\uDE80-\uDE9F]' - }, { - name: 'InLydian', - astral: '\uD802[\uDD20-\uDD3F]' - }, { - name: 'InMahajani', - astral: '\uD804[\uDD50-\uDD7F]' - }, { - name: 'InMahjong_Tiles', - astral: '\uD83C[\uDC00-\uDC2F]' - }, { - name: 'InMalayalam', - bmp: '\u0D00-\u0D7F' - }, { - name: 'InMandaic', - bmp: '\u0840-\u085F' - }, { - name: 'InManichaean', - astral: '\uD802[\uDEC0-\uDEFF]' - }, { - name: 'InMarchen', - astral: '\uD807[\uDC70-\uDCBF]' - }, { - name: 'InMathematical_Alphanumeric_Symbols', - astral: '\uD835[\uDC00-\uDFFF]' - }, { - name: 'InMathematical_Operators', - bmp: '\u2200-\u22FF' - }, { - name: 'InMeetei_Mayek', - bmp: '\uABC0-\uABFF' - }, { - name: 'InMeetei_Mayek_Extensions', - bmp: '\uAAE0-\uAAFF' - }, { - name: 'InMende_Kikakui', - astral: '\uD83A[\uDC00-\uDCDF]' - }, { - name: 'InMeroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDFF]' - }, { - name: 'InMeroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, { - name: 'InMiao', - astral: '\uD81B[\uDF00-\uDF9F]' - }, { - name: 'InMiscellaneous_Mathematical_Symbols_A', - bmp: '\u27C0-\u27EF' - }, { - name: 'InMiscellaneous_Mathematical_Symbols_B', - bmp: '\u2980-\u29FF' - }, { - name: 'InMiscellaneous_Symbols', - bmp: '\u2600-\u26FF' - }, { - name: 'InMiscellaneous_Symbols_and_Arrows', - bmp: '\u2B00-\u2BFF' - }, { - name: 'InMiscellaneous_Symbols_and_Pictographs', - astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' - }, { - name: 'InMiscellaneous_Technical', - bmp: '\u2300-\u23FF' - }, { - name: 'InModi', - astral: '\uD805[\uDE00-\uDE5F]' - }, { - name: 'InModifier_Tone_Letters', - bmp: '\uA700-\uA71F' - }, { - name: 'InMongolian', - bmp: '\u1800-\u18AF' - }, { - name: 'InMongolian_Supplement', - astral: '\uD805[\uDE60-\uDE7F]' - }, { - name: 'InMro', - astral: '\uD81A[\uDE40-\uDE6F]' - }, { - name: 'InMultani', - astral: '\uD804[\uDE80-\uDEAF]' - }, { - name: 'InMusical_Symbols', - astral: '\uD834[\uDD00-\uDDFF]' - }, { - name: 'InMyanmar', - bmp: '\u1000-\u109F' - }, { - name: 'InMyanmar_Extended_A', - bmp: '\uAA60-\uAA7F' - }, { - name: 'InMyanmar_Extended_B', - bmp: '\uA9E0-\uA9FF' - }, { - name: 'InNKo', - bmp: '\u07C0-\u07FF' - }, { - name: 'InNabataean', - astral: '\uD802[\uDC80-\uDCAF]' - }, { - name: 'InNew_Tai_Lue', - bmp: '\u1980-\u19DF' - }, { - name: 'InNewa', - astral: '\uD805[\uDC00-\uDC7F]' - }, { - name: 'InNumber_Forms', - bmp: '\u2150-\u218F' - }, { - name: 'InOgham', - bmp: '\u1680-\u169F' - }, { - name: 'InOl_Chiki', - bmp: '\u1C50-\u1C7F' - }, { - name: 'InOld_Hungarian', - astral: '\uD803[\uDC80-\uDCFF]' - }, { - name: 'InOld_Italic', - astral: '\uD800[\uDF00-\uDF2F]' - }, { - name: 'InOld_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, { - name: 'InOld_Permic', - astral: '\uD800[\uDF50-\uDF7F]' - }, { - name: 'InOld_Persian', - astral: '\uD800[\uDFA0-\uDFDF]' - }, { - name: 'InOld_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, { - name: 'InOld_Turkic', - astral: '\uD803[\uDC00-\uDC4F]' - }, { - name: 'InOptical_Character_Recognition', - bmp: '\u2440-\u245F' - }, { - name: 'InOriya', - bmp: '\u0B00-\u0B7F' - }, { - name: 'InOrnamental_Dingbats', - astral: '\uD83D[\uDE50-\uDE7F]' - }, { - name: 'InOsage', - astral: '\uD801[\uDCB0-\uDCFF]' - }, { - name: 'InOsmanya', - astral: '\uD801[\uDC80-\uDCAF]' - }, { - name: 'InPahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF8F]' - }, { - name: 'InPalmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, { - name: 'InPau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEFF]' - }, { - name: 'InPhags_pa', - bmp: '\uA840-\uA87F' - }, { - name: 'InPhaistos_Disc', - astral: '\uD800[\uDDD0-\uDDFF]' - }, { - name: 'InPhoenician', - astral: '\uD802[\uDD00-\uDD1F]' - }, { - name: 'InPhonetic_Extensions', - bmp: '\u1D00-\u1D7F' - }, { - name: 'InPhonetic_Extensions_Supplement', - bmp: '\u1D80-\u1DBF' - }, { - name: 'InPlaying_Cards', - astral: '\uD83C[\uDCA0-\uDCFF]' - }, { - name: 'InPrivate_Use_Area', - bmp: '\uE000-\uF8FF' - }, { - name: 'InPsalter_Pahlavi', - astral: '\uD802[\uDF80-\uDFAF]' - }, { - name: 'InRejang', - bmp: '\uA930-\uA95F' - }, { - name: 'InRumi_Numeral_Symbols', - astral: '\uD803[\uDE60-\uDE7F]' - }, { - name: 'InRunic', - bmp: '\u16A0-\u16FF' - }, { - name: 'InSamaritan', - bmp: '\u0800-\u083F' - }, { - name: 'InSaurashtra', - bmp: '\uA880-\uA8DF' - }, { - name: 'InSharada', - astral: '\uD804[\uDD80-\uDDDF]' - }, { - name: 'InShavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, { - name: 'InShorthand_Format_Controls', - astral: '\uD82F[\uDCA0-\uDCAF]' - }, { - name: 'InSiddham', - astral: '\uD805[\uDD80-\uDDFF]' - }, { - name: 'InSinhala', - bmp: '\u0D80-\u0DFF' - }, { - name: 'InSinhala_Archaic_Numbers', - astral: '\uD804[\uDDE0-\uDDFF]' - }, { - name: 'InSmall_Form_Variants', - bmp: '\uFE50-\uFE6F' - }, { - name: 'InSora_Sompeng', - astral: '\uD804[\uDCD0-\uDCFF]' - }, { - name: 'InSpacing_Modifier_Letters', - bmp: '\u02B0-\u02FF' - }, { - name: 'InSpecials', - bmp: '\uFFF0-\uFFFF' - }, { - name: 'InSundanese', - bmp: '\u1B80-\u1BBF' - }, { - name: 'InSundanese_Supplement', - bmp: '\u1CC0-\u1CCF' - }, { - name: 'InSuperscripts_and_Subscripts', - bmp: '\u2070-\u209F' - }, { - name: 'InSupplemental_Arrows_A', - bmp: '\u27F0-\u27FF' - }, { - name: 'InSupplemental_Arrows_B', - bmp: '\u2900-\u297F' - }, { - name: 'InSupplemental_Arrows_C', - astral: '\uD83E[\uDC00-\uDCFF]' - }, { - name: 'InSupplemental_Mathematical_Operators', - bmp: '\u2A00-\u2AFF' - }, { - name: 'InSupplemental_Punctuation', - bmp: '\u2E00-\u2E7F' - }, { - name: 'InSupplemental_Symbols_and_Pictographs', - astral: '\uD83E[\uDD00-\uDDFF]' - }, { - name: 'InSupplementary_Private_Use_Area_A', - astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' - }, { - name: 'InSupplementary_Private_Use_Area_B', - astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' - }, { - name: 'InSutton_SignWriting', - astral: '\uD836[\uDC00-\uDEAF]' - }, { - name: 'InSyloti_Nagri', - bmp: '\uA800-\uA82F' - }, { - name: 'InSyriac', - bmp: '\u0700-\u074F' - }, { - name: 'InTagalog', - bmp: '\u1700-\u171F' - }, { - name: 'InTagbanwa', - bmp: '\u1760-\u177F' - }, { - name: 'InTags', - astral: '\uDB40[\uDC00-\uDC7F]' - }, { - name: 'InTai_Le', - bmp: '\u1950-\u197F' - }, { - name: 'InTai_Tham', - bmp: '\u1A20-\u1AAF' - }, { - name: 'InTai_Viet', - bmp: '\uAA80-\uAADF' - }, { - name: 'InTai_Xuan_Jing_Symbols', - astral: '\uD834[\uDF00-\uDF5F]' - }, { - name: 'InTakri', - astral: '\uD805[\uDE80-\uDECF]' - }, { - name: 'InTamil', - bmp: '\u0B80-\u0BFF' - }, { - name: 'InTangut', - astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' - }, { - name: 'InTangut_Components', - astral: '\uD822[\uDC00-\uDEFF]' - }, { - name: 'InTelugu', - bmp: '\u0C00-\u0C7F' - }, { - name: 'InThaana', - bmp: '\u0780-\u07BF' - }, { - name: 'InThai', - bmp: '\u0E00-\u0E7F' - }, { - name: 'InTibetan', - bmp: '\u0F00-\u0FFF' - }, { - name: 'InTifinagh', - bmp: '\u2D30-\u2D7F' - }, { - name: 'InTirhuta', - astral: '\uD805[\uDC80-\uDCDF]' - }, { - name: 'InTransport_and_Map_Symbols', - astral: '\uD83D[\uDE80-\uDEFF]' - }, { - name: 'InUgaritic', - astral: '\uD800[\uDF80-\uDF9F]' - }, { - name: 'InUnified_Canadian_Aboriginal_Syllabics', - bmp: '\u1400-\u167F' - }, { - name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', - bmp: '\u18B0-\u18FF' - }, { - name: 'InVai', - bmp: '\uA500-\uA63F' - }, { - name: 'InVariation_Selectors', - bmp: '\uFE00-\uFE0F' - }, { - name: 'InVariation_Selectors_Supplement', - astral: '\uDB40[\uDD00-\uDDEF]' - }, { - name: 'InVedic_Extensions', - bmp: '\u1CD0-\u1CFF' - }, { - name: 'InVertical_Forms', - bmp: '\uFE10-\uFE1F' - }, { - name: 'InWarang_Citi', - astral: '\uD806[\uDCA0-\uDCFF]' - }, { - name: 'InYi_Radicals', - bmp: '\uA490-\uA4CF' - }, { - name: 'InYi_Syllables', - bmp: '\uA000-\uA48F' - }, { - name: 'InYijing_Hexagram_Symbols', - bmp: '\u4DC0-\u4DFF' - }]); -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-categories.js b/scripts/node_modules/xregexp/lib/addons/unicode-categories.js deleted file mode 100644 index 2ab93179..00000000 --- a/scripts/node_modules/xregexp/lib/addons/unicode-categories.js +++ /dev/null @@ -1,204 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Categories 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See - * category descriptions in UAX #44 . Token - * names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); - } - - XRegExp.addUnicodeData([{ - name: 'C', - alias: 'Other', - isBmpLast: true, - bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' - }, { - name: 'Cc', - alias: 'Control', - bmp: '\0-\x1F\x7F-\x9F' - }, { - name: 'Cf', - alias: 'Format', - bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', - astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, { - name: 'Cn', - alias: 'Unassigned', - bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, { - name: 'Co', - alias: 'Private_Use', - bmp: '\uE000-\uF8FF', - astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' - }, { - name: 'Cs', - alias: 'Surrogate', - bmp: '\uD800-\uDFFF' - }, { - name: 'L', - alias: 'Letter', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Ll', - alias: 'Lowercase_Letter', - bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, { - name: 'Lm', - alias: 'Modifier_Letter', - bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', - astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' - }, { - name: 'Lo', - alias: 'Other_Letter', - bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Lt', - alias: 'Titlecase_Letter', - bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' - }, { - name: 'Lu', - alias: 'Uppercase_Letter', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' - }, { - name: 'M', - alias: 'Mark', - bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'Mc', - alias: 'Spacing_Mark', - bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', - astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' - }, { - name: 'Me', - alias: 'Enclosing_Mark', - bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' - }, { - name: 'Mn', - alias: 'Nonspacing_Mark', - bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'N', - alias: 'Number', - bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' - }, { - name: 'Nd', - alias: 'Decimal_Number', - bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' - }, { - name: 'Nl', - alias: 'Letter_Number', - bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', - astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' - }, { - name: 'No', - alias: 'Other_Number', - bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', - astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' - }, { - name: 'P', - alias: 'Punctuation', - bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, { - name: 'Pc', - alias: 'Connector_Punctuation', - bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' - }, { - name: 'Pd', - alias: 'Dash_Punctuation', - bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' - }, { - name: 'Pe', - alias: 'Close_Punctuation', - bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' - }, { - name: 'Pf', - alias: 'Final_Punctuation', - bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' - }, { - name: 'Pi', - alias: 'Initial_Punctuation', - bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' - }, { - name: 'Po', - alias: 'Other_Punctuation', - bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, { - name: 'Ps', - alias: 'Open_Punctuation', - bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' - }, { - name: 'S', - alias: 'Symbol', - bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, { - name: 'Sc', - alias: 'Currency_Symbol', - bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' - }, { - name: 'Sk', - alias: 'Modifier_Symbol', - bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', - astral: '\uD83C[\uDFFB-\uDFFF]' - }, { - name: 'Sm', - alias: 'Math_Symbol', - bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', - astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' - }, { - name: 'So', - alias: 'Other_Symbol', - bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, { - name: 'Z', - alias: 'Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - }, { - name: 'Zl', - alias: 'Line_Separator', - bmp: '\u2028' - }, { - name: 'Zp', - alias: 'Paragraph_Separator', - bmp: '\u2029' - }, { - name: 'Zs', - alias: 'Space_Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' - }]); -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-properties.js b/scripts/node_modules/xregexp/lib/addons/unicode-properties.js deleted file mode 100644 index 81d5a324..00000000 --- a/scripts/node_modules/xregexp/lib/addons/unicode-properties.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Properties 4.0.0 - * - * Steven Levithan (c) 2012-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See - * . Following are definitions of these properties from - * UAX #44 : - * - * - Alphabetic - * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + - * Lo + Nl + Other_Alphabetic. - * - * - Default_Ignorable_Code_Point - * For programmatic determination of default ignorable code points. New characters that should - * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, - * permitting programs to correctly handle the default rendering of such characters when not - * otherwise supported. - * - * - Lowercase - * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. - * - * - Noncharacter_Code_Point - * Code points permanently reserved for internal use. - * - * - Uppercase - * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. - * - * - White_Space - * Spaces, separator characters and other control characters which should be treated by - * programming languages as "white space" for the purpose of parsing elements. - * - * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS - * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are - * included in XRegExp's Unicode Categories and Unicode Scripts addons. - * - * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); - } - - var unicodeData = [{ - name: 'ASCII', - bmp: '\0-\x7F' - }, { - name: 'Alphabetic', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Any', - isBmpLast: true, - bmp: '\0-\uFFFF', - astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' - }, { - name: 'Default_Ignorable_Code_Point', - bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', - astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' - }, { - name: 'Lowercase', - bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, { - name: 'Noncharacter_Code_Point', - bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', - astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, { - name: 'Uppercase', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' - }, { - name: 'White_Space', - bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - }]; - - // Add non-generated data - unicodeData.push({ - name: 'Assigned', - // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode - // Categories addon is required to use this property - inverseOf: 'Cn' - }); - - XRegExp.addUnicodeData(unicodeData); -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js b/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js deleted file mode 100644 index f1a77838..00000000 --- a/scripts/node_modules/xregexp/lib/addons/unicode-scripts.js +++ /dev/null @@ -1,454 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Scripts 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, - * and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); - } - - XRegExp.addUnicodeData([{ - name: 'Adlam', - astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' - }, { - name: 'Ahom', - astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' - }, { - name: 'Anatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE46]' - }, { - name: 'Arabic', - bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', - astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' - }, { - name: 'Armenian', - bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' - }, { - name: 'Avestan', - astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' - }, { - name: 'Balinese', - bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' - }, { - name: 'Bamum', - bmp: '\uA6A0-\uA6F7', - astral: '\uD81A[\uDC00-\uDE38]' - }, { - name: 'Bassa_Vah', - astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' - }, { - name: 'Batak', - bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' - }, { - name: 'Bengali', - bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' - }, { - name: 'Bhaiksuki', - astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' - }, { - name: 'Bopomofo', - bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' - }, { - name: 'Brahmi', - astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' - }, { - name: 'Braille', - bmp: '\u2800-\u28FF' - }, { - name: 'Buginese', - bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' - }, { - name: 'Buhid', - bmp: '\u1740-\u1753' - }, { - name: 'Canadian_Aboriginal', - bmp: '\u1400-\u167F\u18B0-\u18F5' - }, { - name: 'Carian', - astral: '\uD800[\uDEA0-\uDED0]' - }, { - name: 'Caucasian_Albanian', - astral: '\uD801[\uDD30-\uDD63\uDD6F]' - }, { - name: 'Chakma', - astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' - }, { - name: 'Cham', - bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' - }, { - name: 'Cherokee', - bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' - }, { - name: 'Common', - bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', - astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, { - name: 'Coptic', - bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' - }, { - name: 'Cuneiform', - astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' - }, { - name: 'Cypriot', - astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' - }, { - name: 'Cyrillic', - bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' - }, { - name: 'Deseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, { - name: 'Devanagari', - bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' - }, { - name: 'Duployan', - astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' - }, { - name: 'Egyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' - }, { - name: 'Elbasan', - astral: '\uD801[\uDD00-\uDD27]' - }, { - name: 'Ethiopic', - bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' - }, { - name: 'Georgian', - bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' - }, { - name: 'Glagolitic', - bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', - astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' - }, { - name: 'Gothic', - astral: '\uD800[\uDF30-\uDF4A]' - }, { - name: 'Grantha', - astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' - }, { - name: 'Greek', - bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', - astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' - }, { - name: 'Gujarati', - bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' - }, { - name: 'Gurmukhi', - bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' - }, { - name: 'Han', - bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', - astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Hangul', - bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' - }, { - name: 'Hanunoo', - bmp: '\u1720-\u1734' - }, { - name: 'Hatran', - astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' - }, { - name: 'Hebrew', - bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' - }, { - name: 'Hiragana', - bmp: '\u3041-\u3096\u309D-\u309F', - astral: '\uD82C\uDC01|\uD83C\uDE00' - }, { - name: 'Imperial_Aramaic', - astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' - }, { - name: 'Inherited', - bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', - astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'Inscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' - }, { - name: 'Inscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' - }, { - name: 'Javanese', - bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' - }, { - name: 'Kaithi', - astral: '\uD804[\uDC80-\uDCC1]' - }, { - name: 'Kannada', - bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' - }, { - name: 'Katakana', - bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', - astral: '\uD82C\uDC00' - }, { - name: 'Kayah_Li', - bmp: '\uA900-\uA92D\uA92F' - }, { - name: 'Kharoshthi', - astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' - }, { - name: 'Khmer', - bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' - }, { - name: 'Khojki', - astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' - }, { - name: 'Khudawadi', - astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' - }, { - name: 'Lao', - bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' - }, { - name: 'Latin', - bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' - }, { - name: 'Lepcha', - bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' - }, { - name: 'Limbu', - bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' - }, { - name: 'Linear_A', - astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' - }, { - name: 'Linear_B', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' - }, { - name: 'Lisu', - bmp: '\uA4D0-\uA4FF' - }, { - name: 'Lycian', - astral: '\uD800[\uDE80-\uDE9C]' - }, { - name: 'Lydian', - astral: '\uD802[\uDD20-\uDD39\uDD3F]' - }, { - name: 'Mahajani', - astral: '\uD804[\uDD50-\uDD76]' - }, { - name: 'Malayalam', - bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' - }, { - name: 'Mandaic', - bmp: '\u0840-\u085B\u085E' - }, { - name: 'Manichaean', - astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' - }, { - name: 'Marchen', - astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' - }, { - name: 'Meetei_Mayek', - bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' - }, { - name: 'Mende_Kikakui', - astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' - }, { - name: 'Meroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' - }, { - name: 'Meroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, { - name: 'Miao', - astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' - }, { - name: 'Modi', - astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' - }, { - name: 'Mongolian', - bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', - astral: '\uD805[\uDE60-\uDE6C]' - }, { - name: 'Mro', - astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' - }, { - name: 'Multani', - astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' - }, { - name: 'Myanmar', - bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' - }, { - name: 'Nabataean', - astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' - }, { - name: 'New_Tai_Lue', - bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' - }, { - name: 'Newa', - astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' - }, { - name: 'Nko', - bmp: '\u07C0-\u07FA' - }, { - name: 'Ogham', - bmp: '\u1680-\u169C' - }, { - name: 'Ol_Chiki', - bmp: '\u1C50-\u1C7F' - }, { - name: 'Old_Hungarian', - astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' - }, { - name: 'Old_Italic', - astral: '\uD800[\uDF00-\uDF23]' - }, { - name: 'Old_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, { - name: 'Old_Permic', - astral: '\uD800[\uDF50-\uDF7A]' - }, { - name: 'Old_Persian', - astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' - }, { - name: 'Old_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, { - name: 'Old_Turkic', - astral: '\uD803[\uDC00-\uDC48]' - }, { - name: 'Oriya', - bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' - }, { - name: 'Osage', - astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' - }, { - name: 'Osmanya', - astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' - }, { - name: 'Pahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' - }, { - name: 'Palmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, { - name: 'Pau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEF8]' - }, { - name: 'Phags_Pa', - bmp: '\uA840-\uA877' - }, { - name: 'Phoenician', - astral: '\uD802[\uDD00-\uDD1B\uDD1F]' - }, { - name: 'Psalter_Pahlavi', - astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' - }, { - name: 'Rejang', - bmp: '\uA930-\uA953\uA95F' - }, { - name: 'Runic', - bmp: '\u16A0-\u16EA\u16EE-\u16F8' - }, { - name: 'Samaritan', - bmp: '\u0800-\u082D\u0830-\u083E' - }, { - name: 'Saurashtra', - bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' - }, { - name: 'Sharada', - astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' - }, { - name: 'Shavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, { - name: 'Siddham', - astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' - }, { - name: 'SignWriting', - astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' - }, { - name: 'Sinhala', - bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', - astral: '\uD804[\uDDE1-\uDDF4]' - }, { - name: 'Sora_Sompeng', - astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' - }, { - name: 'Sundanese', - bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' - }, { - name: 'Syloti_Nagri', - bmp: '\uA800-\uA82B' - }, { - name: 'Syriac', - bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' - }, { - name: 'Tagalog', - bmp: '\u1700-\u170C\u170E-\u1714' - }, { - name: 'Tagbanwa', - bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' - }, { - name: 'Tai_Le', - bmp: '\u1950-\u196D\u1970-\u1974' - }, { - name: 'Tai_Tham', - bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' - }, { - name: 'Tai_Viet', - bmp: '\uAA80-\uAAC2\uAADB-\uAADF' - }, { - name: 'Takri', - astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' - }, { - name: 'Tamil', - bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' - }, { - name: 'Tangut', - astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' - }, { - name: 'Telugu', - bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' - }, { - name: 'Thaana', - bmp: '\u0780-\u07B1' - }, { - name: 'Thai', - bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' - }, { - name: 'Tibetan', - bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' - }, { - name: 'Tifinagh', - bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' - }, { - name: 'Tirhuta', - astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' - }, { - name: 'Ugaritic', - astral: '\uD800[\uDF80-\uDF9D\uDF9F]' - }, { - name: 'Vai', - bmp: '\uA500-\uA62B' - }, { - name: 'Warang_Citi', - astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' - }, { - name: 'Yi', - bmp: '\uA000-\uA48C\uA490-\uA4C6' - }]); -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/index.js b/scripts/node_modules/xregexp/lib/index.js deleted file mode 100644 index 232b2f6d..00000000 --- a/scripts/node_modules/xregexp/lib/index.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _xregexp = require('./xregexp'); - -var _xregexp2 = _interopRequireDefault(_xregexp); - -var _build = require('./addons/build'); - -var _build2 = _interopRequireDefault(_build); - -var _matchrecursive = require('./addons/matchrecursive'); - -var _matchrecursive2 = _interopRequireDefault(_matchrecursive); - -var _unicodeBase = require('./addons/unicode-base'); - -var _unicodeBase2 = _interopRequireDefault(_unicodeBase); - -var _unicodeBlocks = require('./addons/unicode-blocks'); - -var _unicodeBlocks2 = _interopRequireDefault(_unicodeBlocks); - -var _unicodeCategories = require('./addons/unicode-categories'); - -var _unicodeCategories2 = _interopRequireDefault(_unicodeCategories); - -var _unicodeProperties = require('./addons/unicode-properties'); - -var _unicodeProperties2 = _interopRequireDefault(_unicodeProperties); - -var _unicodeScripts = require('./addons/unicode-scripts'); - -var _unicodeScripts2 = _interopRequireDefault(_unicodeScripts); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _build2.default)(_xregexp2.default); -(0, _matchrecursive2.default)(_xregexp2.default); -(0, _unicodeBase2.default)(_xregexp2.default); -(0, _unicodeBlocks2.default)(_xregexp2.default); -(0, _unicodeCategories2.default)(_xregexp2.default); -(0, _unicodeProperties2.default)(_xregexp2.default); -(0, _unicodeScripts2.default)(_xregexp2.default); - -exports.default = _xregexp2.default; -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/lib/xregexp.js b/scripts/node_modules/xregexp/lib/xregexp.js deleted file mode 100644 index 971b6bbc..00000000 --- a/scripts/node_modules/xregexp/lib/xregexp.js +++ /dev/null @@ -1,1792 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/*! - * XRegExp 4.0.0 - * - * Steven Levithan (c) 2007-2017 MIT License - */ - -/** - * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and - * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to - * make your client-side grepping simpler and more powerful, while freeing you from related - * cross-browser inconsistencies. - */ - -// ==--------------------------== -// Private stuff -// ==--------------------------== - -// Property name used for extended regex instance data -var REGEX_DATA = 'xregexp'; -// Optional features that can be installed and uninstalled -var features = { - astral: false -}; -// Native methods to use and restore ('native' is an ES3 reserved keyword) -var nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split -}; -// Storage for fixed/extended native methods -var fixed = {}; -// Storage for regexes cached by `XRegExp.cache` -var regexCache = {}; -// Storage for pattern details cached by the `XRegExp` constructor -var patternCache = {}; -// Storage for regex syntax tokens added internally or by `XRegExp.addToken` -var tokens = []; -// Token scopes -var defaultScope = 'default'; -var classScope = 'class'; -// Regexes that match native regex syntax, including octals -var nativeTokens = { - // Any native multicharacter token in default scope, or any single character - 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, - // Any native multicharacter token in character class scope, or any single character - 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ -}; -// Any backreference or dollar-prefixed character in replacement strings -var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; -// Check for correct `exec` handling of nonparticipating capturing groups -var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; -// Check for ES6 `flags` prop support -var hasFlagsProp = /x/.flags !== undefined; -// Shortcut to `Object.prototype.toString` -var toString = {}.toString; - -function hasNativeFlag(flag) { - // Can't check based on the presence of properties/getters since browsers might support such - // properties even when they don't support the corresponding flag in regex construction (tested - // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` - // throws an error) - var isSupported = true; - try { - // Can't use regex literals for testing even in a `try` because regex literals with - // unsupported flags cause a compilation error in IE - new RegExp('', flag); - } catch (exception) { - isSupported = false; - } - return isSupported; -} -// Check for ES6 `u` flag support -var hasNativeU = hasNativeFlag('u'); -// Check for ES6 `y` flag support -var hasNativeY = hasNativeFlag('y'); -// Tracker for known flags, including addon flags -var registeredFlags = { - g: true, - i: true, - m: true, - u: hasNativeU, - y: hasNativeY -}; - -/** - * Attaches extended data and `XRegExp.prototype` properties to a regex object. - * - * @private - * @param {RegExp} regex Regex to augment. - * @param {Array} captureNames Array with capture names, or `null`. - * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. - * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. - * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * @returns {RegExp} Augmented regex. - */ -function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { - var p = void 0; - - regex[REGEX_DATA] = { - captureNames: captureNames - }; - - if (isInternalOnly) { - return regex; - } - - // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value - if (regex.__proto__) { - regex.__proto__ = XRegExp.prototype; - } else { - for (p in XRegExp.prototype) { - // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this - // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` - // extensions exist on `regex.prototype` anyway - regex[p] = XRegExp.prototype[p]; - } - } - - regex[REGEX_DATA].source = xSource; - // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order - regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; - - return regex; -} - -/** - * Removes any duplicate characters from the provided string. - * - * @private - * @param {String} str String to remove duplicate characters from. - * @returns {String} String with any duplicate characters removed. - */ -function clipDuplicates(str) { - return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); -} - -/** - * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` - * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing - * flags g and y while copying the regex. - * - * @private - * @param {RegExp} regex Regex to copy. - * @param {Object} [options] Options object with optional properties: - * - `addG` {Boolean} Add flag g while copying the regex. - * - `addY` {Boolean} Add flag y while copying the regex. - * - `removeG` {Boolean} Remove flag g while copying the regex. - * - `removeY` {Boolean} Remove flag y while copying the regex. - * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * - `source` {String} Overrides `.source`, for special cases. - * @returns {RegExp} Copy of the provided regex, possibly with modified flags. - */ -function copyRegex(regex, options) { - if (!XRegExp.isRegExp(regex)) { - throw new TypeError('Type RegExp expected'); - } - - var xData = regex[REGEX_DATA] || {}; - var flags = getNativeFlags(regex); - var flagsToAdd = ''; - var flagsToRemove = ''; - var xregexpSource = null; - var xregexpFlags = null; - - options = options || {}; - - if (options.removeG) { - flagsToRemove += 'g'; - } - if (options.removeY) { - flagsToRemove += 'y'; - } - if (flagsToRemove) { - flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); - } - - if (options.addG) { - flagsToAdd += 'g'; - } - if (options.addY) { - flagsToAdd += 'y'; - } - if (flagsToAdd) { - flags = clipDuplicates(flags + flagsToAdd); - } - - if (!options.isInternalOnly) { - if (xData.source !== undefined) { - xregexpSource = xData.source; - } - // null or undefined; don't want to add to `flags` if the previous value was null, since - // that indicates we're not tracking original precompilation flags - if (xData.flags != null) { - // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never - // removed for non-internal regexes, so don't need to handle it - xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; - } - } - - // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid - // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and - // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the - // translation to native regex syntax - regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); - - return regex; -} - -/** - * Converts hexadecimal to decimal. - * - * @private - * @param {String} hex - * @returns {Number} - */ -function dec(hex) { - return parseInt(hex, 16); -} - -/** - * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an - * inline comment or whitespace with flag x. This is used directly as a token handler function - * passed to `XRegExp.addToken`. - * - * @private - * @param {String} match Match arg of `XRegExp.addToken` handler - * @param {String} scope Scope arg of `XRegExp.addToken` handler - * @param {String} flags Flags arg of `XRegExp.addToken` handler - * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. - */ -function getContextualTokenSeparator(match, scope, flags) { - if ( - // No need to separate tokens if at the beginning or end of a group - match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || - // Avoid separating tokens when the following token is a quantifier - isQuantifierNext(match.input, match.index + match[0].length, flags)) { - return ''; - } - // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. - // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax - // error `(? :` into `(?:`. - return '(?:)'; -} - -/** - * Returns native `RegExp` flags used by a regex object. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {String} Native flags in use. - */ -function getNativeFlags(regex) { - return hasFlagsProp ? regex.flags : - // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation - // with an empty string) allows this to continue working predictably when - // `XRegExp.proptotype.toString` is overridden - nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; -} - -/** - * Determines whether a regex has extended instance data used to track capture names. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {Boolean} Whether the regex uses named capture. - */ -function hasNamedCapture(regex) { - return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); -} - -/** - * Converts decimal to hexadecimal. - * - * @private - * @param {Number|String} dec - * @returns {String} - */ -function hex(dec) { - return parseInt(dec, 10).toString(16); -} - -/** - * Checks whether the next nonignorable token after the specified position is a quantifier. - * - * @private - * @param {String} pattern Pattern to search within. - * @param {Number} pos Index in `pattern` to search at. - * @param {String} flags Flags used by the pattern. - * @returns {Boolean} Whether the next nonignorable token is a quantifier. - */ -function isQuantifierNext(pattern, pos, flags) { - var inlineCommentPattern = '\\(\\?#[^)]*\\)'; - var lineCommentPattern = '#[^#\\n]*'; - var quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; - return nativ.test.call(flags.indexOf('x') !== -1 ? - // Ignore any leading whitespace, line comments, and inline comments - /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : - // Ignore any leading inline comments - /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); -} - -/** - * Determines whether a value is of the specified type, by resolving its internal [[Class]]. - * - * @private - * @param {*} value Object to check. - * @param {String} type Type to check for, in TitleCase. - * @returns {Boolean} Whether the object matches the type. - */ -function isType(value, type) { - return toString.call(value) === '[object ' + type + ']'; -} - -/** - * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. - * - * @private - * @param {String} str - * @returns {String} - */ -function pad4(str) { - while (str.length < 4) { - str = '0' + str; - } - return str; -} - -/** - * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads - * the flag preparation logic from the `XRegExp` constructor. - * - * @private - * @param {String} pattern Regex pattern, possibly with a leading mode modifier. - * @param {String} flags Any combination of flags. - * @returns {Object} Object with properties `pattern` and `flags`. - */ -function prepareFlags(pattern, flags) { - var i = void 0; - - // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags - if (clipDuplicates(flags) !== flags) { - throw new SyntaxError('Invalid duplicate regex flag ' + flags); - } - - // Strip and apply a leading mode modifier with any combination of flags except g or y - pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { - if (nativ.test.call(/[gy]/, $1)) { - throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); - } - // Allow duplicate flags within the mode modifier - flags = clipDuplicates(flags + $1); - return ''; - }); - - // Throw on unknown native or nonnative flags - for (i = 0; i < flags.length; ++i) { - if (!registeredFlags[flags[i]]) { - throw new SyntaxError('Unknown regex flag ' + flags[i]); - } - } - - return { - pattern: pattern, - flags: flags - }; -} - -/** - * Prepares an options object from the given value. - * - * @private - * @param {String|Object} value Value to convert to an options object. - * @returns {Object} Options object. - */ -function prepareOptions(value) { - var options = {}; - - if (isType(value, 'String')) { - XRegExp.forEach(value, /[^\s,]+/, function (match) { - options[match] = true; - }); - - return options; - } - - return value; -} - -/** - * Registers a flag so it doesn't throw an 'unknown flag' error. - * - * @private - * @param {String} flag Single-character flag to register. - */ -function registerFlag(flag) { - if (!/^[\w$]$/.test(flag)) { - throw new Error('Flag must be a single character A-Za-z0-9_$'); - } - - registeredFlags[flag] = true; -} - -/** - * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified - * position, until a match is found. - * - * @private - * @param {String} pattern Original pattern from which an XRegExp object is being built. - * @param {String} flags Flags being used to construct the regex. - * @param {Number} pos Position to search for tokens within `pattern`. - * @param {Number} scope Regex scope to apply: 'default' or 'class'. - * @param {Object} context Context object to use for token handler functions. - * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. - */ -function runTokens(pattern, flags, pos, scope, context) { - var i = tokens.length; - var leadChar = pattern[pos]; - var result = null; - var match = void 0; - var t = void 0; - - // Run in reverse insertion order - while (i--) { - t = tokens[i]; - if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { - continue; - } - - match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); - if (match) { - result = { - matchLength: match[0].length, - output: t.handler.call(context, match, scope, flags), - reparse: t.reparse - }; - // Finished with token tests - break; - } - } - - return result; -} - -/** - * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to - * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if - * the Unicode Base addon is not available, since flag A is registered by that addon. - * - * @private - * @param {Boolean} on `true` to enable; `false` to disable. - */ -function setAstral(on) { - features.astral = on; -} - -/** - * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow - * the ES5 abstract operation `ToObject`. - * - * @private - * @param {*} value Object to check and return. - * @returns {*} The provided object. - */ -function toObject(value) { - // null or undefined - if (value == null) { - throw new TypeError('Cannot convert null or undefined to object'); - } - - return value; -} - -// ==--------------------------== -// Constructor -// ==--------------------------== - -/** - * Creates an extended regular expression object for matching text with a pattern. Differs from a - * native regular expression in that additional syntax and flags are supported. The returned object - * is in fact a native `RegExp` and works with all native methods. - * - * @class XRegExp - * @constructor - * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. - * @param {String} [flags] Any combination of flags. - * Native flags: - * - `g` - global - * - `i` - ignore case - * - `m` - multiline anchors - * - `u` - unicode (ES6) - * - `y` - sticky (Firefox 3+, ES6) - * Additional XRegExp flags: - * - `n` - explicit capture - * - `s` - dot matches all (aka singleline) - * - `x` - free-spacing and line comments (aka extended) - * - `A` - astral (requires the Unicode Base addon) - * Flags cannot be provided when constructing one `RegExp` from another. - * @returns {RegExp} Extended regular expression object. - * @example - * - * // With named capture and flag x - * XRegExp(`(? [0-9]{4} ) -? # year - * (? [0-9]{2} ) -? # month - * (? [0-9]{2} ) # day`, 'x'); - * - * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) - * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and - * // have fresh `lastIndex` properties (set to zero). - * XRegExp(/regex/); - */ -function XRegExp(pattern, flags) { - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) { - throw new TypeError('Cannot supply flags when copying a RegExp'); - } - return copyRegex(pattern); - } - - // Copy the argument behavior of `RegExp` - pattern = pattern === undefined ? '' : String(pattern); - flags = flags === undefined ? '' : String(flags); - - if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { - // This causes an error to be thrown if the Unicode Base addon is not available - flags += 'A'; - } - - if (!patternCache[pattern]) { - patternCache[pattern] = {}; - } - - if (!patternCache[pattern][flags]) { - var context = { - hasNamedCapture: false, - captureNames: [] - }; - var scope = defaultScope; - var output = ''; - var pos = 0; - var result = void 0; - - // Check for flag-related errors, and strip/apply flags in a leading mode modifier - var applied = prepareFlags(pattern, flags); - var appliedPattern = applied.pattern; - var appliedFlags = applied.flags; - - // Use XRegExp's tokens to translate the pattern to a native regex pattern. - // `appliedPattern.length` may change on each iteration if tokens use `reparse` - while (pos < appliedPattern.length) { - do { - // Check for custom tokens at the current position - result = runTokens(appliedPattern, appliedFlags, pos, scope, context); - // If the matched token used the `reparse` option, splice its output into the - // pattern before running tokens again at the same position - if (result && result.reparse) { - appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); - } - } while (result && result.reparse); - - if (result) { - output += result.output; - pos += result.matchLength || 1; - } else { - // Get the native token at the current position - var token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; - output += token; - pos += token.length; - if (token === '[' && scope === defaultScope) { - scope = classScope; - } else if (token === ']' && scope === classScope) { - scope = defaultScope; - } - } - } - - patternCache[pattern][flags] = { - // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty - // groups are sometimes inserted during regex transpilation in order to keep tokens - // separated. However, more than one empty group in a row is never needed. - pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), - // Strip all but native flags - flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), - // `context.captureNames` has an item for each capturing group, even if unnamed - captures: context.hasNamedCapture ? context.captureNames : null - }; - } - - var generated = patternCache[pattern][flags]; - return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); -} - -// Add `RegExp.prototype` to the prototype chain -XRegExp.prototype = /(?:)/; - -// ==--------------------------== -// Public properties -// ==--------------------------== - -/** - * The XRegExp version number as a string containing three dot-separated parts. For example, - * '2.0.0-beta-3'. - * - * @static - * @memberOf XRegExp - * @type String - */ -XRegExp.version = '4.0.0'; - -// ==--------------------------== -// Public methods -// ==--------------------------== - -// Intentionally undocumented; used in tests and addons -XRegExp._clipDuplicates = clipDuplicates; -XRegExp._hasNativeFlag = hasNativeFlag; -XRegExp._dec = dec; -XRegExp._hex = hex; -XRegExp._pad4 = pad4; - -/** - * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to - * create XRegExp addons. If more than one token can match the same string, the last added wins. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex object that matches the new token. - * @param {Function} handler Function that returns a new pattern string (using native regex syntax) - * to replace the matched token within all future XRegExp regexes. Has access to persistent - * properties of the regex being built, through `this`. Invoked with three arguments: - * - The match array, with named backreference properties. - * - The regex scope where the match was found: 'default' or 'class'. - * - The flags used by the regex, including any flags in a leading mode modifier. - * The handler function becomes part of the XRegExp construction process, so be careful not to - * construct XRegExps within the function or you will trigger infinite recursion. - * @param {Object} [options] Options object with optional properties: - * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. - * - `flag` {String} Single-character flag that triggers the token. This also registers the - * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. - * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are - * not required to trigger the token. This registers the flags, to prevent XRegExp from - * throwing an 'unknown flag' error when any of the flags are used. - * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as - * final, and instead be reparseable by other tokens (including the current token). Allows - * token chaining or deferring. - * - `leadChar` {String} Single character that occurs at the beginning of any successful match - * of the token (not always applicable). This doesn't change the behavior of the token unless - * you provide an erroneous value. However, providing it can increase the token's performance - * since the token can be skipped at any positions where this character doesn't appear. - * @example - * - * // Basic usage: Add \a for the ALERT control code - * XRegExp.addToken( - * /\\a/, - * () => '\\x07', - * {scope: 'all'} - * ); - * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true - * - * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. - * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of - * // character classes only) - * XRegExp.addToken( - * /([?*+]|{\d+(?:,\d*)?})(\??)/, - * (match) => `${match[1]}${match[2] ? '' : '?'}`, - * {flag: 'U'} - * ); - * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' - * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' - */ -XRegExp.addToken = function (regex, handler, options) { - options = options || {}; - var optionalFlags = options.optionalFlags; - var i = void 0; - - if (options.flag) { - registerFlag(options.flag); - } - - if (optionalFlags) { - optionalFlags = nativ.split.call(optionalFlags, ''); - for (i = 0; i < optionalFlags.length; ++i) { - registerFlag(optionalFlags[i]); - } - } - - // Add to the private list of syntax tokens - tokens.push({ - regex: copyRegex(regex, { - addG: true, - addY: hasNativeY, - isInternalOnly: true - }), - handler: handler, - scope: options.scope || defaultScope, - flag: options.flag, - reparse: options.reparse, - leadChar: options.leadChar - }); - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags - // might now produce different results - XRegExp.cache.flush('patterns'); -}; - -/** - * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with - * the same pattern and flag combination, the cached copy of the regex is returned. - * - * @memberOf XRegExp - * @param {String} pattern Regex pattern string. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Cached XRegExp object. - * @example - * - * while (match = XRegExp.cache('.', 'gs').exec(str)) { - * // The regex is compiled once only - * } - */ -XRegExp.cache = function (pattern, flags) { - if (!regexCache[pattern]) { - regexCache[pattern] = {}; - } - return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); -}; - -// Intentionally undocumented; used in tests -XRegExp.cache.flush = function (cacheName) { - if (cacheName === 'patterns') { - // Flush the pattern cache used by the `XRegExp` constructor - patternCache = {}; - } else { - // Flush the regex cache populated by `XRegExp.cache` - regexCache = {}; - } -}; - -/** - * Escapes any regular expression metacharacters, for use when matching literal strings. The result - * can safely be used at any point within a regex that uses any flags. - * - * @memberOf XRegExp - * @param {String} str String to escape. - * @returns {String} String with regex metacharacters escaped. - * @example - * - * XRegExp.escape('Escaped? <.>'); - * // -> 'Escaped\?\ <\.>' - */ -XRegExp.escape = function (str) { - return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -}; - -/** - * Executes a regex search in a specified string. Returns a match array or `null`. If the provided - * regex uses named capture, named backreference properties are included on the match array. - * Optional `pos` and `sticky` arguments specify the search start position, and whether the match - * must start at the specified position only. The `lastIndex` property of the provided regex is not - * used, but is updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.exec` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Array} Match array with named backreference properties, or `null`. - * @example - * - * // Basic use, with named backreference - * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); - * match.hex; // -> '2620' - * - * // With pos and sticky, in a loop - * let pos = 2, result = [], match; - * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { - * result.push(match[1]); - * pos = match.index + match[0].length; - * } - * // result -> ['2', '3', '4'] - */ -XRegExp.exec = function (str, regex, pos, sticky) { - var cacheKey = 'g'; - var addY = false; - var fakeY = false; - var match = void 0; - - addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); - if (addY) { - cacheKey += 'y'; - } else if (sticky) { - // Simulate sticky matching by appending an empty capture to the original regex. The - // resulting regex will succeed no matter what at the current index (set with `lastIndex`), - // and will not search the rest of the subject string. We'll know that the original regex - // has failed if that last capture is `''` rather than `undefined` (i.e., if that last - // capture participated in the match). - fakeY = true; - cacheKey += 'FakeY'; - } - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.match`/`replace` - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: true, - addY: addY, - source: fakeY ? regex.source + '|()' : undefined, - removeY: sticky === false, - isInternalOnly: true - })); - - pos = pos || 0; - r2.lastIndex = pos; - - // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. - match = fixed.exec.call(r2, str); - - // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means - // the original regexp failed (see above). - if (fakeY && match && match.pop() === '') { - match = null; - } - - if (regex.global) { - regex.lastIndex = match ? r2.lastIndex : 0; - } - - return match; -}; - -/** - * Executes a provided function once per regex match. Searches always start at the beginning of the - * string and continue until the end, regardless of the state of the regex's `global` property and - * initial `lastIndex`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Function} callback Function to execute for each match. Invoked with four arguments: - * - The match array, with named backreference properties. - * - The zero-based match index. - * - The string being traversed. - * - The regex object being used to traverse the string. - * @example - * - * // Extracts every other digit from a string - * const evens = []; - * XRegExp.forEach('1a2345', /\d/, (match, i) => { - * if (i % 2) evens.push(+match[0]); - * }); - * // evens -> [2, 4] - */ -XRegExp.forEach = function (str, regex, callback) { - var pos = 0; - var i = -1; - var match = void 0; - - while (match = XRegExp.exec(str, regex, pos)) { - // Because `regex` is provided to `callback`, the function could use the deprecated/ - // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` - // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, - // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of - // regexes, mutating the regex will not have any effect on the iteration or matched strings, - // which is a nice side effect that brings extra safety. - callback(match, ++i, str, regex); - - pos = match.index + (match[0].length || 1); - } -}; - -/** - * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with - * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native - * regexes are not recompiled using XRegExp syntax. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex to globalize. - * @returns {RegExp} Copy of the provided regex with flag `g` added. - * @example - * - * const globalCopy = XRegExp.globalize(/regex/); - * globalCopy.global; // -> true - */ -XRegExp.globalize = function (regex) { - return copyRegex(regex, { addG: true }); -}; - -/** - * Installs optional features according to the specified options. Can be undone using - * `XRegExp.uninstall`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.install({ - * // Enables support for astral code points in Unicode addons (implicitly sets flag A) - * astral: true - * }); - * - * // With an options string - * XRegExp.install('astral'); - */ -XRegExp.install = function (options) { - options = prepareOptions(options); - - if (!features.astral && options.astral) { - setAstral(true); - } -}; - -/** - * Checks whether an individual optional feature is installed. - * - * @memberOf XRegExp - * @param {String} feature Name of the feature to check. One of: - * - `astral` - * @returns {Boolean} Whether the feature is installed. - * @example - * - * XRegExp.isInstalled('astral'); - */ -XRegExp.isInstalled = function (feature) { - return !!features[feature]; -}; - -/** - * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes - * created in another frame, when `instanceof` and `constructor` checks would fail. - * - * @memberOf XRegExp - * @param {*} value Object to check. - * @returns {Boolean} Whether the object is a `RegExp` object. - * @example - * - * XRegExp.isRegExp('string'); // -> false - * XRegExp.isRegExp(/regex/i); // -> true - * XRegExp.isRegExp(RegExp('^', 'm')); // -> true - * XRegExp.isRegExp(XRegExp('(?s).')); // -> true - */ -XRegExp.isRegExp = function (value) { - return toString.call(value) === '[object RegExp]'; -}; // isType(value, 'RegExp'); - -/** - * Returns the first matched string, or in global mode, an array containing all matched strings. - * This is essentially a more convenient re-implementation of `String.prototype.match` that gives - * the result types you actually want (string instead of `exec`-style array in match-first mode, - * and an empty array instead of `null` when no matches are found in match-all mode). It also lets - * you override flag g and ignore `lastIndex`, and fixes browser bugs. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to - * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, - * `scope` is 'all'. - * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all - * mode: Array of all matched strings, or an empty array. - * @example - * - * // Match first - * XRegExp.match('abc', /\w/); // -> 'a' - * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' - * XRegExp.match('abc', /x/g, 'one'); // -> null - * - * // Match all - * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /x/, 'all'); // -> [] - */ -XRegExp.match = function (str, regex, scope) { - var global = regex.global && scope !== 'one' || scope === 'all'; - var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`replace` - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - })); - - var result = nativ.match.call(toObject(str), r2); - - if (regex.global) { - regex.lastIndex = scope === 'one' && result ? - // Can't use `r2.lastIndex` since `r2` is nonglobal in this case - result.index + result[0].length : 0; - } - - return global ? result || [] : result && result[0]; -}; - -/** - * Retrieves the matches from searching a string using a chain of regexes that successively search - * within previous matches. The provided `chain` array can contain regexes and or objects with - * `regex` and `backref` properties. When a backreference is specified, the named or numbered - * backreference is passed forward to the next regex or returned. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} chain Regexes that each search for matches within preceding results. - * @returns {Array} Matches by the last regex in the chain, or an empty array. - * @example - * - * // Basic usage; matches numbers within tags - * XRegExp.matchChain('1 2 3 4 a 56', [ - * XRegExp('(?is).*?'), - * /\d+/ - * ]); - * // -> ['2', '4', '56'] - * - * // Passing forward and returning specific backreferences - * html = '
XRegExp\ - * Google'; - * XRegExp.matchChain(html, [ - * {regex: //i, backref: 1}, - * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} - * ]); - * // -> ['xregexp.com', 'www.google.com'] - */ -XRegExp.matchChain = function (str, chain) { - return function recurseChain(values, level) { - var item = chain[level].regex ? chain[level] : { regex: chain[level] }; - var matches = []; - - function addMatch(match) { - if (item.backref) { - // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the - // `undefined`s for backreferences to nonparticipating capturing groups. In such - // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw - // the exception, so also check if the backreference is a number that is within the - // bounds of the array. - if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { - throw new ReferenceError('Backreference to undefined group: ' + item.backref); - } - - matches.push(match[item.backref] || ''); - } else { - matches.push(match[0]); - } - } - - for (var i = 0; i < values.length; ++i) { - XRegExp.forEach(values[i], item.regex, addMatch); - } - - return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); - }([str], 0); -}; - -/** - * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string - * or regex, and the replacement can be a string or a function to be called for each match. To - * perform a global search and replace, use the optional `scope` argument or include flag g if using - * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. - * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser - * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * Replacement strings can include special replacement syntax: - * - $$ - Inserts a literal $ character. - * - $&, $0 - Inserts the matched substring. - * - $` - Inserts the string that precedes the matched substring (left context). - * - $' - Inserts the string that follows the matched substring (right context). - * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts - * backreference n/nn. - * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing - * group, inserts backreference n. - * Replacement functions are invoked with three or more arguments: - * - The matched substring (corresponds to $& above). Named backreferences are accessible as - * properties of this first argument. - * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). - * - The zero-based index of the match within the total search string. - * - The total string being searched. - * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not - * explicitly specified and using a regex with flag g, `scope` is 'all'. - * @returns {String} New string with one or all matches replaced. - * @example - * - * // Regex search, using named backreferences in replacement string - * const name = XRegExp('(?\\w+) (?\\w+)'); - * XRegExp.replace('John Smith', name, '$, $'); - * // -> 'Smith, John' - * - * // Regex search, using named backreferences in replacement function - * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); - * // -> 'Smith, John' - * - * // String search, with replace-all - * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); - * // -> 'XRegExp builds XRegExps' - */ -XRegExp.replace = function (str, search, replacement, scope) { - var isRegex = XRegExp.isRegExp(search); - var global = search.global && scope !== 'one' || scope === 'all'; - var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; - var s2 = search; - - if (isRegex) { - search[REGEX_DATA] = search[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s - // `lastIndex` isn't updated *during* replacement iterations - s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - })); - } else if (global) { - s2 = new RegExp(XRegExp.escape(String(search)), 'g'); - } - - // Fixed `replace` required for named backreferences, etc. - var result = fixed.replace.call(toObject(str), s2, replacement); - - if (isRegex && search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } - - return result; -}; - -/** - * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an - * array of replacement details. Later replacements operate on the output of earlier replacements. - * Replacement details are accepted as an array with a regex or string to search for, the - * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp - * replacement text syntax, which supports named backreference properties via `${name}` or - * `$`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} replacements Array of replacement detail arrays. - * @returns {String} New string with all replacements. - * @example - * - * str = XRegExp.replaceEach(str, [ - * [XRegExp('(?a)'), 'z${name}'], - * [/b/gi, 'y'], - * [/c/g, 'x', 'one'], // scope 'one' overrides /g - * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g - * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings - * [/f/g, ($0) => $0.toUpperCase()] - * ]); - */ -XRegExp.replaceEach = function (str, replacements) { - var i = void 0; - var r = void 0; - - for (i = 0; i < replacements.length; ++i) { - r = replacements[i]; - str = XRegExp.replace(str, r[0], r[1], r[2]); - } - - return str; -}; - -/** - * Splits a string into an array of strings using a regex or string separator. Matches of the - * separator are not included in the result array. However, if `separator` is a regex that contains - * capturing groups, backreferences are spliced into the result each time `separator` is matched. - * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably - * cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to split. - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - * @example - * - * // Basic use - * XRegExp.split('a b c', ' '); - * // -> ['a', 'b', 'c'] - * - * // With limit - * XRegExp.split('a b c', ' ', 2); - * // -> ['a', 'b'] - * - * // Backreferences in result array - * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); - * // -> ['..', 'word', '1', '..'] - */ -XRegExp.split = function (str, separator, limit) { - return fixed.split.call(toObject(str), separator, limit); -}; - -/** - * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and - * `sticky` arguments specify the search start position, and whether the match must start at the - * specified position only. The `lastIndex` property of the provided regex is not used, but is - * updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.test` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Boolean} Whether the regex matched the provided value. - * @example - * - * // Basic use - * XRegExp.test('abc', /c/); // -> true - * - * // With pos and sticky - * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false - * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true - */ -// Do this the easy way :-) -XRegExp.test = function (str, regex, pos, sticky) { - return !!XRegExp.exec(str, regex, pos, sticky); -}; - -/** - * Uninstalls optional features according to the specified options. All optional features start out - * uninstalled, so this is used to undo the actions of `XRegExp.install`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.uninstall({ - * // Disables support for astral code points in Unicode addons - * astral: true - * }); - * - * // With an options string - * XRegExp.uninstall('astral'); - */ -XRegExp.uninstall = function (options) { - options = prepareOptions(options); - - if (features.astral && options.astral) { - setAstral(false); - } -}; - -/** - * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as - * regex objects or strings. Metacharacters are escaped in patterns provided as strings. - * Backreferences in provided regex objects are automatically renumbered to work correctly within - * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the - * `flags` argument. - * - * @memberOf XRegExp - * @param {Array} patterns Regexes and strings to combine. - * @param {String} [flags] Any combination of XRegExp flags. - * @param {Object} [options] Options object with optional properties: - * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. - * @returns {RegExp} Union of the provided regexes and strings. - * @example - * - * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); - * // -> /a\+b\*c|(dogs)\1|(cats)\2/i - * - * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); - * // -> /manbearpig/i - */ -XRegExp.union = function (patterns, flags, options) { - options = options || {}; - var conjunction = options.conjunction || 'or'; - var numCaptures = 0; - var numPriorCaptures = void 0; - var captureNames = void 0; - - function rewrite(match, paren, backref) { - var name = captureNames[numCaptures - numPriorCaptures]; - - // Capturing group - if (paren) { - ++numCaptures; - // If the current capture has a name, preserve the name - if (name) { - return '(?<' + name + '>'; - } - // Backreference - } else if (backref) { - // Rewrite the backreference - return '\\' + (+backref + numPriorCaptures); - } - - return match; - } - - if (!(isType(patterns, 'Array') && patterns.length)) { - throw new TypeError('Must provide a nonempty array of patterns to merge'); - } - - var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var output = []; - var pattern = void 0; - for (var i = 0; i < patterns.length; ++i) { - pattern = patterns[i]; - - if (XRegExp.isRegExp(pattern)) { - numPriorCaptures = numCaptures; - captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; - - // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are - // independently valid; helps keep this simple. Named captures are put back - output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); - } else { - output.push(XRegExp.escape(pattern)); - } - } - - var separator = conjunction === 'none' ? '' : '|'; - return XRegExp(output.join(separator), flags); -}; - -// ==--------------------------== -// Fixed/extended native methods -// ==--------------------------== - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Array} Match array with named backreference properties, or `null`. - */ -fixed.exec = function (str) { - var origLastIndex = this.lastIndex; - var match = nativ.exec.apply(this, arguments); - - if (match) { - // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing - // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 - // in standards mode follows the spec. - if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { - var r2 = copyRegex(this, { - removeG: true, - isInternalOnly: true - }); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call(String(str).slice(match.index), r2, function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var len = args.length; - // Skip index 0 and the last 2 - for (var i = 1; i < len - 2; ++i) { - if (args[i] === undefined) { - match[i] = undefined; - } - } - }); - } - - // Attach named capture properties - if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { - // Skip index 0 - for (var i = 1; i < match.length; ++i) { - var name = this[REGEX_DATA].captureNames[i - 1]; - if (name) { - match[name] = match[i]; - } - } - } - - // Fix browsers that increment `lastIndex` after zero-length matches - if (this.global && !match[0].length && this.lastIndex > match.index) { - this.lastIndex = match.index; - } - } - - if (!this.global) { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - this.lastIndex = origLastIndex; - } - - return match; -}; - -/** - * Fixes browser bugs in the native `RegExp.prototype.test`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Boolean} Whether the regex matched the provided value. - */ -fixed.test = function (str) { - // Do this the easy way :-) - return !!fixed.exec.call(this, str); -}; - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `String.prototype.match`. - * - * @memberOf String - * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. - * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, - * the result of calling `regex.exec(this)`. - */ -fixed.match = function (regex) { - if (!XRegExp.isRegExp(regex)) { - // Use the native `RegExp` rather than `XRegExp` - regex = new RegExp(regex); - } else if (regex.global) { - var result = nativ.match.apply(this, arguments); - // Fixes IE bug - regex.lastIndex = 0; - - return result; - } - - return fixed.exec.call(regex, toObject(this)); -}; - -/** - * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement - * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also - * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex - * search value, and the value of a replacement regex's `lastIndex` property during replacement - * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third - * (`flags`) argument. Use via `XRegExp.replace`. - * - * @memberOf String - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * @returns {String} New string with one or all matches replaced. - */ -fixed.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search); - var origLastIndex = void 0; - var captureNames = void 0; - var result = void 0; - - if (isRegex) { - if (search[REGEX_DATA]) { - captureNames = search[REGEX_DATA].captureNames; - } - // Only needed if `search` is nonglobal - origLastIndex = search.lastIndex; - } else { - search += ''; // Type-convert - } - - // Don't use `typeof`; some older browsers return 'function' for regex objects - if (isType(replacement, 'Function')) { - // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement - // functions isn't type-converted to a string - result = nativ.replace.call(String(this), search, function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (captureNames) { - // Change the `args[0]` string primitive to a `String` object that can store - // properties. This really does need to use `String` as a constructor - args[0] = new String(args[0]); - // Store named backreferences on the first argument - for (var i = 0; i < captureNames.length; ++i) { - if (captureNames[i]) { - args[0][captureNames[i]] = args[i + 1]; - } - } - } - // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari - // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) - if (isRegex && search.global) { - search.lastIndex = args[args.length - 2] + args[0].length; - } - // ES6 specs the context for replacement functions as `undefined` - return replacement.apply(undefined, args); - }); - } else { - // Ensure that the last value of `args` will be a string when given nonstring `this`, - // while still throwing on null or undefined context - result = nativ.replace.call(this == null ? this : String(this), search, function () { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - return nativ.replace.call(String(replacement), replacementToken, replacer); - - function replacer($0, bracketed, angled, dollarToken) { - bracketed = bracketed || angled; - // Named or numbered backreference with curly or angled braces - if (bracketed) { - // XRegExp behavior for `${n}` or `$`: - // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the - // entire match. Any number of leading zeros may be used. - // 2. Backreference to named capture `n`, if it exists and is not an integer - // overridden by numbered capture. In practice, this does not overlap with - // numbered capture since XRegExp does not allow named capture to use a bare - // integer as the name. - // 3. If the name or number does not refer to an existing capturing group, it's - // an error. - var n = +bracketed; // Type-convert; drop leading zeros - if (n <= args.length - 3) { - return args[n] || ''; - } - // Groups with the same name is an error, else would need `lastIndexOf` - n = captureNames ? captureNames.indexOf(bracketed) : -1; - if (n < 0) { - throw new SyntaxError('Backreference to undefined group ' + $0); - } - return args[n + 1] || ''; - } - // Else, special variable or numbered backreference without curly braces - if (dollarToken === '$') { - // $$ - return '$'; - } - if (dollarToken === '&' || +dollarToken === 0) { - // $&, $0 (not followed by 1-9), $00 - return args[0]; - } - if (dollarToken === '`') { - // $` (left context) - return args[args.length - 1].slice(0, args[args.length - 2]); - } - if (dollarToken === "'") { - // $' (right context) - return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - } - // Else, numbered backreference without braces - dollarToken = +dollarToken; // Type-convert; drop leading zero - // XRegExp behavior for `$n` and `$nn`: - // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. - // - `$1` is an error if no capturing groups. - // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` - // instead. - // - `$01` is `$1` if at least one capturing group, else it's an error. - // - `$0` (not followed by 1-9) and `$00` are the entire match. - // Native behavior, for comparison: - // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. - // - `$1` is a literal `$1` if no capturing groups. - // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. - // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. - // - `$0` is a literal `$0`. - if (!isNaN(dollarToken)) { - if (dollarToken > args.length - 3) { - throw new SyntaxError('Backreference to undefined group ' + $0); - } - return args[dollarToken] || ''; - } - // `$` followed by an unsupported char is an error, unlike native JS - throw new SyntaxError('Invalid token ' + $0); - } - }); - } - - if (isRegex) { - if (search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } else { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - search.lastIndex = origLastIndex; - } - } - - return result; -}; - -/** - * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. - * - * @memberOf String - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - */ -fixed.split = function (separator, limit) { - if (!XRegExp.isRegExp(separator)) { - // Browsers handle nonregex split correctly, so use the faster native method - return nativ.split.apply(this, arguments); - } - - var str = String(this); - var output = []; - var origLastIndex = separator.lastIndex; - var lastLastIndex = 0; - var lastLength = void 0; - - // Values for `limit`, per the spec: - // If undefined: pow(2,32) - 1 - // If 0, Infinity, or NaN: 0 - // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); - // If negative number: pow(2,32) - floor(abs(limit)) - // If other: Type-convert, then use the above rules - // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless - // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ - limit = (limit === undefined ? -1 : limit) >>> 0; - - XRegExp.forEach(str, separator, function (match) { - // This condition is not the same as `if (match[0].length)` - if (match.index + match[0].length > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < str.length) { - Array.prototype.push.apply(output, match.slice(1)); - } - lastLength = match[0].length; - lastLastIndex = match.index + lastLength; - } - }); - - if (lastLastIndex === str.length) { - if (!nativ.test.call(separator, '') || lastLength) { - output.push(''); - } - } else { - output.push(str.slice(lastLastIndex)); - } - - separator.lastIndex = origLastIndex; - return output.length > limit ? output.slice(0, limit) : output; -}; - -// ==--------------------------== -// Built-in syntax/flag tokens -// ==--------------------------== - -/* - * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be - * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser - * consistency and to reserve their syntax, but lets them be superseded by addons. - */ -XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { - // \B is allowed in default scope only - if (match[1] === 'B' && scope === defaultScope) { - return match[0]; - } - throw new SyntaxError('Invalid escape ' + match[0]); -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit - * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag - * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to - * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior - * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or - * if you use the same in a character class. - */ -XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { - var code = dec(match[1]); - if (code > 0x10FFFF) { - throw new SyntaxError('Invalid Unicode code point ' + match[0]); - } - if (code <= 0xFFFF) { - // Converting to \uNNNN avoids needing to escape the literal character and keep it - // separate from preceding tokens - return '\\u' + pad4(hex(code)); - } - // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling - if (hasNativeU && flags.indexOf('u') !== -1) { - return match[0]; - } - throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. - * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because - * character class endings can't be determined. - */ -XRegExp.addToken(/\[(\^?)\]/, -// For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. -// (?!) should work like \b\B, but is unreliable in some versions of Firefox -/* eslint-disable no-confusing-arrow */ -function (match) { - return match[1] ? '[\\s\\S]' : '\\b\\B'; -}, -/* eslint-enable no-confusing-arrow */ -{ leadChar: '[' }); - -/* - * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in - * free-spacing mode (flag x). - */ -XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { leadChar: '(' }); - -/* - * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. - */ -XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { flag: 'x' }); - -/* - * Dot, in dotall mode (aka singleline mode, flag s) only. - */ -XRegExp.addToken(/\./, function () { - return '[\\s\\S]'; -}, { - flag: 's', - leadChar: '.' -}); - -/* - * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, - * and $ only. Also allows numbered backreferences as `\k`. - */ -XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { - // Groups with the same name is an error, else would need `lastIndexOf` - var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; - var endIndex = match.index + match[0].length; - if (!index || index > this.captureNames.length) { - throw new SyntaxError('Backreference to undefined group ' + match[0]); - } - // Keep backreferences separate from subsequent literal numbers. This avoids e.g. - // inadvertedly changing `(?)\k1` to `()\11`. - return '\\' + index + (endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); -}, { leadChar: '\\' }); - -/* - * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` - * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches - * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. - */ -XRegExp.addToken(/\\(\d+)/, function (match, scope) { - if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { - throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + match[0]); - } - return match[0]; -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the - * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style - * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively - * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to - * Python-style named capture as octals. - */ -XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { - // Disallow bare integers as names because named backreferences are added to match arrays - // and therefore numeric properties may lead to incorrect lookups - if (!isNaN(match[1])) { - throw new SyntaxError('Cannot use integer as capture name ' + match[0]); - } - if (match[1] === 'length' || match[1] === '__proto__') { - throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); - } - if (this.captureNames.indexOf(match[1]) !== -1) { - throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); - } - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return '('; -}, { leadChar: '(' }); - -/* - * Capturing group; match the opening parenthesis only. Required for support of named capturing - * groups. Also adds explicit capture mode (flag n). - */ -XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { - if (flags.indexOf('n') !== -1) { - return '(?:'; - } - this.captureNames.push(null); - return '('; -}, { - optionalFlags: 'n', - leadChar: '(' -}); - -exports.default = XRegExp; -module.exports = exports['default']; \ No newline at end of file diff --git a/scripts/node_modules/xregexp/package.json b/scripts/node_modules/xregexp/package.json deleted file mode 100644 index 977f1867..00000000 --- a/scripts/node_modules/xregexp/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "xregexp", - "version": "4.0.0", - "description": "Extended regular expressions", - "homepage": "http://xregexp.com/", - "author": "Steven Levithan ", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/slevithan/xregexp.git" - }, - "keywords": [ - "regex", - "regexp", - "regular expression", - "unicode" - ], - "main": "./lib", - "files": [ - "src", - "lib", - "xregexp-all.js", - "LICENSE" - ], - "scripts": { - "lint": "eslint src", - "babel": "babel src -d lib", - "prebuild": "npm run lint && npm run babel", - "build": "browserify lib/index.js --standalone XRegExp > xregexp-all.js", - "pretest": "npm run build", - "test": "jasmine JASMINE_CONFIG_PATH=tests/jasmine.json", - "test-saucelabs": "npm run pretest && zuul tests/spec/*.js", - "test-browser": "npm run test-saucelabs -- --local --open", - "prepublish": "npm test" - }, - "devDependencies": { - "babel-cli": "^6.24.1", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-array-includes": "^2.0.3", - "babel-plugin-transform-xregexp": "^0.0.4", - "babel-preset-env": "^1.4.0", - "browserify": "^12.0.1", - "eslint": "^3.19.0", - "jasmine": "^2.5.3", - "zuul": "^3.11.1" - } -} diff --git a/scripts/node_modules/xregexp/src/addons/build.js b/scripts/node_modules/xregexp/src/addons/build.js deleted file mode 100644 index 3a14e72e..00000000 --- a/scripts/node_modules/xregexp/src/addons/build.js +++ /dev/null @@ -1,234 +0,0 @@ -/*! - * XRegExp.build 4.0.0 - * - * Steven Levithan (c) 2012-2017 MIT License - */ - -export default (XRegExp) => { - const REGEX_DATA = 'xregexp'; - const subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - const parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { - conjunction: 'or' - }); - - /** - * Strips a leading `^` and trailing unescaped `$`, if both are present. - * - * @private - * @param {String} pattern Pattern to process. - * @returns {String} Pattern with edge anchors removed. - */ - function deanchor(pattern) { - // Allow any number of empty noncapturing groups before/after anchors, because regexes - // built/generated by XRegExp sometimes include them - const leadingAnchor = /^(?:\(\?:\))*\^/; - const trailingAnchor = /\$(?:\(\?:\))*$/; - - if ( - leadingAnchor.test(pattern) && - trailingAnchor.test(pattern) && - // Ensure that the trailing `$` isn't escaped - trailingAnchor.test(pattern.replace(/\\[\s\S]/g, '')) - ) { - return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); - } - - return pattern; - } - - /** - * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. - * - * @private - * @param {String|RegExp} value Value to convert. - * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not - * already a regex generated by XRegExp - * @returns {RegExp} XRegExp object with XRegExp syntax applied. - */ - function asXRegExp(value, addFlagX) { - const flags = addFlagX ? 'x' : ''; - return XRegExp.isRegExp(value) ? - (value[REGEX_DATA] && value[REGEX_DATA].captureNames ? - // Don't recompile, to preserve capture names - value : - // Recompile as XRegExp - XRegExp(value.source, flags) - ) : - // Compile string as XRegExp - XRegExp(value, flags); - } - - function interpolate(substitution) { - return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); - } - - function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { - subpatterns[`subpattern${subpatternIndex}`] = interpolated; - return subpatterns; - } - - function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { - const hasSubpattern = subpatternIndex < rawLiterals.length - 1; - return raw + (hasSubpattern ? `{{subpattern${subpatternIndex}}}` : ''); - } - - /** - * Provides tagged template literals that create regexes with XRegExp syntax and flags. The - * provided pattern is handled as a raw string, so backslashes don't need to be escaped. - * - * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated - * patterns are treated as atomic units when quantified, interpolated strings have their special - * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated - * regexes if both are present, and any backreferences within an interpolated regex are - * rewritten to work within the overall pattern. - * - * @memberOf XRegExp - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. - * @example - * - * const h12 = /1[0-2]|0?[1-9]/; - * const h24 = /2[0-3]|[01][0-9]/; - * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; - * const minutes = /^[0-5][0-9]$/; - * // Note that explicitly naming the 'minutes' group is required for named backreferences - * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.tag = (flags) => (literals, ...substitutions) => { - const subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); - const pattern = literals.raw.map(embedSubpatternAfter).join(''); - return XRegExp.build(pattern, subpatterns, flags); - }; - - /** - * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in - * the outer pattern and provided subpatterns are automatically renumbered to work correctly. - * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. - * - * @memberOf XRegExp - * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows - * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within - * character classes. - * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A - * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Regex with interpolated subpatterns. - * @example - * - * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { - * hours: XRegExp.build('{{h12}} : | {{h24}}', { - * h12: /1[0-2]|0?[1-9]/, - * h24: /2[0-3]|[01][0-9]/ - * }, 'x'), - * minutes: /^[0-5][0-9]$/ - * }); - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.build = (pattern, subs, flags) => { - flags = flags || ''; - // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how - // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` - // and `n`. See more details at . - const addFlagX = flags.includes('x'); - const inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); - // Add flags within a leading mode modifier to the overall pattern's flags - if (inlineFlags) { - flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); - } - - const data = {}; - for (const p in subs) { - if (subs.hasOwnProperty(p)) { - // Passing to XRegExp enables extended syntax and ensures independent validity, - // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For - // subpatterns provided as native regexes, it dies on octals and adds the property - // used to hold extended regex instance data, for simplicity. - const sub = asXRegExp(subs[p], addFlagX); - data[p] = { - // Deanchoring allows embedding independently useful anchored regexes. If you - // really need to keep your anchors, double them (i.e., `^^...$$`). - pattern: deanchor(sub.source), - names: sub[REGEX_DATA].captureNames || [] - }; - } - } - - // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; - // helps keep this simple. Named captures will be put back. - const patternAsRegex = asXRegExp(pattern, addFlagX); - - // 'Caps' is short for 'captures' - let numCaps = 0; - let numPriorCaps; - let numOuterCaps = 0; - const outerCapsMap = [0]; - const outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; - const output = patternAsRegex.source.replace(parts, ($0, $1, $2, $3, $4) => { - const subName = $1 || $2; - let capName; - let intro; - let localCapIndex; - // Named subpattern - if (subName) { - if (!data.hasOwnProperty(subName)) { - throw new ReferenceError(`Undefined property ${$0}`); - } - // Named subpattern was wrapped in a capturing group - if ($1) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If it's a named group, preserve the name. Otherwise, use the subpattern name - // as the capture name - intro = `(?<${capName || subName}>`; - } else { - intro = '(?:'; - } - numPriorCaps = numCaps; - const rewrittenSubpattern = data[subName].pattern.replace(subParts, (match, paren, backref) => { - // Capturing group - if (paren) { - capName = data[subName].names[numCaps - numPriorCaps]; - ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return `(?<${capName}>`; - } - // Backreference - } else if (backref) { - localCapIndex = +backref - 1; - // Rewrite the backreference - return data[subName].names[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - `\\k<${data[subName].names[localCapIndex]}>` : - `\\${+backref + numPriorCaps}`; - } - return match; - }); - return `${intro}${rewrittenSubpattern})`; - } - // Capturing group - if ($3) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return `(?<${capName}>`; - } - // Backreference - } else if ($4) { - localCapIndex = +$4 - 1; - // Rewrite the backreference - return outerCapNames[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - `\\k<${outerCapNames[localCapIndex]}>` : - `\\${outerCapsMap[+$4]}`; - } - return $0; - }); - - return XRegExp(output, flags); - }; -}; diff --git a/scripts/node_modules/xregexp/src/addons/matchrecursive.js b/scripts/node_modules/xregexp/src/addons/matchrecursive.js deleted file mode 100644 index bf563ee6..00000000 --- a/scripts/node_modules/xregexp/src/addons/matchrecursive.js +++ /dev/null @@ -1,197 +0,0 @@ -/*! - * XRegExp.matchRecursive 4.0.0 - * - * Steven Levithan (c) 2009-2017 MIT License - */ - -export default (XRegExp) => { - - /** - * Returns a match detail object composed of the provided values. - * - * @private - */ - function row(name, value, start, end) { - return { - name, - value, - start, - end - }; - } - - /** - * Returns an array of match strings between outermost left and right delimiters, or an array of - * objects with detailed match parts and position data. An error is thrown if delimiters are - * unbalanced within the data. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {String} left Left delimiter as an XRegExp pattern. - * @param {String} right Right delimiter as an XRegExp pattern. - * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. - * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. - * @returns {Array} Array of matches, or an empty array. - * @example - * - * // Basic usage - * let str = '(t((e))s)t()(ing)'; - * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); - * // -> ['t((e))s', '', 'ing'] - * - * // Extended information mode with valueNames - * str = 'Here is
an
example'; - * XRegExp.matchRecursive(str, '', '', 'gi', { - * valueNames: ['between', 'left', 'match', 'right'] - * }); - * // -> [ - * // {name: 'between', value: 'Here is ', start: 0, end: 8}, - * // {name: 'left', value: '
', start: 8, end: 13}, - * // {name: 'match', value: '
an
', start: 13, end: 27}, - * // {name: 'right', value: '
', start: 27, end: 33}, - * // {name: 'between', value: ' example', start: 33, end: 41} - * // ] - * - * // Omitting unneeded parts with null valueNames, and using escapeChar - * str = '...{1}.\\{{function(x,y){return {y:x}}}'; - * XRegExp.matchRecursive(str, '{', '}', 'g', { - * valueNames: ['literal', null, 'value', null], - * escapeChar: '\\' - * }); - * // -> [ - * // {name: 'literal', value: '...', start: 0, end: 3}, - * // {name: 'value', value: '1', start: 4, end: 5}, - * // {name: 'literal', value: '.\\{', start: 6, end: 9}, - * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} - * // ] - * - * // Sticky mode via flag y - * str = '<1><<<2>>><3>4<5>'; - * XRegExp.matchRecursive(str, '<', '>', 'gy'); - * // -> ['1', '<<2>>', '3'] - */ - XRegExp.matchRecursive = (str, left, right, flags, options) => { - flags = flags || ''; - options = options || {}; - const global = flags.includes('g'); - const sticky = flags.includes('y'); - // Flag `y` is controlled internally - const basicFlags = flags.replace(/y/g, ''); - let escapeChar = options.escapeChar; - const vN = options.valueNames; - const output = []; - let openTokens = 0; - let delimStart = 0; - let delimEnd = 0; - let lastOuterEnd = 0; - let outerStart; - let innerStart; - let leftMatch; - let rightMatch; - let esc; - left = XRegExp(left, basicFlags); - right = XRegExp(right, basicFlags); - - if (escapeChar) { - if (escapeChar.length > 1) { - throw new Error('Cannot use more than one escape character'); - } - escapeChar = XRegExp.escape(escapeChar); - // Example of concatenated `esc` regex: - // `escapeChar`: '%' - // `left`: '<' - // `right`: '>' - // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ - esc = new RegExp( - `(?:${escapeChar}[\\S\\s]|(?:(?!${ - // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. - // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax - // transformation resulting from those flags was already applied to `left` and - // `right` when they were passed through the XRegExp constructor above. - XRegExp.union([left, right], '', {conjunction: 'or'}).source - })[^${escapeChar}])+)+`, - // Flags `gy` not needed here - flags.replace(/[^imu]+/g, '') - ); - } - - while (true) { - // If using an escape character, advance to the delimiter's next starting position, - // skipping any escaped characters in between - if (escapeChar) { - delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; - } - leftMatch = XRegExp.exec(str, left, delimEnd); - rightMatch = XRegExp.exec(str, right, delimEnd); - // Keep the leftmost match only - if (leftMatch && rightMatch) { - if (leftMatch.index <= rightMatch.index) { - rightMatch = null; - } else { - leftMatch = null; - } - } - // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): - // LM | RM | OT | Result - // 1 | 0 | 1 | loop - // 1 | 0 | 0 | loop - // 0 | 1 | 1 | loop - // 0 | 1 | 0 | throw - // 0 | 0 | 1 | throw - // 0 | 0 | 0 | break - // The paths above don't include the sticky mode special case. The loop ends after the - // first completed match if not `global`. - if (leftMatch || rightMatch) { - delimStart = (leftMatch || rightMatch).index; - delimEnd = delimStart + (leftMatch || rightMatch)[0].length; - } else if (!openTokens) { - break; - } - if (sticky && !openTokens && delimStart > lastOuterEnd) { - break; - } - if (leftMatch) { - if (!openTokens) { - outerStart = delimStart; - innerStart = delimEnd; - } - ++openTokens; - } else if (rightMatch && openTokens) { - if (!--openTokens) { - if (vN) { - if (vN[0] && outerStart > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); - } - if (vN[1]) { - output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); - } - if (vN[2]) { - output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); - } - if (vN[3]) { - output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); - } - } else { - output.push(str.slice(innerStart, delimStart)); - } - lastOuterEnd = delimEnd; - if (!global) { - break; - } - } - } else { - throw new Error('Unbalanced delimiter found in string'); - } - // If the delimiter matched an empty string, avoid an infinite loop - if (delimStart === delimEnd) { - ++delimEnd; - } - } - - if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); - } - - return output; - }; -}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-base.js b/scripts/node_modules/xregexp/src/addons/unicode-base.js deleted file mode 100644 index 9fcb0448..00000000 --- a/scripts/node_modules/xregexp/src/addons/unicode-base.js +++ /dev/null @@ -1,258 +0,0 @@ -/*! - * XRegExp Unicode Base 4.0.0 - * - * Steven Levithan (c) 2008-2017 MIT License - */ - -export default (XRegExp) => { - - /** - * Adds base support for Unicode matching: - * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or - * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the - * braces for token names that are a single letter (e.g. `\pL` or `PL`). - * - Adds flag A (astral), which enables 21-bit Unicode support. - * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. - * - * Unicode Base relies on externally provided Unicode character data. Official addons are - * available to provide data for Unicode categories, scripts, blocks, and properties. - * - * @requires XRegExp - */ - - // ==--------------------------== - // Private stuff - // ==--------------------------== - - // Storage for Unicode data - const unicode = {}; - - // Reuse utils - const dec = XRegExp._dec; - const hex = XRegExp._hex; - const pad4 = XRegExp._pad4; - - // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed - function normalize(name) { - return name.replace(/[- _]+/g, '').toLowerCase(); - } - - // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal - function charCode(chr) { - const esc = /^\\[xu](.+)/.exec(chr); - return esc ? - dec(esc[1]) : - chr.charCodeAt(chr[0] === '\\' ? 1 : 0); - } - - // Inverts a list of ordered BMP characters and ranges - function invertBmp(range) { - let output = ''; - let lastEnd = -1; - - XRegExp.forEach( - range, - /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, - (m) => { - const start = charCode(m[1]); - if (start > (lastEnd + 1)) { - output += `\\u${pad4(hex(lastEnd + 1))}`; - if (start > (lastEnd + 2)) { - output += `-\\u${pad4(hex(start - 1))}`; - } - } - lastEnd = charCode(m[2] || m[1]); - } - ); - - if (lastEnd < 0xFFFF) { - output += `\\u${pad4(hex(lastEnd + 1))}`; - if (lastEnd < 0xFFFE) { - output += '-\\uFFFF'; - } - } - - return output; - } - - // Generates an inverted BMP range on first use - function cacheInvertedBmp(slug) { - const prop = 'b!'; - return ( - unicode[slug][prop] || - (unicode[slug][prop] = invertBmp(unicode[slug].bmp)) - ); - } - - // Combines and optionally negates BMP and astral data - function buildAstral(slug, isNegated) { - const item = unicode[slug]; - let combined = ''; - - if (item.bmp && !item.isBmpLast) { - combined = `[${item.bmp}]${item.astral ? '|' : ''}`; - } - if (item.astral) { - combined += item.astral; - } - if (item.isBmpLast && item.bmp) { - combined += `${item.astral ? '|' : ''}[${item.bmp}]`; - } - - // Astral Unicode tokens always match a code point, never a code unit - return isNegated ? - `(?:(?!${combined})(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))` : - `(?:${combined})`; - } - - // Builds a complete astral pattern on first use - function cacheAstral(slug, isNegated) { - const prop = isNegated ? 'a!' : 'a='; - return ( - unicode[slug][prop] || - (unicode[slug][prop] = buildAstral(slug, isNegated)) - ); - } - - // ==--------------------------== - // Core functionality - // ==--------------------------== - - /* - * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. - */ - XRegExp.addToken( - // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` - /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, - (match, scope, flags) => { - const ERR_DOUBLE_NEG = 'Invalid double negation '; - const ERR_UNKNOWN_NAME = 'Unknown Unicode token '; - const ERR_UNKNOWN_REF = 'Unicode token missing data '; - const ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; - const ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; - // Negated via \P{..} or \p{^..} - let isNegated = match[1] === 'P' || !!match[2]; - // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A - const isAstralMode = flags.includes('A'); - // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` - let slug = normalize(match[4] || match[3]); - // Token data object - let item = unicode[slug]; - - if (match[1] === 'P' && match[2]) { - throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); - } - if (!unicode.hasOwnProperty(slug)) { - throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); - } - - // Switch to the negated form of the referenced Unicode token - if (item.inverseOf) { - slug = normalize(item.inverseOf); - if (!unicode.hasOwnProperty(slug)) { - throw new ReferenceError(`${ERR_UNKNOWN_REF + match[0]} -> ${item.inverseOf}`); - } - item = unicode[slug]; - isNegated = !isNegated; - } - - if (!(item.bmp || isAstralMode)) { - throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); - } - if (isAstralMode) { - if (scope === 'class') { - throw new SyntaxError(ERR_ASTRAL_IN_CLASS); - } - - return cacheAstral(slug, isNegated); - } - - return scope === 'class' ? - (isNegated ? cacheInvertedBmp(slug) : item.bmp) : - `${(isNegated ? '[^' : '[') + item.bmp}]`; - }, - { - scope: 'all', - optionalFlags: 'A', - leadChar: '\\' - } - ); - - /** - * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. - * - * @memberOf XRegExp - * @param {Array} data Objects with named character ranges. Each object may have properties - * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are - * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If - * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, - * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are - * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and - * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan - * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and - * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape - * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be - * escaped, apart from range-creating hyphens. The `astral` data can additionally use - * character classes and alternation, and should use surrogate pairs to represent astral code - * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is - * defined as the exact inverse of another token. - * @example - * - * // Basic use - * XRegExp.addUnicodeData([{ - * name: 'XDigit', - * alias: 'Hexadecimal', - * bmp: '0-9A-Fa-f' - * }]); - * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true - */ - XRegExp.addUnicodeData = (data) => { - const ERR_NO_NAME = 'Unicode token requires name'; - const ERR_NO_DATA = 'Unicode token has no character data '; - let item; - - for (let i = 0; i < data.length; ++i) { - item = data[i]; - if (!item.name) { - throw new Error(ERR_NO_NAME); - } - if (!(item.inverseOf || item.bmp || item.astral)) { - throw new Error(ERR_NO_DATA + item.name); - } - unicode[normalize(item.name)] = item; - if (item.alias) { - unicode[normalize(item.alias)] = item; - } - } - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and - // flags might now produce different results - XRegExp.cache.flush('patterns'); - }; - - /** - * @ignore - * - * Return a reference to the internal Unicode definition structure for the given Unicode - * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex - * constructs. - * - * @memberOf XRegExp - * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), - * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode - * Properties and Property Aliases. - * @returns {Object} Reference to definition structure when the name matches a Unicode Property. - * - * @note - * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. - * - * @note - * This method is *not* part of the officially documented API and may change or be removed in - * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode - * structures set up by XRegExp. - */ - XRegExp._getUnicodeProperty = (name) => { - const slug = normalize(name); - return unicode[slug]; - }; -}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-blocks.js b/scripts/node_modules/xregexp/src/addons/unicode-blocks.js deleted file mode 100644 index e2f922c9..00000000 --- a/scripts/node_modules/xregexp/src/addons/unicode-blocks.js +++ /dev/null @@ -1,1118 +0,0 @@ -/*! - * XRegExp Unicode Blocks 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -export default (XRegExp) => { - - /** - * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., - * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and - * underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); - } - - XRegExp.addUnicodeData([ - { - name: 'InAdlam', - astral: '\uD83A[\uDD00-\uDD5F]' - }, - { - name: 'InAegean_Numbers', - astral: '\uD800[\uDD00-\uDD3F]' - }, - { - name: 'InAhom', - astral: '\uD805[\uDF00-\uDF3F]' - }, - { - name: 'InAlchemical_Symbols', - astral: '\uD83D[\uDF00-\uDF7F]' - }, - { - name: 'InAlphabetic_Presentation_Forms', - bmp: '\uFB00-\uFB4F' - }, - { - name: 'InAnatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE7F]' - }, - { - name: 'InAncient_Greek_Musical_Notation', - astral: '\uD834[\uDE00-\uDE4F]' - }, - { - name: 'InAncient_Greek_Numbers', - astral: '\uD800[\uDD40-\uDD8F]' - }, - { - name: 'InAncient_Symbols', - astral: '\uD800[\uDD90-\uDDCF]' - }, - { - name: 'InArabic', - bmp: '\u0600-\u06FF' - }, - { - name: 'InArabic_Extended_A', - bmp: '\u08A0-\u08FF' - }, - { - name: 'InArabic_Mathematical_Alphabetic_Symbols', - astral: '\uD83B[\uDE00-\uDEFF]' - }, - { - name: 'InArabic_Presentation_Forms_A', - bmp: '\uFB50-\uFDFF' - }, - { - name: 'InArabic_Presentation_Forms_B', - bmp: '\uFE70-\uFEFF' - }, - { - name: 'InArabic_Supplement', - bmp: '\u0750-\u077F' - }, - { - name: 'InArmenian', - bmp: '\u0530-\u058F' - }, - { - name: 'InArrows', - bmp: '\u2190-\u21FF' - }, - { - name: 'InAvestan', - astral: '\uD802[\uDF00-\uDF3F]' - }, - { - name: 'InBalinese', - bmp: '\u1B00-\u1B7F' - }, - { - name: 'InBamum', - bmp: '\uA6A0-\uA6FF' - }, - { - name: 'InBamum_Supplement', - astral: '\uD81A[\uDC00-\uDE3F]' - }, - { - name: 'InBasic_Latin', - bmp: '\0-\x7F' - }, - { - name: 'InBassa_Vah', - astral: '\uD81A[\uDED0-\uDEFF]' - }, - { - name: 'InBatak', - bmp: '\u1BC0-\u1BFF' - }, - { - name: 'InBengali', - bmp: '\u0980-\u09FF' - }, - { - name: 'InBhaiksuki', - astral: '\uD807[\uDC00-\uDC6F]' - }, - { - name: 'InBlock_Elements', - bmp: '\u2580-\u259F' - }, - { - name: 'InBopomofo', - bmp: '\u3100-\u312F' - }, - { - name: 'InBopomofo_Extended', - bmp: '\u31A0-\u31BF' - }, - { - name: 'InBox_Drawing', - bmp: '\u2500-\u257F' - }, - { - name: 'InBrahmi', - astral: '\uD804[\uDC00-\uDC7F]' - }, - { - name: 'InBraille_Patterns', - bmp: '\u2800-\u28FF' - }, - { - name: 'InBuginese', - bmp: '\u1A00-\u1A1F' - }, - { - name: 'InBuhid', - bmp: '\u1740-\u175F' - }, - { - name: 'InByzantine_Musical_Symbols', - astral: '\uD834[\uDC00-\uDCFF]' - }, - { - name: 'InCJK_Compatibility', - bmp: '\u3300-\u33FF' - }, - { - name: 'InCJK_Compatibility_Forms', - bmp: '\uFE30-\uFE4F' - }, - { - name: 'InCJK_Compatibility_Ideographs', - bmp: '\uF900-\uFAFF' - }, - { - name: 'InCJK_Compatibility_Ideographs_Supplement', - astral: '\uD87E[\uDC00-\uDE1F]' - }, - { - name: 'InCJK_Radicals_Supplement', - bmp: '\u2E80-\u2EFF' - }, - { - name: 'InCJK_Strokes', - bmp: '\u31C0-\u31EF' - }, - { - name: 'InCJK_Symbols_and_Punctuation', - bmp: '\u3000-\u303F' - }, - { - name: 'InCJK_Unified_Ideographs', - bmp: '\u4E00-\u9FFF' - }, - { - name: 'InCJK_Unified_Ideographs_Extension_A', - bmp: '\u3400-\u4DBF' - }, - { - name: 'InCJK_Unified_Ideographs_Extension_B', - astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' - }, - { - name: 'InCJK_Unified_Ideographs_Extension_C', - astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' - }, - { - name: 'InCJK_Unified_Ideographs_Extension_D', - astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' - }, - { - name: 'InCJK_Unified_Ideographs_Extension_E', - astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' - }, - { - name: 'InCarian', - astral: '\uD800[\uDEA0-\uDEDF]' - }, - { - name: 'InCaucasian_Albanian', - astral: '\uD801[\uDD30-\uDD6F]' - }, - { - name: 'InChakma', - astral: '\uD804[\uDD00-\uDD4F]' - }, - { - name: 'InCham', - bmp: '\uAA00-\uAA5F' - }, - { - name: 'InCherokee', - bmp: '\u13A0-\u13FF' - }, - { - name: 'InCherokee_Supplement', - bmp: '\uAB70-\uABBF' - }, - { - name: 'InCombining_Diacritical_Marks', - bmp: '\u0300-\u036F' - }, - { - name: 'InCombining_Diacritical_Marks_Extended', - bmp: '\u1AB0-\u1AFF' - }, - { - name: 'InCombining_Diacritical_Marks_Supplement', - bmp: '\u1DC0-\u1DFF' - }, - { - name: 'InCombining_Diacritical_Marks_for_Symbols', - bmp: '\u20D0-\u20FF' - }, - { - name: 'InCombining_Half_Marks', - bmp: '\uFE20-\uFE2F' - }, - { - name: 'InCommon_Indic_Number_Forms', - bmp: '\uA830-\uA83F' - }, - { - name: 'InControl_Pictures', - bmp: '\u2400-\u243F' - }, - { - name: 'InCoptic', - bmp: '\u2C80-\u2CFF' - }, - { - name: 'InCoptic_Epact_Numbers', - astral: '\uD800[\uDEE0-\uDEFF]' - }, - { - name: 'InCounting_Rod_Numerals', - astral: '\uD834[\uDF60-\uDF7F]' - }, - { - name: 'InCuneiform', - astral: '\uD808[\uDC00-\uDFFF]' - }, - { - name: 'InCuneiform_Numbers_and_Punctuation', - astral: '\uD809[\uDC00-\uDC7F]' - }, - { - name: 'InCurrency_Symbols', - bmp: '\u20A0-\u20CF' - }, - { - name: 'InCypriot_Syllabary', - astral: '\uD802[\uDC00-\uDC3F]' - }, - { - name: 'InCyrillic', - bmp: '\u0400-\u04FF' - }, - { - name: 'InCyrillic_Extended_A', - bmp: '\u2DE0-\u2DFF' - }, - { - name: 'InCyrillic_Extended_B', - bmp: '\uA640-\uA69F' - }, - { - name: 'InCyrillic_Extended_C', - bmp: '\u1C80-\u1C8F' - }, - { - name: 'InCyrillic_Supplement', - bmp: '\u0500-\u052F' - }, - { - name: 'InDeseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, - { - name: 'InDevanagari', - bmp: '\u0900-\u097F' - }, - { - name: 'InDevanagari_Extended', - bmp: '\uA8E0-\uA8FF' - }, - { - name: 'InDingbats', - bmp: '\u2700-\u27BF' - }, - { - name: 'InDomino_Tiles', - astral: '\uD83C[\uDC30-\uDC9F]' - }, - { - name: 'InDuployan', - astral: '\uD82F[\uDC00-\uDC9F]' - }, - { - name: 'InEarly_Dynastic_Cuneiform', - astral: '\uD809[\uDC80-\uDD4F]' - }, - { - name: 'InEgyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' - }, - { - name: 'InElbasan', - astral: '\uD801[\uDD00-\uDD2F]' - }, - { - name: 'InEmoticons', - astral: '\uD83D[\uDE00-\uDE4F]' - }, - { - name: 'InEnclosed_Alphanumeric_Supplement', - astral: '\uD83C[\uDD00-\uDDFF]' - }, - { - name: 'InEnclosed_Alphanumerics', - bmp: '\u2460-\u24FF' - }, - { - name: 'InEnclosed_CJK_Letters_and_Months', - bmp: '\u3200-\u32FF' - }, - { - name: 'InEnclosed_Ideographic_Supplement', - astral: '\uD83C[\uDE00-\uDEFF]' - }, - { - name: 'InEthiopic', - bmp: '\u1200-\u137F' - }, - { - name: 'InEthiopic_Extended', - bmp: '\u2D80-\u2DDF' - }, - { - name: 'InEthiopic_Extended_A', - bmp: '\uAB00-\uAB2F' - }, - { - name: 'InEthiopic_Supplement', - bmp: '\u1380-\u139F' - }, - { - name: 'InGeneral_Punctuation', - bmp: '\u2000-\u206F' - }, - { - name: 'InGeometric_Shapes', - bmp: '\u25A0-\u25FF' - }, - { - name: 'InGeometric_Shapes_Extended', - astral: '\uD83D[\uDF80-\uDFFF]' - }, - { - name: 'InGeorgian', - bmp: '\u10A0-\u10FF' - }, - { - name: 'InGeorgian_Supplement', - bmp: '\u2D00-\u2D2F' - }, - { - name: 'InGlagolitic', - bmp: '\u2C00-\u2C5F' - }, - { - name: 'InGlagolitic_Supplement', - astral: '\uD838[\uDC00-\uDC2F]' - }, - { - name: 'InGothic', - astral: '\uD800[\uDF30-\uDF4F]' - }, - { - name: 'InGrantha', - astral: '\uD804[\uDF00-\uDF7F]' - }, - { - name: 'InGreek_Extended', - bmp: '\u1F00-\u1FFF' - }, - { - name: 'InGreek_and_Coptic', - bmp: '\u0370-\u03FF' - }, - { - name: 'InGujarati', - bmp: '\u0A80-\u0AFF' - }, - { - name: 'InGurmukhi', - bmp: '\u0A00-\u0A7F' - }, - { - name: 'InHalfwidth_and_Fullwidth_Forms', - bmp: '\uFF00-\uFFEF' - }, - { - name: 'InHangul_Compatibility_Jamo', - bmp: '\u3130-\u318F' - }, - { - name: 'InHangul_Jamo', - bmp: '\u1100-\u11FF' - }, - { - name: 'InHangul_Jamo_Extended_A', - bmp: '\uA960-\uA97F' - }, - { - name: 'InHangul_Jamo_Extended_B', - bmp: '\uD7B0-\uD7FF' - }, - { - name: 'InHangul_Syllables', - bmp: '\uAC00-\uD7AF' - }, - { - name: 'InHanunoo', - bmp: '\u1720-\u173F' - }, - { - name: 'InHatran', - astral: '\uD802[\uDCE0-\uDCFF]' - }, - { - name: 'InHebrew', - bmp: '\u0590-\u05FF' - }, - { - name: 'InHigh_Private_Use_Surrogates', - bmp: '\uDB80-\uDBFF' - }, - { - name: 'InHigh_Surrogates', - bmp: '\uD800-\uDB7F' - }, - { - name: 'InHiragana', - bmp: '\u3040-\u309F' - }, - { - name: 'InIPA_Extensions', - bmp: '\u0250-\u02AF' - }, - { - name: 'InIdeographic_Description_Characters', - bmp: '\u2FF0-\u2FFF' - }, - { - name: 'InIdeographic_Symbols_and_Punctuation', - astral: '\uD81B[\uDFE0-\uDFFF]' - }, - { - name: 'InImperial_Aramaic', - astral: '\uD802[\uDC40-\uDC5F]' - }, - { - name: 'InInscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF7F]' - }, - { - name: 'InInscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF5F]' - }, - { - name: 'InJavanese', - bmp: '\uA980-\uA9DF' - }, - { - name: 'InKaithi', - astral: '\uD804[\uDC80-\uDCCF]' - }, - { - name: 'InKana_Supplement', - astral: '\uD82C[\uDC00-\uDCFF]' - }, - { - name: 'InKanbun', - bmp: '\u3190-\u319F' - }, - { - name: 'InKangxi_Radicals', - bmp: '\u2F00-\u2FDF' - }, - { - name: 'InKannada', - bmp: '\u0C80-\u0CFF' - }, - { - name: 'InKatakana', - bmp: '\u30A0-\u30FF' - }, - { - name: 'InKatakana_Phonetic_Extensions', - bmp: '\u31F0-\u31FF' - }, - { - name: 'InKayah_Li', - bmp: '\uA900-\uA92F' - }, - { - name: 'InKharoshthi', - astral: '\uD802[\uDE00-\uDE5F]' - }, - { - name: 'InKhmer', - bmp: '\u1780-\u17FF' - }, - { - name: 'InKhmer_Symbols', - bmp: '\u19E0-\u19FF' - }, - { - name: 'InKhojki', - astral: '\uD804[\uDE00-\uDE4F]' - }, - { - name: 'InKhudawadi', - astral: '\uD804[\uDEB0-\uDEFF]' - }, - { - name: 'InLao', - bmp: '\u0E80-\u0EFF' - }, - { - name: 'InLatin_Extended_Additional', - bmp: '\u1E00-\u1EFF' - }, - { - name: 'InLatin_Extended_A', - bmp: '\u0100-\u017F' - }, - { - name: 'InLatin_Extended_B', - bmp: '\u0180-\u024F' - }, - { - name: 'InLatin_Extended_C', - bmp: '\u2C60-\u2C7F' - }, - { - name: 'InLatin_Extended_D', - bmp: '\uA720-\uA7FF' - }, - { - name: 'InLatin_Extended_E', - bmp: '\uAB30-\uAB6F' - }, - { - name: 'InLatin_1_Supplement', - bmp: '\x80-\xFF' - }, - { - name: 'InLepcha', - bmp: '\u1C00-\u1C4F' - }, - { - name: 'InLetterlike_Symbols', - bmp: '\u2100-\u214F' - }, - { - name: 'InLimbu', - bmp: '\u1900-\u194F' - }, - { - name: 'InLinear_A', - astral: '\uD801[\uDE00-\uDF7F]' - }, - { - name: 'InLinear_B_Ideograms', - astral: '\uD800[\uDC80-\uDCFF]' - }, - { - name: 'InLinear_B_Syllabary', - astral: '\uD800[\uDC00-\uDC7F]' - }, - { - name: 'InLisu', - bmp: '\uA4D0-\uA4FF' - }, - { - name: 'InLow_Surrogates', - bmp: '\uDC00-\uDFFF' - }, - { - name: 'InLycian', - astral: '\uD800[\uDE80-\uDE9F]' - }, - { - name: 'InLydian', - astral: '\uD802[\uDD20-\uDD3F]' - }, - { - name: 'InMahajani', - astral: '\uD804[\uDD50-\uDD7F]' - }, - { - name: 'InMahjong_Tiles', - astral: '\uD83C[\uDC00-\uDC2F]' - }, - { - name: 'InMalayalam', - bmp: '\u0D00-\u0D7F' - }, - { - name: 'InMandaic', - bmp: '\u0840-\u085F' - }, - { - name: 'InManichaean', - astral: '\uD802[\uDEC0-\uDEFF]' - }, - { - name: 'InMarchen', - astral: '\uD807[\uDC70-\uDCBF]' - }, - { - name: 'InMathematical_Alphanumeric_Symbols', - astral: '\uD835[\uDC00-\uDFFF]' - }, - { - name: 'InMathematical_Operators', - bmp: '\u2200-\u22FF' - }, - { - name: 'InMeetei_Mayek', - bmp: '\uABC0-\uABFF' - }, - { - name: 'InMeetei_Mayek_Extensions', - bmp: '\uAAE0-\uAAFF' - }, - { - name: 'InMende_Kikakui', - astral: '\uD83A[\uDC00-\uDCDF]' - }, - { - name: 'InMeroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDFF]' - }, - { - name: 'InMeroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, - { - name: 'InMiao', - astral: '\uD81B[\uDF00-\uDF9F]' - }, - { - name: 'InMiscellaneous_Mathematical_Symbols_A', - bmp: '\u27C0-\u27EF' - }, - { - name: 'InMiscellaneous_Mathematical_Symbols_B', - bmp: '\u2980-\u29FF' - }, - { - name: 'InMiscellaneous_Symbols', - bmp: '\u2600-\u26FF' - }, - { - name: 'InMiscellaneous_Symbols_and_Arrows', - bmp: '\u2B00-\u2BFF' - }, - { - name: 'InMiscellaneous_Symbols_and_Pictographs', - astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' - }, - { - name: 'InMiscellaneous_Technical', - bmp: '\u2300-\u23FF' - }, - { - name: 'InModi', - astral: '\uD805[\uDE00-\uDE5F]' - }, - { - name: 'InModifier_Tone_Letters', - bmp: '\uA700-\uA71F' - }, - { - name: 'InMongolian', - bmp: '\u1800-\u18AF' - }, - { - name: 'InMongolian_Supplement', - astral: '\uD805[\uDE60-\uDE7F]' - }, - { - name: 'InMro', - astral: '\uD81A[\uDE40-\uDE6F]' - }, - { - name: 'InMultani', - astral: '\uD804[\uDE80-\uDEAF]' - }, - { - name: 'InMusical_Symbols', - astral: '\uD834[\uDD00-\uDDFF]' - }, - { - name: 'InMyanmar', - bmp: '\u1000-\u109F' - }, - { - name: 'InMyanmar_Extended_A', - bmp: '\uAA60-\uAA7F' - }, - { - name: 'InMyanmar_Extended_B', - bmp: '\uA9E0-\uA9FF' - }, - { - name: 'InNKo', - bmp: '\u07C0-\u07FF' - }, - { - name: 'InNabataean', - astral: '\uD802[\uDC80-\uDCAF]' - }, - { - name: 'InNew_Tai_Lue', - bmp: '\u1980-\u19DF' - }, - { - name: 'InNewa', - astral: '\uD805[\uDC00-\uDC7F]' - }, - { - name: 'InNumber_Forms', - bmp: '\u2150-\u218F' - }, - { - name: 'InOgham', - bmp: '\u1680-\u169F' - }, - { - name: 'InOl_Chiki', - bmp: '\u1C50-\u1C7F' - }, - { - name: 'InOld_Hungarian', - astral: '\uD803[\uDC80-\uDCFF]' - }, - { - name: 'InOld_Italic', - astral: '\uD800[\uDF00-\uDF2F]' - }, - { - name: 'InOld_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, - { - name: 'InOld_Permic', - astral: '\uD800[\uDF50-\uDF7F]' - }, - { - name: 'InOld_Persian', - astral: '\uD800[\uDFA0-\uDFDF]' - }, - { - name: 'InOld_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, - { - name: 'InOld_Turkic', - astral: '\uD803[\uDC00-\uDC4F]' - }, - { - name: 'InOptical_Character_Recognition', - bmp: '\u2440-\u245F' - }, - { - name: 'InOriya', - bmp: '\u0B00-\u0B7F' - }, - { - name: 'InOrnamental_Dingbats', - astral: '\uD83D[\uDE50-\uDE7F]' - }, - { - name: 'InOsage', - astral: '\uD801[\uDCB0-\uDCFF]' - }, - { - name: 'InOsmanya', - astral: '\uD801[\uDC80-\uDCAF]' - }, - { - name: 'InPahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF8F]' - }, - { - name: 'InPalmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, - { - name: 'InPau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEFF]' - }, - { - name: 'InPhags_pa', - bmp: '\uA840-\uA87F' - }, - { - name: 'InPhaistos_Disc', - astral: '\uD800[\uDDD0-\uDDFF]' - }, - { - name: 'InPhoenician', - astral: '\uD802[\uDD00-\uDD1F]' - }, - { - name: 'InPhonetic_Extensions', - bmp: '\u1D00-\u1D7F' - }, - { - name: 'InPhonetic_Extensions_Supplement', - bmp: '\u1D80-\u1DBF' - }, - { - name: 'InPlaying_Cards', - astral: '\uD83C[\uDCA0-\uDCFF]' - }, - { - name: 'InPrivate_Use_Area', - bmp: '\uE000-\uF8FF' - }, - { - name: 'InPsalter_Pahlavi', - astral: '\uD802[\uDF80-\uDFAF]' - }, - { - name: 'InRejang', - bmp: '\uA930-\uA95F' - }, - { - name: 'InRumi_Numeral_Symbols', - astral: '\uD803[\uDE60-\uDE7F]' - }, - { - name: 'InRunic', - bmp: '\u16A0-\u16FF' - }, - { - name: 'InSamaritan', - bmp: '\u0800-\u083F' - }, - { - name: 'InSaurashtra', - bmp: '\uA880-\uA8DF' - }, - { - name: 'InSharada', - astral: '\uD804[\uDD80-\uDDDF]' - }, - { - name: 'InShavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, - { - name: 'InShorthand_Format_Controls', - astral: '\uD82F[\uDCA0-\uDCAF]' - }, - { - name: 'InSiddham', - astral: '\uD805[\uDD80-\uDDFF]' - }, - { - name: 'InSinhala', - bmp: '\u0D80-\u0DFF' - }, - { - name: 'InSinhala_Archaic_Numbers', - astral: '\uD804[\uDDE0-\uDDFF]' - }, - { - name: 'InSmall_Form_Variants', - bmp: '\uFE50-\uFE6F' - }, - { - name: 'InSora_Sompeng', - astral: '\uD804[\uDCD0-\uDCFF]' - }, - { - name: 'InSpacing_Modifier_Letters', - bmp: '\u02B0-\u02FF' - }, - { - name: 'InSpecials', - bmp: '\uFFF0-\uFFFF' - }, - { - name: 'InSundanese', - bmp: '\u1B80-\u1BBF' - }, - { - name: 'InSundanese_Supplement', - bmp: '\u1CC0-\u1CCF' - }, - { - name: 'InSuperscripts_and_Subscripts', - bmp: '\u2070-\u209F' - }, - { - name: 'InSupplemental_Arrows_A', - bmp: '\u27F0-\u27FF' - }, - { - name: 'InSupplemental_Arrows_B', - bmp: '\u2900-\u297F' - }, - { - name: 'InSupplemental_Arrows_C', - astral: '\uD83E[\uDC00-\uDCFF]' - }, - { - name: 'InSupplemental_Mathematical_Operators', - bmp: '\u2A00-\u2AFF' - }, - { - name: 'InSupplemental_Punctuation', - bmp: '\u2E00-\u2E7F' - }, - { - name: 'InSupplemental_Symbols_and_Pictographs', - astral: '\uD83E[\uDD00-\uDDFF]' - }, - { - name: 'InSupplementary_Private_Use_Area_A', - astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' - }, - { - name: 'InSupplementary_Private_Use_Area_B', - astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' - }, - { - name: 'InSutton_SignWriting', - astral: '\uD836[\uDC00-\uDEAF]' - }, - { - name: 'InSyloti_Nagri', - bmp: '\uA800-\uA82F' - }, - { - name: 'InSyriac', - bmp: '\u0700-\u074F' - }, - { - name: 'InTagalog', - bmp: '\u1700-\u171F' - }, - { - name: 'InTagbanwa', - bmp: '\u1760-\u177F' - }, - { - name: 'InTags', - astral: '\uDB40[\uDC00-\uDC7F]' - }, - { - name: 'InTai_Le', - bmp: '\u1950-\u197F' - }, - { - name: 'InTai_Tham', - bmp: '\u1A20-\u1AAF' - }, - { - name: 'InTai_Viet', - bmp: '\uAA80-\uAADF' - }, - { - name: 'InTai_Xuan_Jing_Symbols', - astral: '\uD834[\uDF00-\uDF5F]' - }, - { - name: 'InTakri', - astral: '\uD805[\uDE80-\uDECF]' - }, - { - name: 'InTamil', - bmp: '\u0B80-\u0BFF' - }, - { - name: 'InTangut', - astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' - }, - { - name: 'InTangut_Components', - astral: '\uD822[\uDC00-\uDEFF]' - }, - { - name: 'InTelugu', - bmp: '\u0C00-\u0C7F' - }, - { - name: 'InThaana', - bmp: '\u0780-\u07BF' - }, - { - name: 'InThai', - bmp: '\u0E00-\u0E7F' - }, - { - name: 'InTibetan', - bmp: '\u0F00-\u0FFF' - }, - { - name: 'InTifinagh', - bmp: '\u2D30-\u2D7F' - }, - { - name: 'InTirhuta', - astral: '\uD805[\uDC80-\uDCDF]' - }, - { - name: 'InTransport_and_Map_Symbols', - astral: '\uD83D[\uDE80-\uDEFF]' - }, - { - name: 'InUgaritic', - astral: '\uD800[\uDF80-\uDF9F]' - }, - { - name: 'InUnified_Canadian_Aboriginal_Syllabics', - bmp: '\u1400-\u167F' - }, - { - name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', - bmp: '\u18B0-\u18FF' - }, - { - name: 'InVai', - bmp: '\uA500-\uA63F' - }, - { - name: 'InVariation_Selectors', - bmp: '\uFE00-\uFE0F' - }, - { - name: 'InVariation_Selectors_Supplement', - astral: '\uDB40[\uDD00-\uDDEF]' - }, - { - name: 'InVedic_Extensions', - bmp: '\u1CD0-\u1CFF' - }, - { - name: 'InVertical_Forms', - bmp: '\uFE10-\uFE1F' - }, - { - name: 'InWarang_Citi', - astral: '\uD806[\uDCA0-\uDCFF]' - }, - { - name: 'InYi_Radicals', - bmp: '\uA490-\uA4CF' - }, - { - name: 'InYi_Syllables', - bmp: '\uA000-\uA48F' - }, - { - name: 'InYijing_Hexagram_Symbols', - bmp: '\u4DC0-\u4DFF' - } - ]); -}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-categories.js b/scripts/node_modules/xregexp/src/addons/unicode-categories.js deleted file mode 100644 index a5a70f63..00000000 --- a/scripts/node_modules/xregexp/src/addons/unicode-categories.js +++ /dev/null @@ -1,234 +0,0 @@ -/*! - * XRegExp Unicode Categories 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -export default (XRegExp) => { - - /** - * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See - * category descriptions in UAX #44 . Token - * names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); - } - - XRegExp.addUnicodeData([ - { - name: 'C', - alias: 'Other', - isBmpLast: true, - bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' - }, - { - name: 'Cc', - alias: 'Control', - bmp: '\0-\x1F\x7F-\x9F' - }, - { - name: 'Cf', - alias: 'Format', - bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', - astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, - { - name: 'Cn', - alias: 'Unassigned', - bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, - { - name: 'Co', - alias: 'Private_Use', - bmp: '\uE000-\uF8FF', - astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' - }, - { - name: 'Cs', - alias: 'Surrogate', - bmp: '\uD800-\uDFFF' - }, - { - name: 'L', - alias: 'Letter', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, - { - name: 'Ll', - alias: 'Lowercase_Letter', - bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, - { - name: 'Lm', - alias: 'Modifier_Letter', - bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', - astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' - }, - { - name: 'Lo', - alias: 'Other_Letter', - bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, - { - name: 'Lt', - alias: 'Titlecase_Letter', - bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' - }, - { - name: 'Lu', - alias: 'Uppercase_Letter', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' - }, - { - name: 'M', - alias: 'Mark', - bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, - { - name: 'Mc', - alias: 'Spacing_Mark', - bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', - astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' - }, - { - name: 'Me', - alias: 'Enclosing_Mark', - bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' - }, - { - name: 'Mn', - alias: 'Nonspacing_Mark', - bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, - { - name: 'N', - alias: 'Number', - bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' - }, - { - name: 'Nd', - alias: 'Decimal_Number', - bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' - }, - { - name: 'Nl', - alias: 'Letter_Number', - bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', - astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' - }, - { - name: 'No', - alias: 'Other_Number', - bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', - astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' - }, - { - name: 'P', - alias: 'Punctuation', - bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, - { - name: 'Pc', - alias: 'Connector_Punctuation', - bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' - }, - { - name: 'Pd', - alias: 'Dash_Punctuation', - bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' - }, - { - name: 'Pe', - alias: 'Close_Punctuation', - bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' - }, - { - name: 'Pf', - alias: 'Final_Punctuation', - bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' - }, - { - name: 'Pi', - alias: 'Initial_Punctuation', - bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' - }, - { - name: 'Po', - alias: 'Other_Punctuation', - bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, - { - name: 'Ps', - alias: 'Open_Punctuation', - bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' - }, - { - name: 'S', - alias: 'Symbol', - bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, - { - name: 'Sc', - alias: 'Currency_Symbol', - bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' - }, - { - name: 'Sk', - alias: 'Modifier_Symbol', - bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', - astral: '\uD83C[\uDFFB-\uDFFF]' - }, - { - name: 'Sm', - alias: 'Math_Symbol', - bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', - astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' - }, - { - name: 'So', - alias: 'Other_Symbol', - bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, - { - name: 'Z', - alias: 'Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - }, - { - name: 'Zl', - alias: 'Line_Separator', - bmp: '\u2028' - }, - { - name: 'Zp', - alias: 'Paragraph_Separator', - bmp: '\u2029' - }, - { - name: 'Zs', - alias: 'Space_Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' - } - ]); -}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-properties.js b/scripts/node_modules/xregexp/src/addons/unicode-properties.js deleted file mode 100644 index 12773b79..00000000 --- a/scripts/node_modules/xregexp/src/addons/unicode-properties.js +++ /dev/null @@ -1,104 +0,0 @@ -/*! - * XRegExp Unicode Properties 4.0.0 - * - * Steven Levithan (c) 2012-2017 MIT License - * Unicode data by Mathias Bynens - */ - -export default (XRegExp) => { - - /** - * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See - * . Following are definitions of these properties from - * UAX #44 : - * - * - Alphabetic - * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + - * Lo + Nl + Other_Alphabetic. - * - * - Default_Ignorable_Code_Point - * For programmatic determination of default ignorable code points. New characters that should - * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, - * permitting programs to correctly handle the default rendering of such characters when not - * otherwise supported. - * - * - Lowercase - * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. - * - * - Noncharacter_Code_Point - * Code points permanently reserved for internal use. - * - * - Uppercase - * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. - * - * - White_Space - * Spaces, separator characters and other control characters which should be treated by - * programming languages as "white space" for the purpose of parsing elements. - * - * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS - * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are - * included in XRegExp's Unicode Categories and Unicode Scripts addons. - * - * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); - } - - const unicodeData = [ - { - name: 'ASCII', - bmp: '\0-\x7F' - }, - { - name: 'Alphabetic', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, - { - name: 'Any', - isBmpLast: true, - bmp: '\0-\uFFFF', - astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' - }, - { - name: 'Default_Ignorable_Code_Point', - bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', - astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' - }, - { - name: 'Lowercase', - bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, - { - name: 'Noncharacter_Code_Point', - bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', - astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, - { - name: 'Uppercase', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' - }, - { - name: 'White_Space', - bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - } - ]; - - // Add non-generated data - unicodeData.push({ - name: 'Assigned', - // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode - // Categories addon is required to use this property - inverseOf: 'Cn' - }); - - XRegExp.addUnicodeData(unicodeData); -}; diff --git a/scripts/node_modules/xregexp/src/addons/unicode-scripts.js b/scripts/node_modules/xregexp/src/addons/unicode-scripts.js deleted file mode 100644 index 84223099..00000000 --- a/scripts/node_modules/xregexp/src/addons/unicode-scripts.js +++ /dev/null @@ -1,584 +0,0 @@ -/*! - * XRegExp Unicode Scripts 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -export default (XRegExp) => { - - /** - * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, - * and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); - } - - XRegExp.addUnicodeData([ - { - name: 'Adlam', - astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' - }, - { - name: 'Ahom', - astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' - }, - { - name: 'Anatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE46]' - }, - { - name: 'Arabic', - bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', - astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' - }, - { - name: 'Armenian', - bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' - }, - { - name: 'Avestan', - astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' - }, - { - name: 'Balinese', - bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' - }, - { - name: 'Bamum', - bmp: '\uA6A0-\uA6F7', - astral: '\uD81A[\uDC00-\uDE38]' - }, - { - name: 'Bassa_Vah', - astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' - }, - { - name: 'Batak', - bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' - }, - { - name: 'Bengali', - bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' - }, - { - name: 'Bhaiksuki', - astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' - }, - { - name: 'Bopomofo', - bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' - }, - { - name: 'Brahmi', - astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' - }, - { - name: 'Braille', - bmp: '\u2800-\u28FF' - }, - { - name: 'Buginese', - bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' - }, - { - name: 'Buhid', - bmp: '\u1740-\u1753' - }, - { - name: 'Canadian_Aboriginal', - bmp: '\u1400-\u167F\u18B0-\u18F5' - }, - { - name: 'Carian', - astral: '\uD800[\uDEA0-\uDED0]' - }, - { - name: 'Caucasian_Albanian', - astral: '\uD801[\uDD30-\uDD63\uDD6F]' - }, - { - name: 'Chakma', - astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' - }, - { - name: 'Cham', - bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' - }, - { - name: 'Cherokee', - bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' - }, - { - name: 'Common', - bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', - astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, - { - name: 'Coptic', - bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' - }, - { - name: 'Cuneiform', - astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' - }, - { - name: 'Cypriot', - astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' - }, - { - name: 'Cyrillic', - bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' - }, - { - name: 'Deseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, - { - name: 'Devanagari', - bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' - }, - { - name: 'Duployan', - astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' - }, - { - name: 'Egyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' - }, - { - name: 'Elbasan', - astral: '\uD801[\uDD00-\uDD27]' - }, - { - name: 'Ethiopic', - bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' - }, - { - name: 'Georgian', - bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' - }, - { - name: 'Glagolitic', - bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', - astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' - }, - { - name: 'Gothic', - astral: '\uD800[\uDF30-\uDF4A]' - }, - { - name: 'Grantha', - astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' - }, - { - name: 'Greek', - bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', - astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' - }, - { - name: 'Gujarati', - bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' - }, - { - name: 'Gurmukhi', - bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' - }, - { - name: 'Han', - bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', - astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, - { - name: 'Hangul', - bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' - }, - { - name: 'Hanunoo', - bmp: '\u1720-\u1734' - }, - { - name: 'Hatran', - astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' - }, - { - name: 'Hebrew', - bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' - }, - { - name: 'Hiragana', - bmp: '\u3041-\u3096\u309D-\u309F', - astral: '\uD82C\uDC01|\uD83C\uDE00' - }, - { - name: 'Imperial_Aramaic', - astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' - }, - { - name: 'Inherited', - bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', - astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' - }, - { - name: 'Inscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' - }, - { - name: 'Inscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' - }, - { - name: 'Javanese', - bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' - }, - { - name: 'Kaithi', - astral: '\uD804[\uDC80-\uDCC1]' - }, - { - name: 'Kannada', - bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' - }, - { - name: 'Katakana', - bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', - astral: '\uD82C\uDC00' - }, - { - name: 'Kayah_Li', - bmp: '\uA900-\uA92D\uA92F' - }, - { - name: 'Kharoshthi', - astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' - }, - { - name: 'Khmer', - bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' - }, - { - name: 'Khojki', - astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' - }, - { - name: 'Khudawadi', - astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' - }, - { - name: 'Lao', - bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' - }, - { - name: 'Latin', - bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' - }, - { - name: 'Lepcha', - bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' - }, - { - name: 'Limbu', - bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' - }, - { - name: 'Linear_A', - astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' - }, - { - name: 'Linear_B', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' - }, - { - name: 'Lisu', - bmp: '\uA4D0-\uA4FF' - }, - { - name: 'Lycian', - astral: '\uD800[\uDE80-\uDE9C]' - }, - { - name: 'Lydian', - astral: '\uD802[\uDD20-\uDD39\uDD3F]' - }, - { - name: 'Mahajani', - astral: '\uD804[\uDD50-\uDD76]' - }, - { - name: 'Malayalam', - bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' - }, - { - name: 'Mandaic', - bmp: '\u0840-\u085B\u085E' - }, - { - name: 'Manichaean', - astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' - }, - { - name: 'Marchen', - astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' - }, - { - name: 'Meetei_Mayek', - bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' - }, - { - name: 'Mende_Kikakui', - astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' - }, - { - name: 'Meroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' - }, - { - name: 'Meroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, - { - name: 'Miao', - astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' - }, - { - name: 'Modi', - astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' - }, - { - name: 'Mongolian', - bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', - astral: '\uD805[\uDE60-\uDE6C]' - }, - { - name: 'Mro', - astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' - }, - { - name: 'Multani', - astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' - }, - { - name: 'Myanmar', - bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' - }, - { - name: 'Nabataean', - astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' - }, - { - name: 'New_Tai_Lue', - bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' - }, - { - name: 'Newa', - astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' - }, - { - name: 'Nko', - bmp: '\u07C0-\u07FA' - }, - { - name: 'Ogham', - bmp: '\u1680-\u169C' - }, - { - name: 'Ol_Chiki', - bmp: '\u1C50-\u1C7F' - }, - { - name: 'Old_Hungarian', - astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' - }, - { - name: 'Old_Italic', - astral: '\uD800[\uDF00-\uDF23]' - }, - { - name: 'Old_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, - { - name: 'Old_Permic', - astral: '\uD800[\uDF50-\uDF7A]' - }, - { - name: 'Old_Persian', - astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' - }, - { - name: 'Old_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, - { - name: 'Old_Turkic', - astral: '\uD803[\uDC00-\uDC48]' - }, - { - name: 'Oriya', - bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' - }, - { - name: 'Osage', - astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' - }, - { - name: 'Osmanya', - astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' - }, - { - name: 'Pahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' - }, - { - name: 'Palmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, - { - name: 'Pau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEF8]' - }, - { - name: 'Phags_Pa', - bmp: '\uA840-\uA877' - }, - { - name: 'Phoenician', - astral: '\uD802[\uDD00-\uDD1B\uDD1F]' - }, - { - name: 'Psalter_Pahlavi', - astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' - }, - { - name: 'Rejang', - bmp: '\uA930-\uA953\uA95F' - }, - { - name: 'Runic', - bmp: '\u16A0-\u16EA\u16EE-\u16F8' - }, - { - name: 'Samaritan', - bmp: '\u0800-\u082D\u0830-\u083E' - }, - { - name: 'Saurashtra', - bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' - }, - { - name: 'Sharada', - astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' - }, - { - name: 'Shavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, - { - name: 'Siddham', - astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' - }, - { - name: 'SignWriting', - astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' - }, - { - name: 'Sinhala', - bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', - astral: '\uD804[\uDDE1-\uDDF4]' - }, - { - name: 'Sora_Sompeng', - astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' - }, - { - name: 'Sundanese', - bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' - }, - { - name: 'Syloti_Nagri', - bmp: '\uA800-\uA82B' - }, - { - name: 'Syriac', - bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' - }, - { - name: 'Tagalog', - bmp: '\u1700-\u170C\u170E-\u1714' - }, - { - name: 'Tagbanwa', - bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' - }, - { - name: 'Tai_Le', - bmp: '\u1950-\u196D\u1970-\u1974' - }, - { - name: 'Tai_Tham', - bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' - }, - { - name: 'Tai_Viet', - bmp: '\uAA80-\uAAC2\uAADB-\uAADF' - }, - { - name: 'Takri', - astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' - }, - { - name: 'Tamil', - bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' - }, - { - name: 'Tangut', - astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' - }, - { - name: 'Telugu', - bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' - }, - { - name: 'Thaana', - bmp: '\u0780-\u07B1' - }, - { - name: 'Thai', - bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' - }, - { - name: 'Tibetan', - bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' - }, - { - name: 'Tifinagh', - bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' - }, - { - name: 'Tirhuta', - astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' - }, - { - name: 'Ugaritic', - astral: '\uD800[\uDF80-\uDF9D\uDF9F]' - }, - { - name: 'Vai', - bmp: '\uA500-\uA62B' - }, - { - name: 'Warang_Citi', - astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' - }, - { - name: 'Yi', - bmp: '\uA000-\uA48C\uA490-\uA4C6' - } - ]); -}; diff --git a/scripts/node_modules/xregexp/src/index.js b/scripts/node_modules/xregexp/src/index.js deleted file mode 100644 index 5ea36461..00000000 --- a/scripts/node_modules/xregexp/src/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import XRegExp from './xregexp'; - -import build from './addons/build'; -import matchrecursive from './addons/matchrecursive'; -import unicodeBase from './addons/unicode-base'; -import unicodeBlocks from './addons/unicode-blocks'; -import unicodeCategories from './addons/unicode-categories'; -import unicodeProperties from './addons/unicode-properties'; -import unicodeScripts from './addons/unicode-scripts'; - -build(XRegExp); -matchrecursive(XRegExp); -unicodeBase(XRegExp); -unicodeBlocks(XRegExp); -unicodeCategories(XRegExp); -unicodeProperties(XRegExp); -unicodeScripts(XRegExp); - -export default XRegExp; diff --git a/scripts/node_modules/xregexp/src/xregexp.js b/scripts/node_modules/xregexp/src/xregexp.js deleted file mode 100644 index 1a95dfd4..00000000 --- a/scripts/node_modules/xregexp/src/xregexp.js +++ /dev/null @@ -1,1827 +0,0 @@ -/*! - * XRegExp 4.0.0 - * - * Steven Levithan (c) 2007-2017 MIT License - */ - -/** - * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and - * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to - * make your client-side grepping simpler and more powerful, while freeing you from related - * cross-browser inconsistencies. - */ - -// ==--------------------------== -// Private stuff -// ==--------------------------== - -// Property name used for extended regex instance data -const REGEX_DATA = 'xregexp'; -// Optional features that can be installed and uninstalled -const features = { - astral: false -}; -// Native methods to use and restore ('native' is an ES3 reserved keyword) -const nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split -}; -// Storage for fixed/extended native methods -const fixed = {}; -// Storage for regexes cached by `XRegExp.cache` -let regexCache = {}; -// Storage for pattern details cached by the `XRegExp` constructor -let patternCache = {}; -// Storage for regex syntax tokens added internally or by `XRegExp.addToken` -const tokens = []; -// Token scopes -const defaultScope = 'default'; -const classScope = 'class'; -// Regexes that match native regex syntax, including octals -const nativeTokens = { - // Any native multicharacter token in default scope, or any single character - 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, - // Any native multicharacter token in character class scope, or any single character - 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ -}; -// Any backreference or dollar-prefixed character in replacement strings -const replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; -// Check for correct `exec` handling of nonparticipating capturing groups -const correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; -// Check for ES6 `flags` prop support -const hasFlagsProp = /x/.flags !== undefined; -// Shortcut to `Object.prototype.toString` -const toString = {}.toString; - -function hasNativeFlag(flag) { - // Can't check based on the presence of properties/getters since browsers might support such - // properties even when they don't support the corresponding flag in regex construction (tested - // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` - // throws an error) - let isSupported = true; - try { - // Can't use regex literals for testing even in a `try` because regex literals with - // unsupported flags cause a compilation error in IE - new RegExp('', flag); - } catch (exception) { - isSupported = false; - } - return isSupported; -} -// Check for ES6 `u` flag support -const hasNativeU = hasNativeFlag('u'); -// Check for ES6 `y` flag support -const hasNativeY = hasNativeFlag('y'); -// Tracker for known flags, including addon flags -const registeredFlags = { - g: true, - i: true, - m: true, - u: hasNativeU, - y: hasNativeY -}; - -/** - * Attaches extended data and `XRegExp.prototype` properties to a regex object. - * - * @private - * @param {RegExp} regex Regex to augment. - * @param {Array} captureNames Array with capture names, or `null`. - * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. - * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. - * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * @returns {RegExp} Augmented regex. - */ -function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { - let p; - - regex[REGEX_DATA] = { - captureNames - }; - - if (isInternalOnly) { - return regex; - } - - // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value - if (regex.__proto__) { - regex.__proto__ = XRegExp.prototype; - } else { - for (p in XRegExp.prototype) { - // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this - // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` - // extensions exist on `regex.prototype` anyway - regex[p] = XRegExp.prototype[p]; - } - } - - regex[REGEX_DATA].source = xSource; - // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order - regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; - - return regex; -} - -/** - * Removes any duplicate characters from the provided string. - * - * @private - * @param {String} str String to remove duplicate characters from. - * @returns {String} String with any duplicate characters removed. - */ -function clipDuplicates(str) { - return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); -} - -/** - * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` - * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing - * flags g and y while copying the regex. - * - * @private - * @param {RegExp} regex Regex to copy. - * @param {Object} [options] Options object with optional properties: - * - `addG` {Boolean} Add flag g while copying the regex. - * - `addY` {Boolean} Add flag y while copying the regex. - * - `removeG` {Boolean} Remove flag g while copying the regex. - * - `removeY` {Boolean} Remove flag y while copying the regex. - * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * - `source` {String} Overrides `.source`, for special cases. - * @returns {RegExp} Copy of the provided regex, possibly with modified flags. - */ -function copyRegex(regex, options) { - if (!XRegExp.isRegExp(regex)) { - throw new TypeError('Type RegExp expected'); - } - - const xData = regex[REGEX_DATA] || {}; - let flags = getNativeFlags(regex); - let flagsToAdd = ''; - let flagsToRemove = ''; - let xregexpSource = null; - let xregexpFlags = null; - - options = options || {}; - - if (options.removeG) {flagsToRemove += 'g';} - if (options.removeY) {flagsToRemove += 'y';} - if (flagsToRemove) { - flags = nativ.replace.call(flags, new RegExp(`[${flagsToRemove}]+`, 'g'), ''); - } - - if (options.addG) {flagsToAdd += 'g';} - if (options.addY) {flagsToAdd += 'y';} - if (flagsToAdd) { - flags = clipDuplicates(flags + flagsToAdd); - } - - if (!options.isInternalOnly) { - if (xData.source !== undefined) { - xregexpSource = xData.source; - } - // null or undefined; don't want to add to `flags` if the previous value was null, since - // that indicates we're not tracking original precompilation flags - if (xData.flags != null) { - // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never - // removed for non-internal regexes, so don't need to handle it - xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; - } - } - - // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid - // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and - // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the - // translation to native regex syntax - regex = augment( - new RegExp(options.source || regex.source, flags), - hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, - xregexpSource, - xregexpFlags, - options.isInternalOnly - ); - - return regex; -} - -/** - * Converts hexadecimal to decimal. - * - * @private - * @param {String} hex - * @returns {Number} - */ -function dec(hex) { - return parseInt(hex, 16); -} - -/** - * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an - * inline comment or whitespace with flag x. This is used directly as a token handler function - * passed to `XRegExp.addToken`. - * - * @private - * @param {String} match Match arg of `XRegExp.addToken` handler - * @param {String} scope Scope arg of `XRegExp.addToken` handler - * @param {String} flags Flags arg of `XRegExp.addToken` handler - * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. - */ -function getContextualTokenSeparator(match, scope, flags) { - if ( - // No need to separate tokens if at the beginning or end of a group - match.input[match.index - 1] === '(' || - match.input[match.index + match[0].length] === ')' || - // Avoid separating tokens when the following token is a quantifier - isQuantifierNext(match.input, match.index + match[0].length, flags) - ) { - return ''; - } - // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. - // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax - // error `(? :` into `(?:`. - return '(?:)'; -} - -/** - * Returns native `RegExp` flags used by a regex object. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {String} Native flags in use. - */ -function getNativeFlags(regex) { - return hasFlagsProp ? - regex.flags : - // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation - // with an empty string) allows this to continue working predictably when - // `XRegExp.proptotype.toString` is overridden - nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; -} - -/** - * Determines whether a regex has extended instance data used to track capture names. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {Boolean} Whether the regex uses named capture. - */ -function hasNamedCapture(regex) { - return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); -} - -/** - * Converts decimal to hexadecimal. - * - * @private - * @param {Number|String} dec - * @returns {String} - */ -function hex(dec) { - return parseInt(dec, 10).toString(16); -} - -/** - * Checks whether the next nonignorable token after the specified position is a quantifier. - * - * @private - * @param {String} pattern Pattern to search within. - * @param {Number} pos Index in `pattern` to search at. - * @param {String} flags Flags used by the pattern. - * @returns {Boolean} Whether the next nonignorable token is a quantifier. - */ -function isQuantifierNext(pattern, pos, flags) { - const inlineCommentPattern = '\\(\\?#[^)]*\\)'; - const lineCommentPattern = '#[^#\\n]*'; - const quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; - return nativ.test.call( - flags.includes('x') ? - // Ignore any leading whitespace, line comments, and inline comments - new RegExp(`^(?:\\s|${lineCommentPattern}|${inlineCommentPattern})*(?:${quantifierPattern})`) : - // Ignore any leading inline comments - new RegExp(`^(?:${inlineCommentPattern})*(?:${quantifierPattern})`), - pattern.slice(pos) - ); -} - -/** - * Determines whether a value is of the specified type, by resolving its internal [[Class]]. - * - * @private - * @param {*} value Object to check. - * @param {String} type Type to check for, in TitleCase. - * @returns {Boolean} Whether the object matches the type. - */ -function isType(value, type) { - return toString.call(value) === `[object ${type}]`; -} - -/** - * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. - * - * @private - * @param {String} str - * @returns {String} - */ -function pad4(str) { - while (str.length < 4) { - str = `0${str}`; - } - return str; -} - -/** - * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads - * the flag preparation logic from the `XRegExp` constructor. - * - * @private - * @param {String} pattern Regex pattern, possibly with a leading mode modifier. - * @param {String} flags Any combination of flags. - * @returns {Object} Object with properties `pattern` and `flags`. - */ -function prepareFlags(pattern, flags) { - let i; - - // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags - if (clipDuplicates(flags) !== flags) { - throw new SyntaxError(`Invalid duplicate regex flag ${flags}`); - } - - // Strip and apply a leading mode modifier with any combination of flags except g or y - pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, ($0, $1) => { - if (nativ.test.call(/[gy]/, $1)) { - throw new SyntaxError(`Cannot use flag g or y in mode modifier ${$0}`); - } - // Allow duplicate flags within the mode modifier - flags = clipDuplicates(flags + $1); - return ''; - }); - - // Throw on unknown native or nonnative flags - for (i = 0; i < flags.length; ++i) { - if (!registeredFlags[flags[i]]) { - throw new SyntaxError(`Unknown regex flag ${flags[i]}`); - } - } - - return { - pattern, - flags - }; -} - -/** - * Prepares an options object from the given value. - * - * @private - * @param {String|Object} value Value to convert to an options object. - * @returns {Object} Options object. - */ -function prepareOptions(value) { - const options = {}; - - if (isType(value, 'String')) { - XRegExp.forEach(value, /[^\s,]+/, (match) => { - options[match] = true; - }); - - return options; - } - - return value; -} - -/** - * Registers a flag so it doesn't throw an 'unknown flag' error. - * - * @private - * @param {String} flag Single-character flag to register. - */ -function registerFlag(flag) { - if (!/^[\w$]$/.test(flag)) { - throw new Error('Flag must be a single character A-Za-z0-9_$'); - } - - registeredFlags[flag] = true; -} - -/** - * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified - * position, until a match is found. - * - * @private - * @param {String} pattern Original pattern from which an XRegExp object is being built. - * @param {String} flags Flags being used to construct the regex. - * @param {Number} pos Position to search for tokens within `pattern`. - * @param {Number} scope Regex scope to apply: 'default' or 'class'. - * @param {Object} context Context object to use for token handler functions. - * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. - */ -function runTokens(pattern, flags, pos, scope, context) { - let i = tokens.length; - const leadChar = pattern[pos]; - let result = null; - let match; - let t; - - // Run in reverse insertion order - while (i--) { - t = tokens[i]; - if ( - (t.leadChar && t.leadChar !== leadChar) || - (t.scope !== scope && t.scope !== 'all') || - (t.flag && !flags.includes(t.flag)) - ) { - continue; - } - - match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); - if (match) { - result = { - matchLength: match[0].length, - output: t.handler.call(context, match, scope, flags), - reparse: t.reparse - }; - // Finished with token tests - break; - } - } - - return result; -} - -/** - * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to - * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if - * the Unicode Base addon is not available, since flag A is registered by that addon. - * - * @private - * @param {Boolean} on `true` to enable; `false` to disable. - */ -function setAstral(on) { - features.astral = on; -} - -/** - * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow - * the ES5 abstract operation `ToObject`. - * - * @private - * @param {*} value Object to check and return. - * @returns {*} The provided object. - */ -function toObject(value) { - // null or undefined - if (value == null) { - throw new TypeError('Cannot convert null or undefined to object'); - } - - return value; -} - -// ==--------------------------== -// Constructor -// ==--------------------------== - -/** - * Creates an extended regular expression object for matching text with a pattern. Differs from a - * native regular expression in that additional syntax and flags are supported. The returned object - * is in fact a native `RegExp` and works with all native methods. - * - * @class XRegExp - * @constructor - * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. - * @param {String} [flags] Any combination of flags. - * Native flags: - * - `g` - global - * - `i` - ignore case - * - `m` - multiline anchors - * - `u` - unicode (ES6) - * - `y` - sticky (Firefox 3+, ES6) - * Additional XRegExp flags: - * - `n` - explicit capture - * - `s` - dot matches all (aka singleline) - * - `x` - free-spacing and line comments (aka extended) - * - `A` - astral (requires the Unicode Base addon) - * Flags cannot be provided when constructing one `RegExp` from another. - * @returns {RegExp} Extended regular expression object. - * @example - * - * // With named capture and flag x - * XRegExp(`(? [0-9]{4} ) -? # year - * (? [0-9]{2} ) -? # month - * (? [0-9]{2} ) # day`, 'x'); - * - * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) - * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and - * // have fresh `lastIndex` properties (set to zero). - * XRegExp(/regex/); - */ -function XRegExp(pattern, flags) { - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) { - throw new TypeError('Cannot supply flags when copying a RegExp'); - } - return copyRegex(pattern); - } - - // Copy the argument behavior of `RegExp` - pattern = pattern === undefined ? '' : String(pattern); - flags = flags === undefined ? '' : String(flags); - - if (XRegExp.isInstalled('astral') && !flags.includes('A')) { - // This causes an error to be thrown if the Unicode Base addon is not available - flags += 'A'; - } - - if (!patternCache[pattern]) { - patternCache[pattern] = {}; - } - - if (!patternCache[pattern][flags]) { - const context = { - hasNamedCapture: false, - captureNames: [] - }; - let scope = defaultScope; - let output = ''; - let pos = 0; - let result; - - // Check for flag-related errors, and strip/apply flags in a leading mode modifier - const applied = prepareFlags(pattern, flags); - let appliedPattern = applied.pattern; - const appliedFlags = applied.flags; - - // Use XRegExp's tokens to translate the pattern to a native regex pattern. - // `appliedPattern.length` may change on each iteration if tokens use `reparse` - while (pos < appliedPattern.length) { - do { - // Check for custom tokens at the current position - result = runTokens(appliedPattern, appliedFlags, pos, scope, context); - // If the matched token used the `reparse` option, splice its output into the - // pattern before running tokens again at the same position - if (result && result.reparse) { - appliedPattern = appliedPattern.slice(0, pos) + - result.output + - appliedPattern.slice(pos + result.matchLength); - } - } while (result && result.reparse); - - if (result) { - output += result.output; - pos += (result.matchLength || 1); - } else { - // Get the native token at the current position - const token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; - output += token; - pos += token.length; - if (token === '[' && scope === defaultScope) { - scope = classScope; - } else if (token === ']' && scope === classScope) { - scope = defaultScope; - } - } - } - - patternCache[pattern][flags] = { - // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty - // groups are sometimes inserted during regex transpilation in order to keep tokens - // separated. However, more than one empty group in a row is never needed. - pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), - // Strip all but native flags - flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), - // `context.captureNames` has an item for each capturing group, even if unnamed - captures: context.hasNamedCapture ? context.captureNames : null - }; - } - - const generated = patternCache[pattern][flags]; - return augment( - new RegExp(generated.pattern, generated.flags), - generated.captures, - pattern, - flags - ); -} - -// Add `RegExp.prototype` to the prototype chain -XRegExp.prototype = new RegExp(); - -// ==--------------------------== -// Public properties -// ==--------------------------== - -/** - * The XRegExp version number as a string containing three dot-separated parts. For example, - * '2.0.0-beta-3'. - * - * @static - * @memberOf XRegExp - * @type String - */ -XRegExp.version = '4.0.0'; - -// ==--------------------------== -// Public methods -// ==--------------------------== - -// Intentionally undocumented; used in tests and addons -XRegExp._clipDuplicates = clipDuplicates; -XRegExp._hasNativeFlag = hasNativeFlag; -XRegExp._dec = dec; -XRegExp._hex = hex; -XRegExp._pad4 = pad4; - -/** - * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to - * create XRegExp addons. If more than one token can match the same string, the last added wins. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex object that matches the new token. - * @param {Function} handler Function that returns a new pattern string (using native regex syntax) - * to replace the matched token within all future XRegExp regexes. Has access to persistent - * properties of the regex being built, through `this`. Invoked with three arguments: - * - The match array, with named backreference properties. - * - The regex scope where the match was found: 'default' or 'class'. - * - The flags used by the regex, including any flags in a leading mode modifier. - * The handler function becomes part of the XRegExp construction process, so be careful not to - * construct XRegExps within the function or you will trigger infinite recursion. - * @param {Object} [options] Options object with optional properties: - * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. - * - `flag` {String} Single-character flag that triggers the token. This also registers the - * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. - * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are - * not required to trigger the token. This registers the flags, to prevent XRegExp from - * throwing an 'unknown flag' error when any of the flags are used. - * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as - * final, and instead be reparseable by other tokens (including the current token). Allows - * token chaining or deferring. - * - `leadChar` {String} Single character that occurs at the beginning of any successful match - * of the token (not always applicable). This doesn't change the behavior of the token unless - * you provide an erroneous value. However, providing it can increase the token's performance - * since the token can be skipped at any positions where this character doesn't appear. - * @example - * - * // Basic usage: Add \a for the ALERT control code - * XRegExp.addToken( - * /\\a/, - * () => '\\x07', - * {scope: 'all'} - * ); - * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true - * - * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. - * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of - * // character classes only) - * XRegExp.addToken( - * /([?*+]|{\d+(?:,\d*)?})(\??)/, - * (match) => `${match[1]}${match[2] ? '' : '?'}`, - * {flag: 'U'} - * ); - * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' - * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' - */ -XRegExp.addToken = (regex, handler, options) => { - options = options || {}; - let optionalFlags = options.optionalFlags; - let i; - - if (options.flag) { - registerFlag(options.flag); - } - - if (optionalFlags) { - optionalFlags = nativ.split.call(optionalFlags, ''); - for (i = 0; i < optionalFlags.length; ++i) { - registerFlag(optionalFlags[i]); - } - } - - // Add to the private list of syntax tokens - tokens.push({ - regex: copyRegex(regex, { - addG: true, - addY: hasNativeY, - isInternalOnly: true - }), - handler, - scope: options.scope || defaultScope, - flag: options.flag, - reparse: options.reparse, - leadChar: options.leadChar - }); - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags - // might now produce different results - XRegExp.cache.flush('patterns'); -}; - -/** - * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with - * the same pattern and flag combination, the cached copy of the regex is returned. - * - * @memberOf XRegExp - * @param {String} pattern Regex pattern string. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Cached XRegExp object. - * @example - * - * while (match = XRegExp.cache('.', 'gs').exec(str)) { - * // The regex is compiled once only - * } - */ -XRegExp.cache = (pattern, flags) => { - if (!regexCache[pattern]) { - regexCache[pattern] = {}; - } - return regexCache[pattern][flags] || ( - regexCache[pattern][flags] = XRegExp(pattern, flags) - ); -}; - -// Intentionally undocumented; used in tests -XRegExp.cache.flush = (cacheName) => { - if (cacheName === 'patterns') { - // Flush the pattern cache used by the `XRegExp` constructor - patternCache = {}; - } else { - // Flush the regex cache populated by `XRegExp.cache` - regexCache = {}; - } -}; - -/** - * Escapes any regular expression metacharacters, for use when matching literal strings. The result - * can safely be used at any point within a regex that uses any flags. - * - * @memberOf XRegExp - * @param {String} str String to escape. - * @returns {String} String with regex metacharacters escaped. - * @example - * - * XRegExp.escape('Escaped? <.>'); - * // -> 'Escaped\?\ <\.>' - */ -XRegExp.escape = (str) => nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); - -/** - * Executes a regex search in a specified string. Returns a match array or `null`. If the provided - * regex uses named capture, named backreference properties are included on the match array. - * Optional `pos` and `sticky` arguments specify the search start position, and whether the match - * must start at the specified position only. The `lastIndex` property of the provided regex is not - * used, but is updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.exec` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Array} Match array with named backreference properties, or `null`. - * @example - * - * // Basic use, with named backreference - * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); - * match.hex; // -> '2620' - * - * // With pos and sticky, in a loop - * let pos = 2, result = [], match; - * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { - * result.push(match[1]); - * pos = match.index + match[0].length; - * } - * // result -> ['2', '3', '4'] - */ -XRegExp.exec = (str, regex, pos, sticky) => { - let cacheKey = 'g'; - let addY = false; - let fakeY = false; - let match; - - addY = hasNativeY && !!(sticky || (regex.sticky && sticky !== false)); - if (addY) { - cacheKey += 'y'; - } else if (sticky) { - // Simulate sticky matching by appending an empty capture to the original regex. The - // resulting regex will succeed no matter what at the current index (set with `lastIndex`), - // and will not search the rest of the subject string. We'll know that the original regex - // has failed if that last capture is `''` rather than `undefined` (i.e., if that last - // capture participated in the match). - fakeY = true; - cacheKey += 'FakeY'; - } - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.match`/`replace` - const r2 = regex[REGEX_DATA][cacheKey] || ( - regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: true, - addY, - source: fakeY ? `${regex.source}|()` : undefined, - removeY: sticky === false, - isInternalOnly: true - }) - ); - - pos = pos || 0; - r2.lastIndex = pos; - - // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. - match = fixed.exec.call(r2, str); - - // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means - // the original regexp failed (see above). - if (fakeY && match && match.pop() === '') { - match = null; - } - - if (regex.global) { - regex.lastIndex = match ? r2.lastIndex : 0; - } - - return match; -}; - -/** - * Executes a provided function once per regex match. Searches always start at the beginning of the - * string and continue until the end, regardless of the state of the regex's `global` property and - * initial `lastIndex`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Function} callback Function to execute for each match. Invoked with four arguments: - * - The match array, with named backreference properties. - * - The zero-based match index. - * - The string being traversed. - * - The regex object being used to traverse the string. - * @example - * - * // Extracts every other digit from a string - * const evens = []; - * XRegExp.forEach('1a2345', /\d/, (match, i) => { - * if (i % 2) evens.push(+match[0]); - * }); - * // evens -> [2, 4] - */ -XRegExp.forEach = (str, regex, callback) => { - let pos = 0; - let i = -1; - let match; - - while ((match = XRegExp.exec(str, regex, pos))) { - // Because `regex` is provided to `callback`, the function could use the deprecated/ - // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` - // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, - // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of - // regexes, mutating the regex will not have any effect on the iteration or matched strings, - // which is a nice side effect that brings extra safety. - callback(match, ++i, str, regex); - - pos = match.index + (match[0].length || 1); - } -}; - -/** - * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with - * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native - * regexes are not recompiled using XRegExp syntax. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex to globalize. - * @returns {RegExp} Copy of the provided regex with flag `g` added. - * @example - * - * const globalCopy = XRegExp.globalize(/regex/); - * globalCopy.global; // -> true - */ -XRegExp.globalize = (regex) => copyRegex(regex, {addG: true}); - -/** - * Installs optional features according to the specified options. Can be undone using - * `XRegExp.uninstall`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.install({ - * // Enables support for astral code points in Unicode addons (implicitly sets flag A) - * astral: true - * }); - * - * // With an options string - * XRegExp.install('astral'); - */ -XRegExp.install = (options) => { - options = prepareOptions(options); - - if (!features.astral && options.astral) { - setAstral(true); - } -}; - -/** - * Checks whether an individual optional feature is installed. - * - * @memberOf XRegExp - * @param {String} feature Name of the feature to check. One of: - * - `astral` - * @returns {Boolean} Whether the feature is installed. - * @example - * - * XRegExp.isInstalled('astral'); - */ -XRegExp.isInstalled = (feature) => !!(features[feature]); - -/** - * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes - * created in another frame, when `instanceof` and `constructor` checks would fail. - * - * @memberOf XRegExp - * @param {*} value Object to check. - * @returns {Boolean} Whether the object is a `RegExp` object. - * @example - * - * XRegExp.isRegExp('string'); // -> false - * XRegExp.isRegExp(/regex/i); // -> true - * XRegExp.isRegExp(RegExp('^', 'm')); // -> true - * XRegExp.isRegExp(XRegExp('(?s).')); // -> true - */ -XRegExp.isRegExp = (value) => toString.call(value) === '[object RegExp]'; // isType(value, 'RegExp'); - -/** - * Returns the first matched string, or in global mode, an array containing all matched strings. - * This is essentially a more convenient re-implementation of `String.prototype.match` that gives - * the result types you actually want (string instead of `exec`-style array in match-first mode, - * and an empty array instead of `null` when no matches are found in match-all mode). It also lets - * you override flag g and ignore `lastIndex`, and fixes browser bugs. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to - * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, - * `scope` is 'all'. - * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all - * mode: Array of all matched strings, or an empty array. - * @example - * - * // Match first - * XRegExp.match('abc', /\w/); // -> 'a' - * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' - * XRegExp.match('abc', /x/g, 'one'); // -> null - * - * // Match all - * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /x/, 'all'); // -> [] - */ -XRegExp.match = (str, regex, scope) => { - const global = (regex.global && scope !== 'one') || scope === 'all'; - const cacheKey = ((global ? 'g' : '') + (regex.sticky ? 'y' : '')) || 'noGY'; - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`replace` - const r2 = regex[REGEX_DATA][cacheKey] || ( - regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - }) - ); - - const result = nativ.match.call(toObject(str), r2); - - if (regex.global) { - regex.lastIndex = ( - (scope === 'one' && result) ? - // Can't use `r2.lastIndex` since `r2` is nonglobal in this case - (result.index + result[0].length) : 0 - ); - } - - return global ? (result || []) : (result && result[0]); -}; - -/** - * Retrieves the matches from searching a string using a chain of regexes that successively search - * within previous matches. The provided `chain` array can contain regexes and or objects with - * `regex` and `backref` properties. When a backreference is specified, the named or numbered - * backreference is passed forward to the next regex or returned. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} chain Regexes that each search for matches within preceding results. - * @returns {Array} Matches by the last regex in the chain, or an empty array. - * @example - * - * // Basic usage; matches numbers within tags - * XRegExp.matchChain('1 2 3 4 a 56', [ - * XRegExp('(?is).*?'), - * /\d+/ - * ]); - * // -> ['2', '4', '56'] - * - * // Passing forward and returning specific backreferences - * html = '
XRegExp\ - * Google'; - * XRegExp.matchChain(html, [ - * {regex: //i, backref: 1}, - * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} - * ]); - * // -> ['xregexp.com', 'www.google.com'] - */ -XRegExp.matchChain = (str, chain) => (function recurseChain(values, level) { - const item = chain[level].regex ? chain[level] : {regex: chain[level]}; - const matches = []; - - function addMatch(match) { - if (item.backref) { - // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the - // `undefined`s for backreferences to nonparticipating capturing groups. In such - // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw - // the exception, so also check if the backreference is a number that is within the - // bounds of the array. - if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { - throw new ReferenceError(`Backreference to undefined group: ${item.backref}`); - } - - matches.push(match[item.backref] || ''); - } else { - matches.push(match[0]); - } - } - - for (let i = 0; i < values.length; ++i) { - XRegExp.forEach(values[i], item.regex, addMatch); - } - - return ((level === chain.length - 1) || !matches.length) ? - matches : - recurseChain(matches, level + 1); -}([str], 0)); - -/** - * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string - * or regex, and the replacement can be a string or a function to be called for each match. To - * perform a global search and replace, use the optional `scope` argument or include flag g if using - * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. - * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser - * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * Replacement strings can include special replacement syntax: - * - $$ - Inserts a literal $ character. - * - $&, $0 - Inserts the matched substring. - * - $` - Inserts the string that precedes the matched substring (left context). - * - $' - Inserts the string that follows the matched substring (right context). - * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts - * backreference n/nn. - * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing - * group, inserts backreference n. - * Replacement functions are invoked with three or more arguments: - * - The matched substring (corresponds to $& above). Named backreferences are accessible as - * properties of this first argument. - * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). - * - The zero-based index of the match within the total search string. - * - The total string being searched. - * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not - * explicitly specified and using a regex with flag g, `scope` is 'all'. - * @returns {String} New string with one or all matches replaced. - * @example - * - * // Regex search, using named backreferences in replacement string - * const name = XRegExp('(?\\w+) (?\\w+)'); - * XRegExp.replace('John Smith', name, '$, $'); - * // -> 'Smith, John' - * - * // Regex search, using named backreferences in replacement function - * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); - * // -> 'Smith, John' - * - * // String search, with replace-all - * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); - * // -> 'XRegExp builds XRegExps' - */ -XRegExp.replace = (str, search, replacement, scope) => { - const isRegex = XRegExp.isRegExp(search); - const global = (search.global && scope !== 'one') || scope === 'all'; - const cacheKey = ((global ? 'g' : '') + (search.sticky ? 'y' : '')) || 'noGY'; - let s2 = search; - - if (isRegex) { - search[REGEX_DATA] = search[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s - // `lastIndex` isn't updated *during* replacement iterations - s2 = search[REGEX_DATA][cacheKey] || ( - search[REGEX_DATA][cacheKey] = copyRegex(search, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - }) - ); - } else if (global) { - s2 = new RegExp(XRegExp.escape(String(search)), 'g'); - } - - // Fixed `replace` required for named backreferences, etc. - const result = fixed.replace.call(toObject(str), s2, replacement); - - if (isRegex && search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } - - return result; -}; - -/** - * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an - * array of replacement details. Later replacements operate on the output of earlier replacements. - * Replacement details are accepted as an array with a regex or string to search for, the - * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp - * replacement text syntax, which supports named backreference properties via `${name}` or - * `$`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} replacements Array of replacement detail arrays. - * @returns {String} New string with all replacements. - * @example - * - * str = XRegExp.replaceEach(str, [ - * [XRegExp('(?a)'), 'z${name}'], - * [/b/gi, 'y'], - * [/c/g, 'x', 'one'], // scope 'one' overrides /g - * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g - * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings - * [/f/g, ($0) => $0.toUpperCase()] - * ]); - */ -XRegExp.replaceEach = (str, replacements) => { - let i; - let r; - - for (i = 0; i < replacements.length; ++i) { - r = replacements[i]; - str = XRegExp.replace(str, r[0], r[1], r[2]); - } - - return str; -}; - -/** - * Splits a string into an array of strings using a regex or string separator. Matches of the - * separator are not included in the result array. However, if `separator` is a regex that contains - * capturing groups, backreferences are spliced into the result each time `separator` is matched. - * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably - * cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to split. - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - * @example - * - * // Basic use - * XRegExp.split('a b c', ' '); - * // -> ['a', 'b', 'c'] - * - * // With limit - * XRegExp.split('a b c', ' ', 2); - * // -> ['a', 'b'] - * - * // Backreferences in result array - * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); - * // -> ['..', 'word', '1', '..'] - */ -XRegExp.split = (str, separator, limit) => fixed.split.call(toObject(str), separator, limit); - -/** - * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and - * `sticky` arguments specify the search start position, and whether the match must start at the - * specified position only. The `lastIndex` property of the provided regex is not used, but is - * updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.test` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Boolean} Whether the regex matched the provided value. - * @example - * - * // Basic use - * XRegExp.test('abc', /c/); // -> true - * - * // With pos and sticky - * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false - * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true - */ -// Do this the easy way :-) -XRegExp.test = (str, regex, pos, sticky) => !!XRegExp.exec(str, regex, pos, sticky); - -/** - * Uninstalls optional features according to the specified options. All optional features start out - * uninstalled, so this is used to undo the actions of `XRegExp.install`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.uninstall({ - * // Disables support for astral code points in Unicode addons - * astral: true - * }); - * - * // With an options string - * XRegExp.uninstall('astral'); - */ -XRegExp.uninstall = (options) => { - options = prepareOptions(options); - - if (features.astral && options.astral) { - setAstral(false); - } -}; - -/** - * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as - * regex objects or strings. Metacharacters are escaped in patterns provided as strings. - * Backreferences in provided regex objects are automatically renumbered to work correctly within - * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the - * `flags` argument. - * - * @memberOf XRegExp - * @param {Array} patterns Regexes and strings to combine. - * @param {String} [flags] Any combination of XRegExp flags. - * @param {Object} [options] Options object with optional properties: - * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. - * @returns {RegExp} Union of the provided regexes and strings. - * @example - * - * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); - * // -> /a\+b\*c|(dogs)\1|(cats)\2/i - * - * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); - * // -> /manbearpig/i - */ -XRegExp.union = (patterns, flags, options) => { - options = options || {}; - const conjunction = options.conjunction || 'or'; - let numCaptures = 0; - let numPriorCaptures; - let captureNames; - - function rewrite(match, paren, backref) { - const name = captureNames[numCaptures - numPriorCaptures]; - - // Capturing group - if (paren) { - ++numCaptures; - // If the current capture has a name, preserve the name - if (name) { - return `(?<${name}>`; - } - // Backreference - } else if (backref) { - // Rewrite the backreference - return `\\${+backref + numPriorCaptures}`; - } - - return match; - } - - if (!(isType(patterns, 'Array') && patterns.length)) { - throw new TypeError('Must provide a nonempty array of patterns to merge'); - } - - const parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - const output = []; - let pattern; - for (let i = 0; i < patterns.length; ++i) { - pattern = patterns[i]; - - if (XRegExp.isRegExp(pattern)) { - numPriorCaptures = numCaptures; - captureNames = (pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames) || []; - - // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are - // independently valid; helps keep this simple. Named captures are put back - output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); - } else { - output.push(XRegExp.escape(pattern)); - } - } - - const separator = conjunction === 'none' ? '' : '|'; - return XRegExp(output.join(separator), flags); -}; - -// ==--------------------------== -// Fixed/extended native methods -// ==--------------------------== - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Array} Match array with named backreference properties, or `null`. - */ -fixed.exec = function(str) { - const origLastIndex = this.lastIndex; - const match = nativ.exec.apply(this, arguments); - - if (match) { - // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing - // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 - // in standards mode follows the spec. - if (!correctExecNpcg && match.length > 1 && match.includes('')) { - const r2 = copyRegex(this, { - removeG: true, - isInternalOnly: true - }); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call(String(str).slice(match.index), r2, (...args) => { - const len = args.length; - // Skip index 0 and the last 2 - for (let i = 1; i < len - 2; ++i) { - if (args[i] === undefined) { - match[i] = undefined; - } - } - }); - } - - // Attach named capture properties - if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { - // Skip index 0 - for (let i = 1; i < match.length; ++i) { - const name = this[REGEX_DATA].captureNames[i - 1]; - if (name) { - match[name] = match[i]; - } - } - } - - // Fix browsers that increment `lastIndex` after zero-length matches - if (this.global && !match[0].length && (this.lastIndex > match.index)) { - this.lastIndex = match.index; - } - } - - if (!this.global) { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - this.lastIndex = origLastIndex; - } - - return match; -}; - -/** - * Fixes browser bugs in the native `RegExp.prototype.test`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Boolean} Whether the regex matched the provided value. - */ -fixed.test = function(str) { - // Do this the easy way :-) - return !!fixed.exec.call(this, str); -}; - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `String.prototype.match`. - * - * @memberOf String - * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. - * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, - * the result of calling `regex.exec(this)`. - */ -fixed.match = function(regex) { - if (!XRegExp.isRegExp(regex)) { - // Use the native `RegExp` rather than `XRegExp` - regex = new RegExp(regex); - } else if (regex.global) { - const result = nativ.match.apply(this, arguments); - // Fixes IE bug - regex.lastIndex = 0; - - return result; - } - - return fixed.exec.call(regex, toObject(this)); -}; - -/** - * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement - * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also - * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex - * search value, and the value of a replacement regex's `lastIndex` property during replacement - * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third - * (`flags`) argument. Use via `XRegExp.replace`. - * - * @memberOf String - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * @returns {String} New string with one or all matches replaced. - */ -fixed.replace = function(search, replacement) { - const isRegex = XRegExp.isRegExp(search); - let origLastIndex; - let captureNames; - let result; - - if (isRegex) { - if (search[REGEX_DATA]) { - captureNames = search[REGEX_DATA].captureNames; - } - // Only needed if `search` is nonglobal - origLastIndex = search.lastIndex; - } else { - search += ''; // Type-convert - } - - // Don't use `typeof`; some older browsers return 'function' for regex objects - if (isType(replacement, 'Function')) { - // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement - // functions isn't type-converted to a string - result = nativ.replace.call(String(this), search, (...args) => { - if (captureNames) { - // Change the `args[0]` string primitive to a `String` object that can store - // properties. This really does need to use `String` as a constructor - args[0] = new String(args[0]); - // Store named backreferences on the first argument - for (let i = 0; i < captureNames.length; ++i) { - if (captureNames[i]) { - args[0][captureNames[i]] = args[i + 1]; - } - } - } - // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari - // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) - if (isRegex && search.global) { - search.lastIndex = args[args.length - 2] + args[0].length; - } - // ES6 specs the context for replacement functions as `undefined` - return replacement(...args); - }); - } else { - // Ensure that the last value of `args` will be a string when given nonstring `this`, - // while still throwing on null or undefined context - result = nativ.replace.call(this == null ? this : String(this), search, (...args) => { - return nativ.replace.call(String(replacement), replacementToken, replacer); - - function replacer($0, bracketed, angled, dollarToken) { - bracketed = bracketed || angled; - // Named or numbered backreference with curly or angled braces - if (bracketed) { - // XRegExp behavior for `${n}` or `$`: - // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the - // entire match. Any number of leading zeros may be used. - // 2. Backreference to named capture `n`, if it exists and is not an integer - // overridden by numbered capture. In practice, this does not overlap with - // numbered capture since XRegExp does not allow named capture to use a bare - // integer as the name. - // 3. If the name or number does not refer to an existing capturing group, it's - // an error. - let n = +bracketed; // Type-convert; drop leading zeros - if (n <= args.length - 3) { - return args[n] || ''; - } - // Groups with the same name is an error, else would need `lastIndexOf` - n = captureNames ? captureNames.indexOf(bracketed) : -1; - if (n < 0) { - throw new SyntaxError(`Backreference to undefined group ${$0}`); - } - return args[n + 1] || ''; - } - // Else, special variable or numbered backreference without curly braces - if (dollarToken === '$') { // $$ - return '$'; - } - if (dollarToken === '&' || +dollarToken === 0) { // $&, $0 (not followed by 1-9), $00 - return args[0]; - } - if (dollarToken === '`') { // $` (left context) - return args[args.length - 1].slice(0, args[args.length - 2]); - } - if (dollarToken === "'") { // $' (right context) - return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - } - // Else, numbered backreference without braces - dollarToken = +dollarToken; // Type-convert; drop leading zero - // XRegExp behavior for `$n` and `$nn`: - // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. - // - `$1` is an error if no capturing groups. - // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` - // instead. - // - `$01` is `$1` if at least one capturing group, else it's an error. - // - `$0` (not followed by 1-9) and `$00` are the entire match. - // Native behavior, for comparison: - // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. - // - `$1` is a literal `$1` if no capturing groups. - // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. - // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. - // - `$0` is a literal `$0`. - if (!isNaN(dollarToken)) { - if (dollarToken > args.length - 3) { - throw new SyntaxError(`Backreference to undefined group ${$0}`); - } - return args[dollarToken] || ''; - } - // `$` followed by an unsupported char is an error, unlike native JS - throw new SyntaxError(`Invalid token ${$0}`); - } - }); - } - - if (isRegex) { - if (search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } else { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - search.lastIndex = origLastIndex; - } - } - - return result; -}; - -/** - * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. - * - * @memberOf String - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - */ -fixed.split = function(separator, limit) { - if (!XRegExp.isRegExp(separator)) { - // Browsers handle nonregex split correctly, so use the faster native method - return nativ.split.apply(this, arguments); - } - - const str = String(this); - const output = []; - const origLastIndex = separator.lastIndex; - let lastLastIndex = 0; - let lastLength; - - // Values for `limit`, per the spec: - // If undefined: pow(2,32) - 1 - // If 0, Infinity, or NaN: 0 - // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); - // If negative number: pow(2,32) - floor(abs(limit)) - // If other: Type-convert, then use the above rules - // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless - // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ - limit = (limit === undefined ? -1 : limit) >>> 0; - - XRegExp.forEach(str, separator, (match) => { - // This condition is not the same as `if (match[0].length)` - if ((match.index + match[0].length) > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < str.length) { - Array.prototype.push.apply(output, match.slice(1)); - } - lastLength = match[0].length; - lastLastIndex = match.index + lastLength; - } - }); - - if (lastLastIndex === str.length) { - if (!nativ.test.call(separator, '') || lastLength) { - output.push(''); - } - } else { - output.push(str.slice(lastLastIndex)); - } - - separator.lastIndex = origLastIndex; - return output.length > limit ? output.slice(0, limit) : output; -}; - -// ==--------------------------== -// Built-in syntax/flag tokens -// ==--------------------------== - -/* - * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be - * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser - * consistency and to reserve their syntax, but lets them be superseded by addons. - */ -XRegExp.addToken( - /\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, - (match, scope) => { - // \B is allowed in default scope only - if (match[1] === 'B' && scope === defaultScope) { - return match[0]; - } - throw new SyntaxError(`Invalid escape ${match[0]}`); - }, - { - scope: 'all', - leadChar: '\\' - } -); - -/* - * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit - * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag - * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to - * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior - * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or - * if you use the same in a character class. - */ -XRegExp.addToken( - /\\u{([\dA-Fa-f]+)}/, - (match, scope, flags) => { - const code = dec(match[1]); - if (code > 0x10FFFF) { - throw new SyntaxError(`Invalid Unicode code point ${match[0]}`); - } - if (code <= 0xFFFF) { - // Converting to \uNNNN avoids needing to escape the literal character and keep it - // separate from preceding tokens - return `\\u${pad4(hex(code))}`; - } - // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling - if (hasNativeU && flags.includes('u')) { - return match[0]; - } - throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); - }, - { - scope: 'all', - leadChar: '\\' - } -); - -/* - * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. - * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because - * character class endings can't be determined. - */ -XRegExp.addToken( - /\[(\^?)\]/, - // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. - // (?!) should work like \b\B, but is unreliable in some versions of Firefox - /* eslint-disable no-confusing-arrow */ - (match) => (match[1] ? '[\\s\\S]' : '\\b\\B'), - /* eslint-enable no-confusing-arrow */ - {leadChar: '['} -); - -/* - * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in - * free-spacing mode (flag x). - */ -XRegExp.addToken( - /\(\?#[^)]*\)/, - getContextualTokenSeparator, - {leadChar: '('} -); - -/* - * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. - */ -XRegExp.addToken( - /\s+|#[^\n]*\n?/, - getContextualTokenSeparator, - {flag: 'x'} -); - -/* - * Dot, in dotall mode (aka singleline mode, flag s) only. - */ -XRegExp.addToken( - /\./, - () => '[\\s\\S]', - { - flag: 's', - leadChar: '.' - } -); - -/* - * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, - * and $ only. Also allows numbered backreferences as `\k`. - */ -XRegExp.addToken( - /\\k<([\w$]+)>/, - function(match) { - // Groups with the same name is an error, else would need `lastIndexOf` - const index = isNaN(match[1]) ? (this.captureNames.indexOf(match[1]) + 1) : +match[1]; - const endIndex = match.index + match[0].length; - if (!index || index > this.captureNames.length) { - throw new SyntaxError(`Backreference to undefined group ${match[0]}`); - } - // Keep backreferences separate from subsequent literal numbers. This avoids e.g. - // inadvertedly changing `(?)\k1` to `()\11`. - return `\\${index}${ - endIndex === match.input.length || isNaN(match.input[endIndex]) ? - '' : '(?:)' - }`; - }, - {leadChar: '\\'} -); - -/* - * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` - * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches - * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. - */ -XRegExp.addToken( - /\\(\d+)/, - function(match, scope) { - if ( - !( - scope === defaultScope && - /^[1-9]/.test(match[1]) && - +match[1] <= this.captureNames.length - ) && - match[1] !== '0' - ) { - throw new SyntaxError(`Cannot use octal escape or backreference to undefined group ${match[0]}`); - } - return match[0]; - }, - { - scope: 'all', - leadChar: '\\' - } -); - -/* - * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the - * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style - * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively - * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to - * Python-style named capture as octals. - */ -XRegExp.addToken( - /\(\?P?<([\w$]+)>/, - function(match) { - // Disallow bare integers as names because named backreferences are added to match arrays - // and therefore numeric properties may lead to incorrect lookups - if (!isNaN(match[1])) { - throw new SyntaxError(`Cannot use integer as capture name ${match[0]}`); - } - if (match[1] === 'length' || match[1] === '__proto__') { - throw new SyntaxError(`Cannot use reserved word as capture name ${match[0]}`); - } - if (this.captureNames.includes(match[1])) { - throw new SyntaxError(`Cannot use same name for multiple groups ${match[0]}`); - } - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return '('; - }, - {leadChar: '('} -); - -/* - * Capturing group; match the opening parenthesis only. Required for support of named capturing - * groups. Also adds explicit capture mode (flag n). - */ -XRegExp.addToken( - /\((?!\?)/, - function(match, scope, flags) { - if (flags.includes('n')) { - return '(?:'; - } - this.captureNames.push(null); - return '('; - }, - { - optionalFlags: 'n', - leadChar: '(' - } -); - -export default XRegExp; diff --git a/scripts/node_modules/xregexp/xregexp-all.js b/scripts/node_modules/xregexp/xregexp-all.js deleted file mode 100644 index f4326999..00000000 --- a/scripts/node_modules/xregexp/xregexp-all.js +++ /dev/null @@ -1,4156 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.XRegExp = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o - * Steven Levithan (c) 2012-2017 MIT License - */ - -exports.default = function (XRegExp) { - var REGEX_DATA = 'xregexp'; - var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g', { - conjunction: 'or' - }); - - /** - * Strips a leading `^` and trailing unescaped `$`, if both are present. - * - * @private - * @param {String} pattern Pattern to process. - * @returns {String} Pattern with edge anchors removed. - */ - function deanchor(pattern) { - // Allow any number of empty noncapturing groups before/after anchors, because regexes - // built/generated by XRegExp sometimes include them - var leadingAnchor = /^(?:\(\?:\))*\^/; - var trailingAnchor = /\$(?:\(\?:\))*$/; - - if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && - // Ensure that the trailing `$` isn't escaped - trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ''))) { - return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); - } - - return pattern; - } - - /** - * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. - * - * @private - * @param {String|RegExp} value Value to convert. - * @param {Boolean} [addFlagX] Whether to apply the `x` flag in cases when `value` is not - * already a regex generated by XRegExp - * @returns {RegExp} XRegExp object with XRegExp syntax applied. - */ - function asXRegExp(value, addFlagX) { - var flags = addFlagX ? 'x' : ''; - return XRegExp.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? - // Don't recompile, to preserve capture names - value : - // Recompile as XRegExp - XRegExp(value.source, flags) : - // Compile string as XRegExp - XRegExp(value, flags); - } - - function interpolate(substitution) { - return substitution instanceof RegExp ? substitution : XRegExp.escape(substitution); - } - - function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { - subpatterns['subpattern' + subpatternIndex] = interpolated; - return subpatterns; - } - - function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { - var hasSubpattern = subpatternIndex < rawLiterals.length - 1; - return raw + (hasSubpattern ? '{{subpattern' + subpatternIndex + '}}' : ''); - } - - /** - * Provides tagged template literals that create regexes with XRegExp syntax and flags. The - * provided pattern is handled as a raw string, so backslashes don't need to be escaped. - * - * Interpolation of strings and regexes shares the features of `XRegExp.build`. Interpolated - * patterns are treated as atomic units when quantified, interpolated strings have their special - * characters escaped, a leading `^` and trailing unescaped `$` are stripped from interpolated - * regexes if both are present, and any backreferences within an interpolated regex are - * rewritten to work within the overall pattern. - * - * @memberOf XRegExp - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {Function} Handler for template literals that construct regexes with XRegExp syntax. - * @example - * - * const h12 = /1[0-2]|0?[1-9]/; - * const h24 = /2[0-3]|[01][0-9]/; - * const hours = XRegExp.tag('x')`${h12} : | ${h24}`; - * const minutes = /^[0-5][0-9]$/; - * // Note that explicitly naming the 'minutes' group is required for named backreferences - * const time = XRegExp.tag('x')`^ ${hours} (?${minutes}) $`; - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.tag = function (flags) { - return function (literals) { - for (var _len = arguments.length, substitutions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - substitutions[_key - 1] = arguments[_key]; - } - - var subpatterns = substitutions.map(interpolate).reduce(reduceToSubpatternsObject, {}); - var pattern = literals.raw.map(embedSubpatternAfter).join(''); - return XRegExp.build(pattern, subpatterns, flags); - }; - }; - - /** - * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in - * the outer pattern and provided subpatterns are automatically renumbered to work correctly. - * Native flags used by provided subpatterns are ignored in favor of the `flags` argument. - * - * @memberOf XRegExp - * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows - * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within - * character classes. - * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A - * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Regex with interpolated subpatterns. - * @example - * - * const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { - * hours: XRegExp.build('{{h12}} : | {{h24}}', { - * h12: /1[0-2]|0?[1-9]/, - * h24: /2[0-3]|[01][0-9]/ - * }, 'x'), - * minutes: /^[0-5][0-9]$/ - * }); - * time.test('10:59'); // -> true - * XRegExp.exec('10:59', time).minutes; // -> '59' - */ - XRegExp.build = function (pattern, subs, flags) { - flags = flags || ''; - // Used with `asXRegExp` calls for `pattern` and subpatterns in `subs`, to work around how - // some browsers convert `RegExp('\n')` to a regex that contains the literal characters `\` - // and `n`. See more details at . - var addFlagX = flags.indexOf('x') !== -1; - var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); - // Add flags within a leading mode modifier to the overall pattern's flags - if (inlineFlags) { - flags = XRegExp._clipDuplicates(flags + inlineFlags[1]); - } - - var data = {}; - for (var p in subs) { - if (subs.hasOwnProperty(p)) { - // Passing to XRegExp enables extended syntax and ensures independent validity, - // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For - // subpatterns provided as native regexes, it dies on octals and adds the property - // used to hold extended regex instance data, for simplicity. - var sub = asXRegExp(subs[p], addFlagX); - data[p] = { - // Deanchoring allows embedding independently useful anchored regexes. If you - // really need to keep your anchors, double them (i.e., `^^...$$`). - pattern: deanchor(sub.source), - names: sub[REGEX_DATA].captureNames || [] - }; - } - } - - // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; - // helps keep this simple. Named captures will be put back. - var patternAsRegex = asXRegExp(pattern, addFlagX); - - // 'Caps' is short for 'captures' - var numCaps = 0; - var numPriorCaps = void 0; - var numOuterCaps = 0; - var outerCapsMap = [0]; - var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; - var output = patternAsRegex.source.replace(parts, function ($0, $1, $2, $3, $4) { - var subName = $1 || $2; - var capName = void 0; - var intro = void 0; - var localCapIndex = void 0; - // Named subpattern - if (subName) { - if (!data.hasOwnProperty(subName)) { - throw new ReferenceError('Undefined property ' + $0); - } - // Named subpattern was wrapped in a capturing group - if ($1) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If it's a named group, preserve the name. Otherwise, use the subpattern name - // as the capture name - intro = '(?<' + (capName || subName) + '>'; - } else { - intro = '(?:'; - } - numPriorCaps = numCaps; - var rewrittenSubpattern = data[subName].pattern.replace(subParts, function (match, paren, backref) { - // Capturing group - if (paren) { - capName = data[subName].names[numCaps - numPriorCaps]; - ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return '(?<' + capName + '>'; - } - // Backreference - } else if (backref) { - localCapIndex = +backref - 1; - // Rewrite the backreference - return data[subName].names[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - '\\k<' + data[subName].names[localCapIndex] + '>' : '\\' + (+backref + numPriorCaps); - } - return match; - }); - return '' + intro + rewrittenSubpattern + ')'; - } - // Capturing group - if ($3) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - // If the current capture has a name, preserve the name - if (capName) { - return '(?<' + capName + '>'; - } - // Backreference - } else if ($4) { - localCapIndex = +$4 - 1; - // Rewrite the backreference - return outerCapNames[localCapIndex] ? - // Need to preserve the backreference name in case using flag `n` - '\\k<' + outerCapNames[localCapIndex] + '>' : '\\' + outerCapsMap[+$4]; - } - return $0; - }); - - return XRegExp(output, flags); - }; -}; - -module.exports = exports['default']; -},{}],2:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp.matchRecursive 4.0.0 - * - * Steven Levithan (c) 2009-2017 MIT License - */ - -exports.default = function (XRegExp) { - - /** - * Returns a match detail object composed of the provided values. - * - * @private - */ - function row(name, value, start, end) { - return { - name: name, - value: value, - start: start, - end: end - }; - } - - /** - * Returns an array of match strings between outermost left and right delimiters, or an array of - * objects with detailed match parts and position data. An error is thrown if delimiters are - * unbalanced within the data. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {String} left Left delimiter as an XRegExp pattern. - * @param {String} right Right delimiter as an XRegExp pattern. - * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. - * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. - * @returns {Array} Array of matches, or an empty array. - * @example - * - * // Basic usage - * let str = '(t((e))s)t()(ing)'; - * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); - * // -> ['t((e))s', '', 'ing'] - * - * // Extended information mode with valueNames - * str = 'Here is
an
example'; - * XRegExp.matchRecursive(str, '', '', 'gi', { - * valueNames: ['between', 'left', 'match', 'right'] - * }); - * // -> [ - * // {name: 'between', value: 'Here is ', start: 0, end: 8}, - * // {name: 'left', value: '
', start: 8, end: 13}, - * // {name: 'match', value: '
an
', start: 13, end: 27}, - * // {name: 'right', value: '
', start: 27, end: 33}, - * // {name: 'between', value: ' example', start: 33, end: 41} - * // ] - * - * // Omitting unneeded parts with null valueNames, and using escapeChar - * str = '...{1}.\\{{function(x,y){return {y:x}}}'; - * XRegExp.matchRecursive(str, '{', '}', 'g', { - * valueNames: ['literal', null, 'value', null], - * escapeChar: '\\' - * }); - * // -> [ - * // {name: 'literal', value: '...', start: 0, end: 3}, - * // {name: 'value', value: '1', start: 4, end: 5}, - * // {name: 'literal', value: '.\\{', start: 6, end: 9}, - * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} - * // ] - * - * // Sticky mode via flag y - * str = '<1><<<2>>><3>4<5>'; - * XRegExp.matchRecursive(str, '<', '>', 'gy'); - * // -> ['1', '<<2>>', '3'] - */ - XRegExp.matchRecursive = function (str, left, right, flags, options) { - flags = flags || ''; - options = options || {}; - var global = flags.indexOf('g') !== -1; - var sticky = flags.indexOf('y') !== -1; - // Flag `y` is controlled internally - var basicFlags = flags.replace(/y/g, ''); - var escapeChar = options.escapeChar; - var vN = options.valueNames; - var output = []; - var openTokens = 0; - var delimStart = 0; - var delimEnd = 0; - var lastOuterEnd = 0; - var outerStart = void 0; - var innerStart = void 0; - var leftMatch = void 0; - var rightMatch = void 0; - var esc = void 0; - left = XRegExp(left, basicFlags); - right = XRegExp(right, basicFlags); - - if (escapeChar) { - if (escapeChar.length > 1) { - throw new Error('Cannot use more than one escape character'); - } - escapeChar = XRegExp.escape(escapeChar); - // Example of concatenated `esc` regex: - // `escapeChar`: '%' - // `left`: '<' - // `right`: '>' - // Regex is: /(?:%[\S\s]|(?:(?!<|>)[^%])+)+/ - esc = new RegExp('(?:' + escapeChar + '[\\S\\s]|(?:(?!' + - // Using `XRegExp.union` safely rewrites backreferences in `left` and `right`. - // Intentionally not passing `basicFlags` to `XRegExp.union` since any syntax - // transformation resulting from those flags was already applied to `left` and - // `right` when they were passed through the XRegExp constructor above. - XRegExp.union([left, right], '', { conjunction: 'or' }).source + ')[^' + escapeChar + '])+)+', - // Flags `gy` not needed here - flags.replace(/[^imu]+/g, '')); - } - - while (true) { - // If using an escape character, advance to the delimiter's next starting position, - // skipping any escaped characters in between - if (escapeChar) { - delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; - } - leftMatch = XRegExp.exec(str, left, delimEnd); - rightMatch = XRegExp.exec(str, right, delimEnd); - // Keep the leftmost match only - if (leftMatch && rightMatch) { - if (leftMatch.index <= rightMatch.index) { - rightMatch = null; - } else { - leftMatch = null; - } - } - // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): - // LM | RM | OT | Result - // 1 | 0 | 1 | loop - // 1 | 0 | 0 | loop - // 0 | 1 | 1 | loop - // 0 | 1 | 0 | throw - // 0 | 0 | 1 | throw - // 0 | 0 | 0 | break - // The paths above don't include the sticky mode special case. The loop ends after the - // first completed match if not `global`. - if (leftMatch || rightMatch) { - delimStart = (leftMatch || rightMatch).index; - delimEnd = delimStart + (leftMatch || rightMatch)[0].length; - } else if (!openTokens) { - break; - } - if (sticky && !openTokens && delimStart > lastOuterEnd) { - break; - } - if (leftMatch) { - if (!openTokens) { - outerStart = delimStart; - innerStart = delimEnd; - } - ++openTokens; - } else if (rightMatch && openTokens) { - if (! --openTokens) { - if (vN) { - if (vN[0] && outerStart > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); - } - if (vN[1]) { - output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); - } - if (vN[2]) { - output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); - } - if (vN[3]) { - output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); - } - } else { - output.push(str.slice(innerStart, delimStart)); - } - lastOuterEnd = delimEnd; - if (!global) { - break; - } - } - } else { - throw new Error('Unbalanced delimiter found in string'); - } - // If the delimiter matched an empty string, avoid an infinite loop - if (delimStart === delimEnd) { - ++delimEnd; - } - } - - if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { - output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); - } - - return output; - }; -}; - -module.exports = exports['default']; -},{}],3:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Base 4.0.0 - * - * Steven Levithan (c) 2008-2017 MIT License - */ - -exports.default = function (XRegExp) { - - /** - * Adds base support for Unicode matching: - * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or - * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the - * braces for token names that are a single letter (e.g. `\pL` or `PL`). - * - Adds flag A (astral), which enables 21-bit Unicode support. - * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. - * - * Unicode Base relies on externally provided Unicode character data. Official addons are - * available to provide data for Unicode categories, scripts, blocks, and properties. - * - * @requires XRegExp - */ - - // ==--------------------------== - // Private stuff - // ==--------------------------== - - // Storage for Unicode data - var unicode = {}; - - // Reuse utils - var dec = XRegExp._dec; - var hex = XRegExp._hex; - var pad4 = XRegExp._pad4; - - // Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed - function normalize(name) { - return name.replace(/[- _]+/g, '').toLowerCase(); - } - - // Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal - function charCode(chr) { - var esc = /^\\[xu](.+)/.exec(chr); - return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\' ? 1 : 0); - } - - // Inverts a list of ordered BMP characters and ranges - function invertBmp(range) { - var output = ''; - var lastEnd = -1; - - XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function (m) { - var start = charCode(m[1]); - if (start > lastEnd + 1) { - output += '\\u' + pad4(hex(lastEnd + 1)); - if (start > lastEnd + 2) { - output += '-\\u' + pad4(hex(start - 1)); - } - } - lastEnd = charCode(m[2] || m[1]); - }); - - if (lastEnd < 0xFFFF) { - output += '\\u' + pad4(hex(lastEnd + 1)); - if (lastEnd < 0xFFFE) { - output += '-\\uFFFF'; - } - } - - return output; - } - - // Generates an inverted BMP range on first use - function cacheInvertedBmp(slug) { - var prop = 'b!'; - return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); - } - - // Combines and optionally negates BMP and astral data - function buildAstral(slug, isNegated) { - var item = unicode[slug]; - var combined = ''; - - if (item.bmp && !item.isBmpLast) { - combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); - } - if (item.astral) { - combined += item.astral; - } - if (item.isBmpLast && item.bmp) { - combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; - } - - // Astral Unicode tokens always match a code point, never a code unit - return isNegated ? '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : '(?:' + combined + ')'; - } - - // Builds a complete astral pattern on first use - function cacheAstral(slug, isNegated) { - var prop = isNegated ? 'a!' : 'a='; - return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); - } - - // ==--------------------------== - // Core functionality - // ==--------------------------== - - /* - * Add astral mode (flag A) and Unicode token syntax: `\p{..}`, `\P{..}`, `\p{^..}`, `\pC`. - */ - XRegExp.addToken( - // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` - /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, function (match, scope, flags) { - var ERR_DOUBLE_NEG = 'Invalid double negation '; - var ERR_UNKNOWN_NAME = 'Unknown Unicode token '; - var ERR_UNKNOWN_REF = 'Unicode token missing data '; - var ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token '; - var ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes'; - // Negated via \P{..} or \p{^..} - var isNegated = match[1] === 'P' || !!match[2]; - // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A - var isAstralMode = flags.indexOf('A') !== -1; - // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` - var slug = normalize(match[4] || match[3]); - // Token data object - var item = unicode[slug]; - - if (match[1] === 'P' && match[2]) { - throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); - } - if (!unicode.hasOwnProperty(slug)) { - throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); - } - - // Switch to the negated form of the referenced Unicode token - if (item.inverseOf) { - slug = normalize(item.inverseOf); - if (!unicode.hasOwnProperty(slug)) { - throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); - } - item = unicode[slug]; - isNegated = !isNegated; - } - - if (!(item.bmp || isAstralMode)) { - throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); - } - if (isAstralMode) { - if (scope === 'class') { - throw new SyntaxError(ERR_ASTRAL_IN_CLASS); - } - - return cacheAstral(slug, isNegated); - } - - return scope === 'class' ? isNegated ? cacheInvertedBmp(slug) : item.bmp : (isNegated ? '[^' : '[') + item.bmp + ']'; - }, { - scope: 'all', - optionalFlags: 'A', - leadChar: '\\' - }); - - /** - * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. - * - * @memberOf XRegExp - * @param {Array} data Objects with named character ranges. Each object may have properties - * `name`, `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are - * optional, although one of `bmp` or `astral` is required (unless `inverseOf` is set). If - * `astral` is absent, the `bmp` data is used for BMP and astral modes. If `bmp` is absent, - * the name errors in BMP mode but works in astral mode. If both `bmp` and `astral` are - * provided, the `bmp` data only is used in BMP mode, and the combination of `bmp` and - * `astral` data is used in astral mode. `isBmpLast` is needed when a token matches orphan - * high surrogates *and* uses surrogate pairs to match astral code points. The `bmp` and - * `astral` data should be a combination of literal characters and `\xHH` or `\uHHHH` escape - * sequences, with hyphens to create ranges. Any regex metacharacters in the data should be - * escaped, apart from range-creating hyphens. The `astral` data can additionally use - * character classes and alternation, and should use surrogate pairs to represent astral code - * points. `inverseOf` can be used to avoid duplicating character data if a Unicode token is - * defined as the exact inverse of another token. - * @example - * - * // Basic use - * XRegExp.addUnicodeData([{ - * name: 'XDigit', - * alias: 'Hexadecimal', - * bmp: '0-9A-Fa-f' - * }]); - * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true - */ - XRegExp.addUnicodeData = function (data) { - var ERR_NO_NAME = 'Unicode token requires name'; - var ERR_NO_DATA = 'Unicode token has no character data '; - var item = void 0; - - for (var i = 0; i < data.length; ++i) { - item = data[i]; - if (!item.name) { - throw new Error(ERR_NO_NAME); - } - if (!(item.inverseOf || item.bmp || item.astral)) { - throw new Error(ERR_NO_DATA + item.name); - } - unicode[normalize(item.name)] = item; - if (item.alias) { - unicode[normalize(item.alias)] = item; - } - } - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and - // flags might now produce different results - XRegExp.cache.flush('patterns'); - }; - - /** - * @ignore - * - * Return a reference to the internal Unicode definition structure for the given Unicode - * Property if the given name is a legal Unicode Property for use in XRegExp `\p` or `\P` regex - * constructs. - * - * @memberOf XRegExp - * @param {String} name Name by which the Unicode Property may be recognized (case-insensitive), - * e.g. `'N'` or `'Number'`. The given name is matched against all registered Unicode - * Properties and Property Aliases. - * @returns {Object} Reference to definition structure when the name matches a Unicode Property. - * - * @note - * For more info on Unicode Properties, see also http://unicode.org/reports/tr18/#Categories. - * - * @note - * This method is *not* part of the officially documented API and may change or be removed in - * the future. It is meant for userland code that wishes to reuse the (large) internal Unicode - * structures set up by XRegExp. - */ - XRegExp._getUnicodeProperty = function (name) { - var slug = normalize(name); - return unicode[slug]; - }; -}; - -module.exports = exports['default']; -},{}],4:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Blocks 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., - * `\p{InBasicLatin}`. Token names are case insensitive, and any spaces, hyphens, and - * underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); - } - - XRegExp.addUnicodeData([{ - name: 'InAdlam', - astral: '\uD83A[\uDD00-\uDD5F]' - }, { - name: 'InAegean_Numbers', - astral: '\uD800[\uDD00-\uDD3F]' - }, { - name: 'InAhom', - astral: '\uD805[\uDF00-\uDF3F]' - }, { - name: 'InAlchemical_Symbols', - astral: '\uD83D[\uDF00-\uDF7F]' - }, { - name: 'InAlphabetic_Presentation_Forms', - bmp: '\uFB00-\uFB4F' - }, { - name: 'InAnatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE7F]' - }, { - name: 'InAncient_Greek_Musical_Notation', - astral: '\uD834[\uDE00-\uDE4F]' - }, { - name: 'InAncient_Greek_Numbers', - astral: '\uD800[\uDD40-\uDD8F]' - }, { - name: 'InAncient_Symbols', - astral: '\uD800[\uDD90-\uDDCF]' - }, { - name: 'InArabic', - bmp: '\u0600-\u06FF' - }, { - name: 'InArabic_Extended_A', - bmp: '\u08A0-\u08FF' - }, { - name: 'InArabic_Mathematical_Alphabetic_Symbols', - astral: '\uD83B[\uDE00-\uDEFF]' - }, { - name: 'InArabic_Presentation_Forms_A', - bmp: '\uFB50-\uFDFF' - }, { - name: 'InArabic_Presentation_Forms_B', - bmp: '\uFE70-\uFEFF' - }, { - name: 'InArabic_Supplement', - bmp: '\u0750-\u077F' - }, { - name: 'InArmenian', - bmp: '\u0530-\u058F' - }, { - name: 'InArrows', - bmp: '\u2190-\u21FF' - }, { - name: 'InAvestan', - astral: '\uD802[\uDF00-\uDF3F]' - }, { - name: 'InBalinese', - bmp: '\u1B00-\u1B7F' - }, { - name: 'InBamum', - bmp: '\uA6A0-\uA6FF' - }, { - name: 'InBamum_Supplement', - astral: '\uD81A[\uDC00-\uDE3F]' - }, { - name: 'InBasic_Latin', - bmp: '\0-\x7F' - }, { - name: 'InBassa_Vah', - astral: '\uD81A[\uDED0-\uDEFF]' - }, { - name: 'InBatak', - bmp: '\u1BC0-\u1BFF' - }, { - name: 'InBengali', - bmp: '\u0980-\u09FF' - }, { - name: 'InBhaiksuki', - astral: '\uD807[\uDC00-\uDC6F]' - }, { - name: 'InBlock_Elements', - bmp: '\u2580-\u259F' - }, { - name: 'InBopomofo', - bmp: '\u3100-\u312F' - }, { - name: 'InBopomofo_Extended', - bmp: '\u31A0-\u31BF' - }, { - name: 'InBox_Drawing', - bmp: '\u2500-\u257F' - }, { - name: 'InBrahmi', - astral: '\uD804[\uDC00-\uDC7F]' - }, { - name: 'InBraille_Patterns', - bmp: '\u2800-\u28FF' - }, { - name: 'InBuginese', - bmp: '\u1A00-\u1A1F' - }, { - name: 'InBuhid', - bmp: '\u1740-\u175F' - }, { - name: 'InByzantine_Musical_Symbols', - astral: '\uD834[\uDC00-\uDCFF]' - }, { - name: 'InCJK_Compatibility', - bmp: '\u3300-\u33FF' - }, { - name: 'InCJK_Compatibility_Forms', - bmp: '\uFE30-\uFE4F' - }, { - name: 'InCJK_Compatibility_Ideographs', - bmp: '\uF900-\uFAFF' - }, { - name: 'InCJK_Compatibility_Ideographs_Supplement', - astral: '\uD87E[\uDC00-\uDE1F]' - }, { - name: 'InCJK_Radicals_Supplement', - bmp: '\u2E80-\u2EFF' - }, { - name: 'InCJK_Strokes', - bmp: '\u31C0-\u31EF' - }, { - name: 'InCJK_Symbols_and_Punctuation', - bmp: '\u3000-\u303F' - }, { - name: 'InCJK_Unified_Ideographs', - bmp: '\u4E00-\u9FFF' - }, { - name: 'InCJK_Unified_Ideographs_Extension_A', - bmp: '\u3400-\u4DBF' - }, { - name: 'InCJK_Unified_Ideographs_Extension_B', - astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_C', - astral: '\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_D', - astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' - }, { - name: 'InCJK_Unified_Ideographs_Extension_E', - astral: '\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]' - }, { - name: 'InCarian', - astral: '\uD800[\uDEA0-\uDEDF]' - }, { - name: 'InCaucasian_Albanian', - astral: '\uD801[\uDD30-\uDD6F]' - }, { - name: 'InChakma', - astral: '\uD804[\uDD00-\uDD4F]' - }, { - name: 'InCham', - bmp: '\uAA00-\uAA5F' - }, { - name: 'InCherokee', - bmp: '\u13A0-\u13FF' - }, { - name: 'InCherokee_Supplement', - bmp: '\uAB70-\uABBF' - }, { - name: 'InCombining_Diacritical_Marks', - bmp: '\u0300-\u036F' - }, { - name: 'InCombining_Diacritical_Marks_Extended', - bmp: '\u1AB0-\u1AFF' - }, { - name: 'InCombining_Diacritical_Marks_Supplement', - bmp: '\u1DC0-\u1DFF' - }, { - name: 'InCombining_Diacritical_Marks_for_Symbols', - bmp: '\u20D0-\u20FF' - }, { - name: 'InCombining_Half_Marks', - bmp: '\uFE20-\uFE2F' - }, { - name: 'InCommon_Indic_Number_Forms', - bmp: '\uA830-\uA83F' - }, { - name: 'InControl_Pictures', - bmp: '\u2400-\u243F' - }, { - name: 'InCoptic', - bmp: '\u2C80-\u2CFF' - }, { - name: 'InCoptic_Epact_Numbers', - astral: '\uD800[\uDEE0-\uDEFF]' - }, { - name: 'InCounting_Rod_Numerals', - astral: '\uD834[\uDF60-\uDF7F]' - }, { - name: 'InCuneiform', - astral: '\uD808[\uDC00-\uDFFF]' - }, { - name: 'InCuneiform_Numbers_and_Punctuation', - astral: '\uD809[\uDC00-\uDC7F]' - }, { - name: 'InCurrency_Symbols', - bmp: '\u20A0-\u20CF' - }, { - name: 'InCypriot_Syllabary', - astral: '\uD802[\uDC00-\uDC3F]' - }, { - name: 'InCyrillic', - bmp: '\u0400-\u04FF' - }, { - name: 'InCyrillic_Extended_A', - bmp: '\u2DE0-\u2DFF' - }, { - name: 'InCyrillic_Extended_B', - bmp: '\uA640-\uA69F' - }, { - name: 'InCyrillic_Extended_C', - bmp: '\u1C80-\u1C8F' - }, { - name: 'InCyrillic_Supplement', - bmp: '\u0500-\u052F' - }, { - name: 'InDeseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, { - name: 'InDevanagari', - bmp: '\u0900-\u097F' - }, { - name: 'InDevanagari_Extended', - bmp: '\uA8E0-\uA8FF' - }, { - name: 'InDingbats', - bmp: '\u2700-\u27BF' - }, { - name: 'InDomino_Tiles', - astral: '\uD83C[\uDC30-\uDC9F]' - }, { - name: 'InDuployan', - astral: '\uD82F[\uDC00-\uDC9F]' - }, { - name: 'InEarly_Dynastic_Cuneiform', - astral: '\uD809[\uDC80-\uDD4F]' - }, { - name: 'InEgyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' - }, { - name: 'InElbasan', - astral: '\uD801[\uDD00-\uDD2F]' - }, { - name: 'InEmoticons', - astral: '\uD83D[\uDE00-\uDE4F]' - }, { - name: 'InEnclosed_Alphanumeric_Supplement', - astral: '\uD83C[\uDD00-\uDDFF]' - }, { - name: 'InEnclosed_Alphanumerics', - bmp: '\u2460-\u24FF' - }, { - name: 'InEnclosed_CJK_Letters_and_Months', - bmp: '\u3200-\u32FF' - }, { - name: 'InEnclosed_Ideographic_Supplement', - astral: '\uD83C[\uDE00-\uDEFF]' - }, { - name: 'InEthiopic', - bmp: '\u1200-\u137F' - }, { - name: 'InEthiopic_Extended', - bmp: '\u2D80-\u2DDF' - }, { - name: 'InEthiopic_Extended_A', - bmp: '\uAB00-\uAB2F' - }, { - name: 'InEthiopic_Supplement', - bmp: '\u1380-\u139F' - }, { - name: 'InGeneral_Punctuation', - bmp: '\u2000-\u206F' - }, { - name: 'InGeometric_Shapes', - bmp: '\u25A0-\u25FF' - }, { - name: 'InGeometric_Shapes_Extended', - astral: '\uD83D[\uDF80-\uDFFF]' - }, { - name: 'InGeorgian', - bmp: '\u10A0-\u10FF' - }, { - name: 'InGeorgian_Supplement', - bmp: '\u2D00-\u2D2F' - }, { - name: 'InGlagolitic', - bmp: '\u2C00-\u2C5F' - }, { - name: 'InGlagolitic_Supplement', - astral: '\uD838[\uDC00-\uDC2F]' - }, { - name: 'InGothic', - astral: '\uD800[\uDF30-\uDF4F]' - }, { - name: 'InGrantha', - astral: '\uD804[\uDF00-\uDF7F]' - }, { - name: 'InGreek_Extended', - bmp: '\u1F00-\u1FFF' - }, { - name: 'InGreek_and_Coptic', - bmp: '\u0370-\u03FF' - }, { - name: 'InGujarati', - bmp: '\u0A80-\u0AFF' - }, { - name: 'InGurmukhi', - bmp: '\u0A00-\u0A7F' - }, { - name: 'InHalfwidth_and_Fullwidth_Forms', - bmp: '\uFF00-\uFFEF' - }, { - name: 'InHangul_Compatibility_Jamo', - bmp: '\u3130-\u318F' - }, { - name: 'InHangul_Jamo', - bmp: '\u1100-\u11FF' - }, { - name: 'InHangul_Jamo_Extended_A', - bmp: '\uA960-\uA97F' - }, { - name: 'InHangul_Jamo_Extended_B', - bmp: '\uD7B0-\uD7FF' - }, { - name: 'InHangul_Syllables', - bmp: '\uAC00-\uD7AF' - }, { - name: 'InHanunoo', - bmp: '\u1720-\u173F' - }, { - name: 'InHatran', - astral: '\uD802[\uDCE0-\uDCFF]' - }, { - name: 'InHebrew', - bmp: '\u0590-\u05FF' - }, { - name: 'InHigh_Private_Use_Surrogates', - bmp: '\uDB80-\uDBFF' - }, { - name: 'InHigh_Surrogates', - bmp: '\uD800-\uDB7F' - }, { - name: 'InHiragana', - bmp: '\u3040-\u309F' - }, { - name: 'InIPA_Extensions', - bmp: '\u0250-\u02AF' - }, { - name: 'InIdeographic_Description_Characters', - bmp: '\u2FF0-\u2FFF' - }, { - name: 'InIdeographic_Symbols_and_Punctuation', - astral: '\uD81B[\uDFE0-\uDFFF]' - }, { - name: 'InImperial_Aramaic', - astral: '\uD802[\uDC40-\uDC5F]' - }, { - name: 'InInscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF7F]' - }, { - name: 'InInscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF5F]' - }, { - name: 'InJavanese', - bmp: '\uA980-\uA9DF' - }, { - name: 'InKaithi', - astral: '\uD804[\uDC80-\uDCCF]' - }, { - name: 'InKana_Supplement', - astral: '\uD82C[\uDC00-\uDCFF]' - }, { - name: 'InKanbun', - bmp: '\u3190-\u319F' - }, { - name: 'InKangxi_Radicals', - bmp: '\u2F00-\u2FDF' - }, { - name: 'InKannada', - bmp: '\u0C80-\u0CFF' - }, { - name: 'InKatakana', - bmp: '\u30A0-\u30FF' - }, { - name: 'InKatakana_Phonetic_Extensions', - bmp: '\u31F0-\u31FF' - }, { - name: 'InKayah_Li', - bmp: '\uA900-\uA92F' - }, { - name: 'InKharoshthi', - astral: '\uD802[\uDE00-\uDE5F]' - }, { - name: 'InKhmer', - bmp: '\u1780-\u17FF' - }, { - name: 'InKhmer_Symbols', - bmp: '\u19E0-\u19FF' - }, { - name: 'InKhojki', - astral: '\uD804[\uDE00-\uDE4F]' - }, { - name: 'InKhudawadi', - astral: '\uD804[\uDEB0-\uDEFF]' - }, { - name: 'InLao', - bmp: '\u0E80-\u0EFF' - }, { - name: 'InLatin_Extended_Additional', - bmp: '\u1E00-\u1EFF' - }, { - name: 'InLatin_Extended_A', - bmp: '\u0100-\u017F' - }, { - name: 'InLatin_Extended_B', - bmp: '\u0180-\u024F' - }, { - name: 'InLatin_Extended_C', - bmp: '\u2C60-\u2C7F' - }, { - name: 'InLatin_Extended_D', - bmp: '\uA720-\uA7FF' - }, { - name: 'InLatin_Extended_E', - bmp: '\uAB30-\uAB6F' - }, { - name: 'InLatin_1_Supplement', - bmp: '\x80-\xFF' - }, { - name: 'InLepcha', - bmp: '\u1C00-\u1C4F' - }, { - name: 'InLetterlike_Symbols', - bmp: '\u2100-\u214F' - }, { - name: 'InLimbu', - bmp: '\u1900-\u194F' - }, { - name: 'InLinear_A', - astral: '\uD801[\uDE00-\uDF7F]' - }, { - name: 'InLinear_B_Ideograms', - astral: '\uD800[\uDC80-\uDCFF]' - }, { - name: 'InLinear_B_Syllabary', - astral: '\uD800[\uDC00-\uDC7F]' - }, { - name: 'InLisu', - bmp: '\uA4D0-\uA4FF' - }, { - name: 'InLow_Surrogates', - bmp: '\uDC00-\uDFFF' - }, { - name: 'InLycian', - astral: '\uD800[\uDE80-\uDE9F]' - }, { - name: 'InLydian', - astral: '\uD802[\uDD20-\uDD3F]' - }, { - name: 'InMahajani', - astral: '\uD804[\uDD50-\uDD7F]' - }, { - name: 'InMahjong_Tiles', - astral: '\uD83C[\uDC00-\uDC2F]' - }, { - name: 'InMalayalam', - bmp: '\u0D00-\u0D7F' - }, { - name: 'InMandaic', - bmp: '\u0840-\u085F' - }, { - name: 'InManichaean', - astral: '\uD802[\uDEC0-\uDEFF]' - }, { - name: 'InMarchen', - astral: '\uD807[\uDC70-\uDCBF]' - }, { - name: 'InMathematical_Alphanumeric_Symbols', - astral: '\uD835[\uDC00-\uDFFF]' - }, { - name: 'InMathematical_Operators', - bmp: '\u2200-\u22FF' - }, { - name: 'InMeetei_Mayek', - bmp: '\uABC0-\uABFF' - }, { - name: 'InMeetei_Mayek_Extensions', - bmp: '\uAAE0-\uAAFF' - }, { - name: 'InMende_Kikakui', - astral: '\uD83A[\uDC00-\uDCDF]' - }, { - name: 'InMeroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDFF]' - }, { - name: 'InMeroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, { - name: 'InMiao', - astral: '\uD81B[\uDF00-\uDF9F]' - }, { - name: 'InMiscellaneous_Mathematical_Symbols_A', - bmp: '\u27C0-\u27EF' - }, { - name: 'InMiscellaneous_Mathematical_Symbols_B', - bmp: '\u2980-\u29FF' - }, { - name: 'InMiscellaneous_Symbols', - bmp: '\u2600-\u26FF' - }, { - name: 'InMiscellaneous_Symbols_and_Arrows', - bmp: '\u2B00-\u2BFF' - }, { - name: 'InMiscellaneous_Symbols_and_Pictographs', - astral: '\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF]' - }, { - name: 'InMiscellaneous_Technical', - bmp: '\u2300-\u23FF' - }, { - name: 'InModi', - astral: '\uD805[\uDE00-\uDE5F]' - }, { - name: 'InModifier_Tone_Letters', - bmp: '\uA700-\uA71F' - }, { - name: 'InMongolian', - bmp: '\u1800-\u18AF' - }, { - name: 'InMongolian_Supplement', - astral: '\uD805[\uDE60-\uDE7F]' - }, { - name: 'InMro', - astral: '\uD81A[\uDE40-\uDE6F]' - }, { - name: 'InMultani', - astral: '\uD804[\uDE80-\uDEAF]' - }, { - name: 'InMusical_Symbols', - astral: '\uD834[\uDD00-\uDDFF]' - }, { - name: 'InMyanmar', - bmp: '\u1000-\u109F' - }, { - name: 'InMyanmar_Extended_A', - bmp: '\uAA60-\uAA7F' - }, { - name: 'InMyanmar_Extended_B', - bmp: '\uA9E0-\uA9FF' - }, { - name: 'InNKo', - bmp: '\u07C0-\u07FF' - }, { - name: 'InNabataean', - astral: '\uD802[\uDC80-\uDCAF]' - }, { - name: 'InNew_Tai_Lue', - bmp: '\u1980-\u19DF' - }, { - name: 'InNewa', - astral: '\uD805[\uDC00-\uDC7F]' - }, { - name: 'InNumber_Forms', - bmp: '\u2150-\u218F' - }, { - name: 'InOgham', - bmp: '\u1680-\u169F' - }, { - name: 'InOl_Chiki', - bmp: '\u1C50-\u1C7F' - }, { - name: 'InOld_Hungarian', - astral: '\uD803[\uDC80-\uDCFF]' - }, { - name: 'InOld_Italic', - astral: '\uD800[\uDF00-\uDF2F]' - }, { - name: 'InOld_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, { - name: 'InOld_Permic', - astral: '\uD800[\uDF50-\uDF7F]' - }, { - name: 'InOld_Persian', - astral: '\uD800[\uDFA0-\uDFDF]' - }, { - name: 'InOld_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, { - name: 'InOld_Turkic', - astral: '\uD803[\uDC00-\uDC4F]' - }, { - name: 'InOptical_Character_Recognition', - bmp: '\u2440-\u245F' - }, { - name: 'InOriya', - bmp: '\u0B00-\u0B7F' - }, { - name: 'InOrnamental_Dingbats', - astral: '\uD83D[\uDE50-\uDE7F]' - }, { - name: 'InOsage', - astral: '\uD801[\uDCB0-\uDCFF]' - }, { - name: 'InOsmanya', - astral: '\uD801[\uDC80-\uDCAF]' - }, { - name: 'InPahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF8F]' - }, { - name: 'InPalmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, { - name: 'InPau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEFF]' - }, { - name: 'InPhags_pa', - bmp: '\uA840-\uA87F' - }, { - name: 'InPhaistos_Disc', - astral: '\uD800[\uDDD0-\uDDFF]' - }, { - name: 'InPhoenician', - astral: '\uD802[\uDD00-\uDD1F]' - }, { - name: 'InPhonetic_Extensions', - bmp: '\u1D00-\u1D7F' - }, { - name: 'InPhonetic_Extensions_Supplement', - bmp: '\u1D80-\u1DBF' - }, { - name: 'InPlaying_Cards', - astral: '\uD83C[\uDCA0-\uDCFF]' - }, { - name: 'InPrivate_Use_Area', - bmp: '\uE000-\uF8FF' - }, { - name: 'InPsalter_Pahlavi', - astral: '\uD802[\uDF80-\uDFAF]' - }, { - name: 'InRejang', - bmp: '\uA930-\uA95F' - }, { - name: 'InRumi_Numeral_Symbols', - astral: '\uD803[\uDE60-\uDE7F]' - }, { - name: 'InRunic', - bmp: '\u16A0-\u16FF' - }, { - name: 'InSamaritan', - bmp: '\u0800-\u083F' - }, { - name: 'InSaurashtra', - bmp: '\uA880-\uA8DF' - }, { - name: 'InSharada', - astral: '\uD804[\uDD80-\uDDDF]' - }, { - name: 'InShavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, { - name: 'InShorthand_Format_Controls', - astral: '\uD82F[\uDCA0-\uDCAF]' - }, { - name: 'InSiddham', - astral: '\uD805[\uDD80-\uDDFF]' - }, { - name: 'InSinhala', - bmp: '\u0D80-\u0DFF' - }, { - name: 'InSinhala_Archaic_Numbers', - astral: '\uD804[\uDDE0-\uDDFF]' - }, { - name: 'InSmall_Form_Variants', - bmp: '\uFE50-\uFE6F' - }, { - name: 'InSora_Sompeng', - astral: '\uD804[\uDCD0-\uDCFF]' - }, { - name: 'InSpacing_Modifier_Letters', - bmp: '\u02B0-\u02FF' - }, { - name: 'InSpecials', - bmp: '\uFFF0-\uFFFF' - }, { - name: 'InSundanese', - bmp: '\u1B80-\u1BBF' - }, { - name: 'InSundanese_Supplement', - bmp: '\u1CC0-\u1CCF' - }, { - name: 'InSuperscripts_and_Subscripts', - bmp: '\u2070-\u209F' - }, { - name: 'InSupplemental_Arrows_A', - bmp: '\u27F0-\u27FF' - }, { - name: 'InSupplemental_Arrows_B', - bmp: '\u2900-\u297F' - }, { - name: 'InSupplemental_Arrows_C', - astral: '\uD83E[\uDC00-\uDCFF]' - }, { - name: 'InSupplemental_Mathematical_Operators', - bmp: '\u2A00-\u2AFF' - }, { - name: 'InSupplemental_Punctuation', - bmp: '\u2E00-\u2E7F' - }, { - name: 'InSupplemental_Symbols_and_Pictographs', - astral: '\uD83E[\uDD00-\uDDFF]' - }, { - name: 'InSupplementary_Private_Use_Area_A', - astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' - }, { - name: 'InSupplementary_Private_Use_Area_B', - astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' - }, { - name: 'InSutton_SignWriting', - astral: '\uD836[\uDC00-\uDEAF]' - }, { - name: 'InSyloti_Nagri', - bmp: '\uA800-\uA82F' - }, { - name: 'InSyriac', - bmp: '\u0700-\u074F' - }, { - name: 'InTagalog', - bmp: '\u1700-\u171F' - }, { - name: 'InTagbanwa', - bmp: '\u1760-\u177F' - }, { - name: 'InTags', - astral: '\uDB40[\uDC00-\uDC7F]' - }, { - name: 'InTai_Le', - bmp: '\u1950-\u197F' - }, { - name: 'InTai_Tham', - bmp: '\u1A20-\u1AAF' - }, { - name: 'InTai_Viet', - bmp: '\uAA80-\uAADF' - }, { - name: 'InTai_Xuan_Jing_Symbols', - astral: '\uD834[\uDF00-\uDF5F]' - }, { - name: 'InTakri', - astral: '\uD805[\uDE80-\uDECF]' - }, { - name: 'InTamil', - bmp: '\u0B80-\u0BFF' - }, { - name: 'InTangut', - astral: '[\uD81C-\uD821][\uDC00-\uDFFF]' - }, { - name: 'InTangut_Components', - astral: '\uD822[\uDC00-\uDEFF]' - }, { - name: 'InTelugu', - bmp: '\u0C00-\u0C7F' - }, { - name: 'InThaana', - bmp: '\u0780-\u07BF' - }, { - name: 'InThai', - bmp: '\u0E00-\u0E7F' - }, { - name: 'InTibetan', - bmp: '\u0F00-\u0FFF' - }, { - name: 'InTifinagh', - bmp: '\u2D30-\u2D7F' - }, { - name: 'InTirhuta', - astral: '\uD805[\uDC80-\uDCDF]' - }, { - name: 'InTransport_and_Map_Symbols', - astral: '\uD83D[\uDE80-\uDEFF]' - }, { - name: 'InUgaritic', - astral: '\uD800[\uDF80-\uDF9F]' - }, { - name: 'InUnified_Canadian_Aboriginal_Syllabics', - bmp: '\u1400-\u167F' - }, { - name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', - bmp: '\u18B0-\u18FF' - }, { - name: 'InVai', - bmp: '\uA500-\uA63F' - }, { - name: 'InVariation_Selectors', - bmp: '\uFE00-\uFE0F' - }, { - name: 'InVariation_Selectors_Supplement', - astral: '\uDB40[\uDD00-\uDDEF]' - }, { - name: 'InVedic_Extensions', - bmp: '\u1CD0-\u1CFF' - }, { - name: 'InVertical_Forms', - bmp: '\uFE10-\uFE1F' - }, { - name: 'InWarang_Citi', - astral: '\uD806[\uDCA0-\uDCFF]' - }, { - name: 'InYi_Radicals', - bmp: '\uA490-\uA4CF' - }, { - name: 'InYi_Syllables', - bmp: '\uA000-\uA48F' - }, { - name: 'InYijing_Hexagram_Symbols', - bmp: '\u4DC0-\u4DFF' - }]); -}; - -module.exports = exports['default']; -},{}],5:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Categories 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See - * category descriptions in UAX #44 . Token - * names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); - } - - XRegExp.addUnicodeData([{ - name: 'C', - alias: 'Other', - isBmpLast: true, - bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]' - }, { - name: 'Cc', - alias: 'Control', - bmp: '\0-\x1F\x7F-\x9F' - }, { - name: 'Cf', - alias: 'Format', - bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', - astral: '\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, { - name: 'Cn', - alias: 'Unassigned', - bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5\u08BE-\u08D3\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E45-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', - astral: '\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5A\uDC5C\uDC5E-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD823-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFDF\uDFE1-\uDFFF]|\uD821[\uDFED-\uDFFF]|\uD822[\uDEF3-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4B-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDDAD-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD83D[\uDED3-\uDEDF\uDEED-\uDEEF\uDEF7-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD1F\uDD28-\uDD2F\uDD31\uDD32\uDD3F\uDD4C-\uDD4F\uDD5F-\uDD7F\uDD92-\uDDBF\uDDC1-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, { - name: 'Co', - alias: 'Private_Use', - bmp: '\uE000-\uF8FF', - astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' - }, { - name: 'Cs', - alias: 'Surrogate', - bmp: '\uD800-\uDFFF' - }, { - name: 'L', - alias: 'Letter', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Ll', - alias: 'Lowercase_Letter', - bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, { - name: 'Lm', - alias: 'Modifier_Letter', - bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', - astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]' - }, { - name: 'Lo', - alias: 'Other_Letter', - bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Lt', - alias: 'Titlecase_Letter', - bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' - }, { - name: 'Lu', - alias: 'Uppercase_Letter', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]' - }, { - name: 'M', - alias: 'Mark', - bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'Mc', - alias: 'Spacing_Mark', - bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', - astral: '\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4]|\uD81B[\uDF51-\uDF7E]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]' - }, { - name: 'Me', - alias: 'Enclosing_Mark', - bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' - }, { - name: 'Mn', - alias: 'Nonspacing_Mark', - bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', - astral: '\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'N', - alias: 'Number', - bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD807[\uDC50-\uDC6C]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83C[\uDD00-\uDD0C]' - }, { - name: 'Nd', - alias: 'Decimal_Number', - bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', - astral: '\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD807[\uDC50-\uDC59]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]' - }, { - name: 'Nl', - alias: 'Letter_Number', - bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', - astral: '\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]' - }, { - name: 'No', - alias: 'Other_Number', - bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', - astral: '\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]' - }, { - name: 'P', - alias: 'Punctuation', - bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, { - name: 'Pc', - alias: 'Connector_Punctuation', - bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' - }, { - name: 'Pd', - alias: 'Dash_Punctuation', - bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' - }, { - name: 'Pe', - alias: 'Close_Punctuation', - bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' - }, { - name: 'Pf', - alias: 'Final_Punctuation', - bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' - }, { - name: 'Pi', - alias: 'Initial_Punctuation', - bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' - }, { - name: 'Po', - alias: 'Other_Punctuation', - bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43\u2E44\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', - astral: '\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]' - }, { - name: 'Ps', - alias: 'Open_Punctuation', - bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' - }, { - name: 'S', - alias: 'Symbol', - bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83B[\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, { - name: 'Sc', - alias: 'Currency_Symbol', - bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' - }, { - name: 'Sk', - alias: 'Modifier_Symbol', - bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', - astral: '\uD83C[\uDFFB-\uDFFF]' - }, { - name: 'Sm', - alias: 'Math_Symbol', - bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', - astral: '\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]' - }, { - name: 'So', - alias: 'Other_Symbol', - bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FE\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', - astral: '\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]' - }, { - name: 'Z', - alias: 'Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - }, { - name: 'Zl', - alias: 'Line_Separator', - bmp: '\u2028' - }, { - name: 'Zp', - alias: 'Paragraph_Separator', - bmp: '\u2029' - }, { - name: 'Zs', - alias: 'Space_Separator', - bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' - }]); -}; - -module.exports = exports['default']; -},{}],6:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Properties 4.0.0 - * - * Steven Levithan (c) 2012-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See - * . Following are definitions of these properties from - * UAX #44 : - * - * - Alphabetic - * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + - * Lo + Nl + Other_Alphabetic. - * - * - Default_Ignorable_Code_Point - * For programmatic determination of default ignorable code points. New characters that should - * be ignored in rendering (unless explicitly supported) will be assigned in these ranges, - * permitting programs to correctly handle the default rendering of such characters when not - * otherwise supported. - * - * - Lowercase - * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. - * - * - Noncharacter_Code_Point - * Code points permanently reserved for internal use. - * - * - Uppercase - * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. - * - * - White_Space - * Spaces, separator characters and other control characters which should be treated by - * programming languages as "white space" for the purpose of parsing elements. - * - * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS - * #18 RL1.2 additionally requires support for Unicode scripts and general categories. These are - * included in XRegExp's Unicode Categories and Unicode Scripts addons. - * - * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); - } - - var unicodeData = [{ - name: 'ASCII', - bmp: '\0-\x7F' - }, { - name: 'Alphabetic', - bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Any', - isBmpLast: true, - bmp: '\0-\uFFFF', - astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' - }, { - name: 'Default_Ignorable_Code_Point', - bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', - astral: '\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]' - }, { - name: 'Lowercase', - bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', - astral: '\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]' - }, { - name: 'Noncharacter_Code_Point', - bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', - astral: '[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]' - }, { - name: 'Uppercase', - bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', - astral: '\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' - }, { - name: 'White_Space', - bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' - }]; - - // Add non-generated data - unicodeData.push({ - name: 'Assigned', - // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode - // Categories addon is required to use this property - inverseOf: 'Cn' - }); - - XRegExp.addUnicodeData(unicodeData); -}; - -module.exports = exports['default']; -},{}],7:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/*! - * XRegExp Unicode Scripts 4.0.0 - * - * Steven Levithan (c) 2010-2017 MIT License - * Unicode data by Mathias Bynens - */ - -exports.default = function (XRegExp) { - - /** - * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, - * and any spaces, hyphens, and underscores are ignored. - * - * Uses Unicode 9.0.0. - * - * @requires XRegExp, Unicode Base - */ - - if (!XRegExp.addUnicodeData) { - throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); - } - - XRegExp.addUnicodeData([{ - name: 'Adlam', - astral: '\uD83A[\uDD00-\uDD4A\uDD50-\uDD59\uDD5E\uDD5F]' - }, { - name: 'Ahom', - astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' - }, { - name: 'Anatolian_Hieroglyphs', - astral: '\uD811[\uDC00-\uDE46]' - }, { - name: 'Arabic', - bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', - astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' - }, { - name: 'Armenian', - bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' - }, { - name: 'Avestan', - astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' - }, { - name: 'Balinese', - bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' - }, { - name: 'Bamum', - bmp: '\uA6A0-\uA6F7', - astral: '\uD81A[\uDC00-\uDE38]' - }, { - name: 'Bassa_Vah', - astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' - }, { - name: 'Batak', - bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' - }, { - name: 'Bengali', - bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' - }, { - name: 'Bhaiksuki', - astral: '\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]' - }, { - name: 'Bopomofo', - bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' - }, { - name: 'Brahmi', - astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' - }, { - name: 'Braille', - bmp: '\u2800-\u28FF' - }, { - name: 'Buginese', - bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' - }, { - name: 'Buhid', - bmp: '\u1740-\u1753' - }, { - name: 'Canadian_Aboriginal', - bmp: '\u1400-\u167F\u18B0-\u18F5' - }, { - name: 'Carian', - astral: '\uD800[\uDEA0-\uDED0]' - }, { - name: 'Caucasian_Albanian', - astral: '\uD801[\uDD30-\uDD63\uDD6F]' - }, { - name: 'Chakma', - astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' - }, { - name: 'Cham', - bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' - }, { - name: 'Cherokee', - bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' - }, { - name: 'Common', - bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FE\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E44\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', - astral: '\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDDAC\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED2\uDEE0-\uDEEC\uDEF0-\uDEF6\uDF00-\uDF73\uDF80-\uDFD4]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD1E\uDD20-\uDD27\uDD30\uDD33-\uDD3E\uDD40-\uDD4B\uDD50-\uDD5E\uDD80-\uDD91\uDDC0]|\uDB40[\uDC01\uDC20-\uDC7F]' - }, { - name: 'Coptic', - bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' - }, { - name: 'Cuneiform', - astral: '\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]' - }, { - name: 'Cypriot', - astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' - }, { - name: 'Cyrillic', - bmp: '\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' - }, { - name: 'Deseret', - astral: '\uD801[\uDC00-\uDC4F]' - }, { - name: 'Devanagari', - bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' - }, { - name: 'Duployan', - astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' - }, { - name: 'Egyptian_Hieroglyphs', - astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' - }, { - name: 'Elbasan', - astral: '\uD801[\uDD00-\uDD27]' - }, { - name: 'Ethiopic', - bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' - }, { - name: 'Georgian', - bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' - }, { - name: 'Glagolitic', - bmp: '\u2C00-\u2C2E\u2C30-\u2C5E', - astral: '\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]' - }, { - name: 'Gothic', - astral: '\uD800[\uDF30-\uDF4A]' - }, { - name: 'Grantha', - astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' - }, { - name: 'Greek', - bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', - astral: '\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]' - }, { - name: 'Gujarati', - bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' - }, { - name: 'Gurmukhi', - bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' - }, { - name: 'Han', - bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', - astral: '[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]' - }, { - name: 'Hangul', - bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' - }, { - name: 'Hanunoo', - bmp: '\u1720-\u1734' - }, { - name: 'Hatran', - astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' - }, { - name: 'Hebrew', - bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' - }, { - name: 'Hiragana', - bmp: '\u3041-\u3096\u309D-\u309F', - astral: '\uD82C\uDC01|\uD83C\uDE00' - }, { - name: 'Imperial_Aramaic', - astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' - }, { - name: 'Inherited', - bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', - astral: '\uD800[\uDDFD\uDEE0]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]' - }, { - name: 'Inscriptional_Pahlavi', - astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' - }, { - name: 'Inscriptional_Parthian', - astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' - }, { - name: 'Javanese', - bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' - }, { - name: 'Kaithi', - astral: '\uD804[\uDC80-\uDCC1]' - }, { - name: 'Kannada', - bmp: '\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' - }, { - name: 'Katakana', - bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', - astral: '\uD82C\uDC00' - }, { - name: 'Kayah_Li', - bmp: '\uA900-\uA92D\uA92F' - }, { - name: 'Kharoshthi', - astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' - }, { - name: 'Khmer', - bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' - }, { - name: 'Khojki', - astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3E]' - }, { - name: 'Khudawadi', - astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' - }, { - name: 'Lao', - bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' - }, { - name: 'Latin', - bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' - }, { - name: 'Lepcha', - bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' - }, { - name: 'Limbu', - bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' - }, { - name: 'Linear_A', - astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' - }, { - name: 'Linear_B', - astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' - }, { - name: 'Lisu', - bmp: '\uA4D0-\uA4FF' - }, { - name: 'Lycian', - astral: '\uD800[\uDE80-\uDE9C]' - }, { - name: 'Lydian', - astral: '\uD802[\uDD20-\uDD39\uDD3F]' - }, { - name: 'Mahajani', - astral: '\uD804[\uDD50-\uDD76]' - }, { - name: 'Malayalam', - bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F' - }, { - name: 'Mandaic', - bmp: '\u0840-\u085B\u085E' - }, { - name: 'Manichaean', - astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' - }, { - name: 'Marchen', - astral: '\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]' - }, { - name: 'Meetei_Mayek', - bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' - }, { - name: 'Mende_Kikakui', - astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' - }, { - name: 'Meroitic_Cursive', - astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' - }, { - name: 'Meroitic_Hieroglyphs', - astral: '\uD802[\uDD80-\uDD9F]' - }, { - name: 'Miao', - astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' - }, { - name: 'Modi', - astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' - }, { - name: 'Mongolian', - bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA', - astral: '\uD805[\uDE60-\uDE6C]' - }, { - name: 'Mro', - astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' - }, { - name: 'Multani', - astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' - }, { - name: 'Myanmar', - bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' - }, { - name: 'Nabataean', - astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' - }, { - name: 'New_Tai_Lue', - bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' - }, { - name: 'Newa', - astral: '\uD805[\uDC00-\uDC59\uDC5B\uDC5D]' - }, { - name: 'Nko', - bmp: '\u07C0-\u07FA' - }, { - name: 'Ogham', - bmp: '\u1680-\u169C' - }, { - name: 'Ol_Chiki', - bmp: '\u1C50-\u1C7F' - }, { - name: 'Old_Hungarian', - astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' - }, { - name: 'Old_Italic', - astral: '\uD800[\uDF00-\uDF23]' - }, { - name: 'Old_North_Arabian', - astral: '\uD802[\uDE80-\uDE9F]' - }, { - name: 'Old_Permic', - astral: '\uD800[\uDF50-\uDF7A]' - }, { - name: 'Old_Persian', - astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' - }, { - name: 'Old_South_Arabian', - astral: '\uD802[\uDE60-\uDE7F]' - }, { - name: 'Old_Turkic', - astral: '\uD803[\uDC00-\uDC48]' - }, { - name: 'Oriya', - bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' - }, { - name: 'Osage', - astral: '\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]' - }, { - name: 'Osmanya', - astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' - }, { - name: 'Pahawh_Hmong', - astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' - }, { - name: 'Palmyrene', - astral: '\uD802[\uDC60-\uDC7F]' - }, { - name: 'Pau_Cin_Hau', - astral: '\uD806[\uDEC0-\uDEF8]' - }, { - name: 'Phags_Pa', - bmp: '\uA840-\uA877' - }, { - name: 'Phoenician', - astral: '\uD802[\uDD00-\uDD1B\uDD1F]' - }, { - name: 'Psalter_Pahlavi', - astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' - }, { - name: 'Rejang', - bmp: '\uA930-\uA953\uA95F' - }, { - name: 'Runic', - bmp: '\u16A0-\u16EA\u16EE-\u16F8' - }, { - name: 'Samaritan', - bmp: '\u0800-\u082D\u0830-\u083E' - }, { - name: 'Saurashtra', - bmp: '\uA880-\uA8C5\uA8CE-\uA8D9' - }, { - name: 'Sharada', - astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' - }, { - name: 'Shavian', - astral: '\uD801[\uDC50-\uDC7F]' - }, { - name: 'Siddham', - astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' - }, { - name: 'SignWriting', - astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' - }, { - name: 'Sinhala', - bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', - astral: '\uD804[\uDDE1-\uDDF4]' - }, { - name: 'Sora_Sompeng', - astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' - }, { - name: 'Sundanese', - bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' - }, { - name: 'Syloti_Nagri', - bmp: '\uA800-\uA82B' - }, { - name: 'Syriac', - bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' - }, { - name: 'Tagalog', - bmp: '\u1700-\u170C\u170E-\u1714' - }, { - name: 'Tagbanwa', - bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' - }, { - name: 'Tai_Le', - bmp: '\u1950-\u196D\u1970-\u1974' - }, { - name: 'Tai_Tham', - bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' - }, { - name: 'Tai_Viet', - bmp: '\uAA80-\uAAC2\uAADB-\uAADF' - }, { - name: 'Takri', - astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' - }, { - name: 'Tamil', - bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' - }, { - name: 'Tangut', - astral: '\uD81B\uDFE0|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]' - }, { - name: 'Telugu', - bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' - }, { - name: 'Thaana', - bmp: '\u0780-\u07B1' - }, { - name: 'Thai', - bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' - }, { - name: 'Tibetan', - bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' - }, { - name: 'Tifinagh', - bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' - }, { - name: 'Tirhuta', - astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' - }, { - name: 'Ugaritic', - astral: '\uD800[\uDF80-\uDF9D\uDF9F]' - }, { - name: 'Vai', - bmp: '\uA500-\uA62B' - }, { - name: 'Warang_Citi', - astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' - }, { - name: 'Yi', - bmp: '\uA000-\uA48C\uA490-\uA4C6' - }]); -}; - -module.exports = exports['default']; -},{}],8:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _xregexp = require('./xregexp'); - -var _xregexp2 = _interopRequireDefault(_xregexp); - -var _build = require('./addons/build'); - -var _build2 = _interopRequireDefault(_build); - -var _matchrecursive = require('./addons/matchrecursive'); - -var _matchrecursive2 = _interopRequireDefault(_matchrecursive); - -var _unicodeBase = require('./addons/unicode-base'); - -var _unicodeBase2 = _interopRequireDefault(_unicodeBase); - -var _unicodeBlocks = require('./addons/unicode-blocks'); - -var _unicodeBlocks2 = _interopRequireDefault(_unicodeBlocks); - -var _unicodeCategories = require('./addons/unicode-categories'); - -var _unicodeCategories2 = _interopRequireDefault(_unicodeCategories); - -var _unicodeProperties = require('./addons/unicode-properties'); - -var _unicodeProperties2 = _interopRequireDefault(_unicodeProperties); - -var _unicodeScripts = require('./addons/unicode-scripts'); - -var _unicodeScripts2 = _interopRequireDefault(_unicodeScripts); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _build2.default)(_xregexp2.default); -(0, _matchrecursive2.default)(_xregexp2.default); -(0, _unicodeBase2.default)(_xregexp2.default); -(0, _unicodeBlocks2.default)(_xregexp2.default); -(0, _unicodeCategories2.default)(_xregexp2.default); -(0, _unicodeProperties2.default)(_xregexp2.default); -(0, _unicodeScripts2.default)(_xregexp2.default); - -exports.default = _xregexp2.default; -module.exports = exports['default']; -},{"./addons/build":1,"./addons/matchrecursive":2,"./addons/unicode-base":3,"./addons/unicode-blocks":4,"./addons/unicode-categories":5,"./addons/unicode-properties":6,"./addons/unicode-scripts":7,"./xregexp":9}],9:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/*! - * XRegExp 4.0.0 - * - * Steven Levithan (c) 2007-2017 MIT License - */ - -/** - * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and - * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to - * make your client-side grepping simpler and more powerful, while freeing you from related - * cross-browser inconsistencies. - */ - -// ==--------------------------== -// Private stuff -// ==--------------------------== - -// Property name used for extended regex instance data -var REGEX_DATA = 'xregexp'; -// Optional features that can be installed and uninstalled -var features = { - astral: false -}; -// Native methods to use and restore ('native' is an ES3 reserved keyword) -var nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split -}; -// Storage for fixed/extended native methods -var fixed = {}; -// Storage for regexes cached by `XRegExp.cache` -var regexCache = {}; -// Storage for pattern details cached by the `XRegExp` constructor -var patternCache = {}; -// Storage for regex syntax tokens added internally or by `XRegExp.addToken` -var tokens = []; -// Token scopes -var defaultScope = 'default'; -var classScope = 'class'; -// Regexes that match native regex syntax, including octals -var nativeTokens = { - // Any native multicharacter token in default scope, or any single character - 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, - // Any native multicharacter token in character class scope, or any single character - 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ -}; -// Any backreference or dollar-prefixed character in replacement strings -var replacementToken = /\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g; -// Check for correct `exec` handling of nonparticipating capturing groups -var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; -// Check for ES6 `flags` prop support -var hasFlagsProp = /x/.flags !== undefined; -// Shortcut to `Object.prototype.toString` -var toString = {}.toString; - -function hasNativeFlag(flag) { - // Can't check based on the presence of properties/getters since browsers might support such - // properties even when they don't support the corresponding flag in regex construction (tested - // in Chrome 48, where `'unicode' in /x/` is true but trying to construct a regex with flag `u` - // throws an error) - var isSupported = true; - try { - // Can't use regex literals for testing even in a `try` because regex literals with - // unsupported flags cause a compilation error in IE - new RegExp('', flag); - } catch (exception) { - isSupported = false; - } - return isSupported; -} -// Check for ES6 `u` flag support -var hasNativeU = hasNativeFlag('u'); -// Check for ES6 `y` flag support -var hasNativeY = hasNativeFlag('y'); -// Tracker for known flags, including addon flags -var registeredFlags = { - g: true, - i: true, - m: true, - u: hasNativeU, - y: hasNativeY -}; - -/** - * Attaches extended data and `XRegExp.prototype` properties to a regex object. - * - * @private - * @param {RegExp} regex Regex to augment. - * @param {Array} captureNames Array with capture names, or `null`. - * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. - * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. - * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * @returns {RegExp} Augmented regex. - */ -function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { - var p = void 0; - - regex[REGEX_DATA] = { - captureNames: captureNames - }; - - if (isInternalOnly) { - return regex; - } - - // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value - if (regex.__proto__) { - regex.__proto__ = XRegExp.prototype; - } else { - for (p in XRegExp.prototype) { - // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since this - // is performance sensitive, and enumerable `Object.prototype` or `RegExp.prototype` - // extensions exist on `regex.prototype` anyway - regex[p] = XRegExp.prototype[p]; - } - } - - regex[REGEX_DATA].source = xSource; - // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order - regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; - - return regex; -} - -/** - * Removes any duplicate characters from the provided string. - * - * @private - * @param {String} str String to remove duplicate characters from. - * @returns {String} String with any duplicate characters removed. - */ -function clipDuplicates(str) { - return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); -} - -/** - * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` - * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing - * flags g and y while copying the regex. - * - * @private - * @param {RegExp} regex Regex to copy. - * @param {Object} [options] Options object with optional properties: - * - `addG` {Boolean} Add flag g while copying the regex. - * - `addY` {Boolean} Add flag y while copying the regex. - * - `removeG` {Boolean} Remove flag g while copying the regex. - * - `removeY` {Boolean} Remove flag y while copying the regex. - * - `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal - * operations, and never exposed to users. For internal-only regexes, we can improve perf by - * skipping some operations like attaching `XRegExp.prototype` properties. - * - `source` {String} Overrides `.source`, for special cases. - * @returns {RegExp} Copy of the provided regex, possibly with modified flags. - */ -function copyRegex(regex, options) { - if (!XRegExp.isRegExp(regex)) { - throw new TypeError('Type RegExp expected'); - } - - var xData = regex[REGEX_DATA] || {}; - var flags = getNativeFlags(regex); - var flagsToAdd = ''; - var flagsToRemove = ''; - var xregexpSource = null; - var xregexpFlags = null; - - options = options || {}; - - if (options.removeG) { - flagsToRemove += 'g'; - } - if (options.removeY) { - flagsToRemove += 'y'; - } - if (flagsToRemove) { - flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); - } - - if (options.addG) { - flagsToAdd += 'g'; - } - if (options.addY) { - flagsToAdd += 'y'; - } - if (flagsToAdd) { - flags = clipDuplicates(flags + flagsToAdd); - } - - if (!options.isInternalOnly) { - if (xData.source !== undefined) { - xregexpSource = xData.source; - } - // null or undefined; don't want to add to `flags` if the previous value was null, since - // that indicates we're not tracking original precompilation flags - if (xData.flags != null) { - // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are never - // removed for non-internal regexes, so don't need to handle it - xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; - } - } - - // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to avoid - // searching for special tokens. That would be wrong for regexes constructed by `RegExp`, and - // unnecessary for regexes constructed by `XRegExp` because the regex has already undergone the - // translation to native regex syntax - regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); - - return regex; -} - -/** - * Converts hexadecimal to decimal. - * - * @private - * @param {String} hex - * @returns {Number} - */ -function dec(hex) { - return parseInt(hex, 16); -} - -/** - * Returns a pattern that can be used in a native RegExp in place of an ignorable token such as an - * inline comment or whitespace with flag x. This is used directly as a token handler function - * passed to `XRegExp.addToken`. - * - * @private - * @param {String} match Match arg of `XRegExp.addToken` handler - * @param {String} scope Scope arg of `XRegExp.addToken` handler - * @param {String} flags Flags arg of `XRegExp.addToken` handler - * @returns {String} Either '' or '(?:)', depending on which is needed in the context of the match. - */ -function getContextualTokenSeparator(match, scope, flags) { - if ( - // No need to separate tokens if at the beginning or end of a group - match.input[match.index - 1] === '(' || match.input[match.index + match[0].length] === ')' || - // Avoid separating tokens when the following token is a quantifier - isQuantifierNext(match.input, match.index + match[0].length, flags)) { - return ''; - } - // Keep tokens separated. This avoids e.g. inadvertedly changing `\1 1` or `\1(?#)1` to `\11`. - // This also ensures all tokens remain as discrete atoms, e.g. it avoids converting the syntax - // error `(? :` into `(?:`. - return '(?:)'; -} - -/** - * Returns native `RegExp` flags used by a regex object. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {String} Native flags in use. - */ -function getNativeFlags(regex) { - return hasFlagsProp ? regex.flags : - // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation - // with an empty string) allows this to continue working predictably when - // `XRegExp.proptotype.toString` is overridden - nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; -} - -/** - * Determines whether a regex has extended instance data used to track capture names. - * - * @private - * @param {RegExp} regex Regex to check. - * @returns {Boolean} Whether the regex uses named capture. - */ -function hasNamedCapture(regex) { - return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); -} - -/** - * Converts decimal to hexadecimal. - * - * @private - * @param {Number|String} dec - * @returns {String} - */ -function hex(dec) { - return parseInt(dec, 10).toString(16); -} - -/** - * Checks whether the next nonignorable token after the specified position is a quantifier. - * - * @private - * @param {String} pattern Pattern to search within. - * @param {Number} pos Index in `pattern` to search at. - * @param {String} flags Flags used by the pattern. - * @returns {Boolean} Whether the next nonignorable token is a quantifier. - */ -function isQuantifierNext(pattern, pos, flags) { - var inlineCommentPattern = '\\(\\?#[^)]*\\)'; - var lineCommentPattern = '#[^#\\n]*'; - var quantifierPattern = '[?*+]|{\\d+(?:,\\d*)?}'; - return nativ.test.call(flags.indexOf('x') !== -1 ? - // Ignore any leading whitespace, line comments, and inline comments - /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : - // Ignore any leading inline comments - /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, pattern.slice(pos)); -} - -/** - * Determines whether a value is of the specified type, by resolving its internal [[Class]]. - * - * @private - * @param {*} value Object to check. - * @param {String} type Type to check for, in TitleCase. - * @returns {Boolean} Whether the object matches the type. - */ -function isType(value, type) { - return toString.call(value) === '[object ' + type + ']'; -} - -/** - * Adds leading zeros if shorter than four characters. Used for fixed-length hexadecimal values. - * - * @private - * @param {String} str - * @returns {String} - */ -function pad4(str) { - while (str.length < 4) { - str = '0' + str; - } - return str; -} - -/** - * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads - * the flag preparation logic from the `XRegExp` constructor. - * - * @private - * @param {String} pattern Regex pattern, possibly with a leading mode modifier. - * @param {String} flags Any combination of flags. - * @returns {Object} Object with properties `pattern` and `flags`. - */ -function prepareFlags(pattern, flags) { - var i = void 0; - - // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags - if (clipDuplicates(flags) !== flags) { - throw new SyntaxError('Invalid duplicate regex flag ' + flags); - } - - // Strip and apply a leading mode modifier with any combination of flags except g or y - pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { - if (nativ.test.call(/[gy]/, $1)) { - throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); - } - // Allow duplicate flags within the mode modifier - flags = clipDuplicates(flags + $1); - return ''; - }); - - // Throw on unknown native or nonnative flags - for (i = 0; i < flags.length; ++i) { - if (!registeredFlags[flags[i]]) { - throw new SyntaxError('Unknown regex flag ' + flags[i]); - } - } - - return { - pattern: pattern, - flags: flags - }; -} - -/** - * Prepares an options object from the given value. - * - * @private - * @param {String|Object} value Value to convert to an options object. - * @returns {Object} Options object. - */ -function prepareOptions(value) { - var options = {}; - - if (isType(value, 'String')) { - XRegExp.forEach(value, /[^\s,]+/, function (match) { - options[match] = true; - }); - - return options; - } - - return value; -} - -/** - * Registers a flag so it doesn't throw an 'unknown flag' error. - * - * @private - * @param {String} flag Single-character flag to register. - */ -function registerFlag(flag) { - if (!/^[\w$]$/.test(flag)) { - throw new Error('Flag must be a single character A-Za-z0-9_$'); - } - - registeredFlags[flag] = true; -} - -/** - * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified - * position, until a match is found. - * - * @private - * @param {String} pattern Original pattern from which an XRegExp object is being built. - * @param {String} flags Flags being used to construct the regex. - * @param {Number} pos Position to search for tokens within `pattern`. - * @param {Number} scope Regex scope to apply: 'default' or 'class'. - * @param {Object} context Context object to use for token handler functions. - * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. - */ -function runTokens(pattern, flags, pos, scope, context) { - var i = tokens.length; - var leadChar = pattern[pos]; - var result = null; - var match = void 0; - var t = void 0; - - // Run in reverse insertion order - while (i--) { - t = tokens[i]; - if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== 'all' || t.flag && !(flags.indexOf(t.flag) !== -1)) { - continue; - } - - match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); - if (match) { - result = { - matchLength: match[0].length, - output: t.handler.call(context, match, scope, flags), - reparse: t.reparse - }; - // Finished with token tests - break; - } - } - - return result; -} - -/** - * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to - * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if - * the Unicode Base addon is not available, since flag A is registered by that addon. - * - * @private - * @param {Boolean} on `true` to enable; `false` to disable. - */ -function setAstral(on) { - features.astral = on; -} - -/** - * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow - * the ES5 abstract operation `ToObject`. - * - * @private - * @param {*} value Object to check and return. - * @returns {*} The provided object. - */ -function toObject(value) { - // null or undefined - if (value == null) { - throw new TypeError('Cannot convert null or undefined to object'); - } - - return value; -} - -// ==--------------------------== -// Constructor -// ==--------------------------== - -/** - * Creates an extended regular expression object for matching text with a pattern. Differs from a - * native regular expression in that additional syntax and flags are supported. The returned object - * is in fact a native `RegExp` and works with all native methods. - * - * @class XRegExp - * @constructor - * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. - * @param {String} [flags] Any combination of flags. - * Native flags: - * - `g` - global - * - `i` - ignore case - * - `m` - multiline anchors - * - `u` - unicode (ES6) - * - `y` - sticky (Firefox 3+, ES6) - * Additional XRegExp flags: - * - `n` - explicit capture - * - `s` - dot matches all (aka singleline) - * - `x` - free-spacing and line comments (aka extended) - * - `A` - astral (requires the Unicode Base addon) - * Flags cannot be provided when constructing one `RegExp` from another. - * @returns {RegExp} Extended regular expression object. - * @example - * - * // With named capture and flag x - * XRegExp(`(? [0-9]{4} ) -? # year - * (? [0-9]{2} ) -? # month - * (? [0-9]{2} ) # day`, 'x'); - * - * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) - * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and - * // have fresh `lastIndex` properties (set to zero). - * XRegExp(/regex/); - */ -function XRegExp(pattern, flags) { - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) { - throw new TypeError('Cannot supply flags when copying a RegExp'); - } - return copyRegex(pattern); - } - - // Copy the argument behavior of `RegExp` - pattern = pattern === undefined ? '' : String(pattern); - flags = flags === undefined ? '' : String(flags); - - if (XRegExp.isInstalled('astral') && !(flags.indexOf('A') !== -1)) { - // This causes an error to be thrown if the Unicode Base addon is not available - flags += 'A'; - } - - if (!patternCache[pattern]) { - patternCache[pattern] = {}; - } - - if (!patternCache[pattern][flags]) { - var context = { - hasNamedCapture: false, - captureNames: [] - }; - var scope = defaultScope; - var output = ''; - var pos = 0; - var result = void 0; - - // Check for flag-related errors, and strip/apply flags in a leading mode modifier - var applied = prepareFlags(pattern, flags); - var appliedPattern = applied.pattern; - var appliedFlags = applied.flags; - - // Use XRegExp's tokens to translate the pattern to a native regex pattern. - // `appliedPattern.length` may change on each iteration if tokens use `reparse` - while (pos < appliedPattern.length) { - do { - // Check for custom tokens at the current position - result = runTokens(appliedPattern, appliedFlags, pos, scope, context); - // If the matched token used the `reparse` option, splice its output into the - // pattern before running tokens again at the same position - if (result && result.reparse) { - appliedPattern = appliedPattern.slice(0, pos) + result.output + appliedPattern.slice(pos + result.matchLength); - } - } while (result && result.reparse); - - if (result) { - output += result.output; - pos += result.matchLength || 1; - } else { - // Get the native token at the current position - var token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; - output += token; - pos += token.length; - if (token === '[' && scope === defaultScope) { - scope = classScope; - } else if (token === ']' && scope === classScope) { - scope = defaultScope; - } - } - } - - patternCache[pattern][flags] = { - // Use basic cleanup to collapse repeated empty groups like `(?:)(?:)` to `(?:)`. Empty - // groups are sometimes inserted during regex transpilation in order to keep tokens - // separated. However, more than one empty group in a row is never needed. - pattern: nativ.replace.call(output, /(?:\(\?:\))+/g, '(?:)'), - // Strip all but native flags - flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), - // `context.captureNames` has an item for each capturing group, even if unnamed - captures: context.hasNamedCapture ? context.captureNames : null - }; - } - - var generated = patternCache[pattern][flags]; - return augment(new RegExp(generated.pattern, generated.flags), generated.captures, pattern, flags); -} - -// Add `RegExp.prototype` to the prototype chain -XRegExp.prototype = /(?:)/; - -// ==--------------------------== -// Public properties -// ==--------------------------== - -/** - * The XRegExp version number as a string containing three dot-separated parts. For example, - * '2.0.0-beta-3'. - * - * @static - * @memberOf XRegExp - * @type String - */ -XRegExp.version = '4.0.0'; - -// ==--------------------------== -// Public methods -// ==--------------------------== - -// Intentionally undocumented; used in tests and addons -XRegExp._clipDuplicates = clipDuplicates; -XRegExp._hasNativeFlag = hasNativeFlag; -XRegExp._dec = dec; -XRegExp._hex = hex; -XRegExp._pad4 = pad4; - -/** - * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to - * create XRegExp addons. If more than one token can match the same string, the last added wins. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex object that matches the new token. - * @param {Function} handler Function that returns a new pattern string (using native regex syntax) - * to replace the matched token within all future XRegExp regexes. Has access to persistent - * properties of the regex being built, through `this`. Invoked with three arguments: - * - The match array, with named backreference properties. - * - The regex scope where the match was found: 'default' or 'class'. - * - The flags used by the regex, including any flags in a leading mode modifier. - * The handler function becomes part of the XRegExp construction process, so be careful not to - * construct XRegExps within the function or you will trigger infinite recursion. - * @param {Object} [options] Options object with optional properties: - * - `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. - * - `flag` {String} Single-character flag that triggers the token. This also registers the - * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. - * - `optionalFlags` {String} Any custom flags checked for within the token `handler` that are - * not required to trigger the token. This registers the flags, to prevent XRegExp from - * throwing an 'unknown flag' error when any of the flags are used. - * - `reparse` {Boolean} Whether the `handler` function's output should not be treated as - * final, and instead be reparseable by other tokens (including the current token). Allows - * token chaining or deferring. - * - `leadChar` {String} Single character that occurs at the beginning of any successful match - * of the token (not always applicable). This doesn't change the behavior of the token unless - * you provide an erroneous value. However, providing it can increase the token's performance - * since the token can be skipped at any positions where this character doesn't appear. - * @example - * - * // Basic usage: Add \a for the ALERT control code - * XRegExp.addToken( - * /\\a/, - * () => '\\x07', - * {scope: 'all'} - * ); - * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true - * - * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. - * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of - * // character classes only) - * XRegExp.addToken( - * /([?*+]|{\d+(?:,\d*)?})(\??)/, - * (match) => `${match[1]}${match[2] ? '' : '?'}`, - * {flag: 'U'} - * ); - * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' - * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' - */ -XRegExp.addToken = function (regex, handler, options) { - options = options || {}; - var optionalFlags = options.optionalFlags; - var i = void 0; - - if (options.flag) { - registerFlag(options.flag); - } - - if (optionalFlags) { - optionalFlags = nativ.split.call(optionalFlags, ''); - for (i = 0; i < optionalFlags.length; ++i) { - registerFlag(optionalFlags[i]); - } - } - - // Add to the private list of syntax tokens - tokens.push({ - regex: copyRegex(regex, { - addG: true, - addY: hasNativeY, - isInternalOnly: true - }), - handler: handler, - scope: options.scope || defaultScope, - flag: options.flag, - reparse: options.reparse, - leadChar: options.leadChar - }); - - // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and flags - // might now produce different results - XRegExp.cache.flush('patterns'); -}; - -/** - * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with - * the same pattern and flag combination, the cached copy of the regex is returned. - * - * @memberOf XRegExp - * @param {String} pattern Regex pattern string. - * @param {String} [flags] Any combination of XRegExp flags. - * @returns {RegExp} Cached XRegExp object. - * @example - * - * while (match = XRegExp.cache('.', 'gs').exec(str)) { - * // The regex is compiled once only - * } - */ -XRegExp.cache = function (pattern, flags) { - if (!regexCache[pattern]) { - regexCache[pattern] = {}; - } - return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp(pattern, flags)); -}; - -// Intentionally undocumented; used in tests -XRegExp.cache.flush = function (cacheName) { - if (cacheName === 'patterns') { - // Flush the pattern cache used by the `XRegExp` constructor - patternCache = {}; - } else { - // Flush the regex cache populated by `XRegExp.cache` - regexCache = {}; - } -}; - -/** - * Escapes any regular expression metacharacters, for use when matching literal strings. The result - * can safely be used at any point within a regex that uses any flags. - * - * @memberOf XRegExp - * @param {String} str String to escape. - * @returns {String} String with regex metacharacters escaped. - * @example - * - * XRegExp.escape('Escaped? <.>'); - * // -> 'Escaped\?\ <\.>' - */ -XRegExp.escape = function (str) { - return nativ.replace.call(toObject(str), /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -}; - -/** - * Executes a regex search in a specified string. Returns a match array or `null`. If the provided - * regex uses named capture, named backreference properties are included on the match array. - * Optional `pos` and `sticky` arguments specify the search start position, and whether the match - * must start at the specified position only. The `lastIndex` property of the provided regex is not - * used, but is updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.exec` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Array} Match array with named backreference properties, or `null`. - * @example - * - * // Basic use, with named backreference - * let match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); - * match.hex; // -> '2620' - * - * // With pos and sticky, in a loop - * let pos = 2, result = [], match; - * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { - * result.push(match[1]); - * pos = match.index + match[0].length; - * } - * // result -> ['2', '3', '4'] - */ -XRegExp.exec = function (str, regex, pos, sticky) { - var cacheKey = 'g'; - var addY = false; - var fakeY = false; - var match = void 0; - - addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); - if (addY) { - cacheKey += 'y'; - } else if (sticky) { - // Simulate sticky matching by appending an empty capture to the original regex. The - // resulting regex will succeed no matter what at the current index (set with `lastIndex`), - // and will not search the rest of the subject string. We'll know that the original regex - // has failed if that last capture is `''` rather than `undefined` (i.e., if that last - // capture participated in the match). - fakeY = true; - cacheKey += 'FakeY'; - } - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.match`/`replace` - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: true, - addY: addY, - source: fakeY ? regex.source + '|()' : undefined, - removeY: sticky === false, - isInternalOnly: true - })); - - pos = pos || 0; - r2.lastIndex = pos; - - // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. - match = fixed.exec.call(r2, str); - - // Get rid of the capture added by the pseudo-sticky matcher if needed. An empty string means - // the original regexp failed (see above). - if (fakeY && match && match.pop() === '') { - match = null; - } - - if (regex.global) { - regex.lastIndex = match ? r2.lastIndex : 0; - } - - return match; -}; - -/** - * Executes a provided function once per regex match. Searches always start at the beginning of the - * string and continue until the end, regardless of the state of the regex's `global` property and - * initial `lastIndex`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Function} callback Function to execute for each match. Invoked with four arguments: - * - The match array, with named backreference properties. - * - The zero-based match index. - * - The string being traversed. - * - The regex object being used to traverse the string. - * @example - * - * // Extracts every other digit from a string - * const evens = []; - * XRegExp.forEach('1a2345', /\d/, (match, i) => { - * if (i % 2) evens.push(+match[0]); - * }); - * // evens -> [2, 4] - */ -XRegExp.forEach = function (str, regex, callback) { - var pos = 0; - var i = -1; - var match = void 0; - - while (match = XRegExp.exec(str, regex, pos)) { - // Because `regex` is provided to `callback`, the function could use the deprecated/ - // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since `XRegExp.exec` - // doesn't use `lastIndex` to set the search position, this can't lead to an infinite loop, - // at least. Actually, because of the way `XRegExp.exec` caches globalized versions of - // regexes, mutating the regex will not have any effect on the iteration or matched strings, - // which is a nice side effect that brings extra safety. - callback(match, ++i, str, regex); - - pos = match.index + (match[0].length || 1); - } -}; - -/** - * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with - * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native - * regexes are not recompiled using XRegExp syntax. - * - * @memberOf XRegExp - * @param {RegExp} regex Regex to globalize. - * @returns {RegExp} Copy of the provided regex with flag `g` added. - * @example - * - * const globalCopy = XRegExp.globalize(/regex/); - * globalCopy.global; // -> true - */ -XRegExp.globalize = function (regex) { - return copyRegex(regex, { addG: true }); -}; - -/** - * Installs optional features according to the specified options. Can be undone using - * `XRegExp.uninstall`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.install({ - * // Enables support for astral code points in Unicode addons (implicitly sets flag A) - * astral: true - * }); - * - * // With an options string - * XRegExp.install('astral'); - */ -XRegExp.install = function (options) { - options = prepareOptions(options); - - if (!features.astral && options.astral) { - setAstral(true); - } -}; - -/** - * Checks whether an individual optional feature is installed. - * - * @memberOf XRegExp - * @param {String} feature Name of the feature to check. One of: - * - `astral` - * @returns {Boolean} Whether the feature is installed. - * @example - * - * XRegExp.isInstalled('astral'); - */ -XRegExp.isInstalled = function (feature) { - return !!features[feature]; -}; - -/** - * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes - * created in another frame, when `instanceof` and `constructor` checks would fail. - * - * @memberOf XRegExp - * @param {*} value Object to check. - * @returns {Boolean} Whether the object is a `RegExp` object. - * @example - * - * XRegExp.isRegExp('string'); // -> false - * XRegExp.isRegExp(/regex/i); // -> true - * XRegExp.isRegExp(RegExp('^', 'm')); // -> true - * XRegExp.isRegExp(XRegExp('(?s).')); // -> true - */ -XRegExp.isRegExp = function (value) { - return toString.call(value) === '[object RegExp]'; -}; // isType(value, 'RegExp'); - -/** - * Returns the first matched string, or in global mode, an array containing all matched strings. - * This is essentially a more convenient re-implementation of `String.prototype.match` that gives - * the result types you actually want (string instead of `exec`-style array in match-first mode, - * and an empty array instead of `null` when no matches are found in match-all mode). It also lets - * you override flag g and ignore `lastIndex`, and fixes browser bugs. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to - * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, - * `scope` is 'all'. - * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all - * mode: Array of all matched strings, or an empty array. - * @example - * - * // Match first - * XRegExp.match('abc', /\w/); // -> 'a' - * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' - * XRegExp.match('abc', /x/g, 'one'); // -> null - * - * // Match all - * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] - * XRegExp.match('abc', /x/, 'all'); // -> [] - */ -XRegExp.match = function (str, regex, scope) { - var global = regex.global && scope !== 'one' || scope === 'all'; - var cacheKey = (global ? 'g' : '') + (regex.sticky ? 'y' : '') || 'noGY'; - - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`replace` - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - })); - - var result = nativ.match.call(toObject(str), r2); - - if (regex.global) { - regex.lastIndex = scope === 'one' && result ? - // Can't use `r2.lastIndex` since `r2` is nonglobal in this case - result.index + result[0].length : 0; - } - - return global ? result || [] : result && result[0]; -}; - -/** - * Retrieves the matches from searching a string using a chain of regexes that successively search - * within previous matches. The provided `chain` array can contain regexes and or objects with - * `regex` and `backref` properties. When a backreference is specified, the named or numbered - * backreference is passed forward to the next regex or returned. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} chain Regexes that each search for matches within preceding results. - * @returns {Array} Matches by the last regex in the chain, or an empty array. - * @example - * - * // Basic usage; matches numbers within tags - * XRegExp.matchChain('1 2 3 4 a 56', [ - * XRegExp('(?is).*?'), - * /\d+/ - * ]); - * // -> ['2', '4', '56'] - * - * // Passing forward and returning specific backreferences - * html = '
XRegExp\ - * Google'; - * XRegExp.matchChain(html, [ - * {regex: //i, backref: 1}, - * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} - * ]); - * // -> ['xregexp.com', 'www.google.com'] - */ -XRegExp.matchChain = function (str, chain) { - return function recurseChain(values, level) { - var item = chain[level].regex ? chain[level] : { regex: chain[level] }; - var matches = []; - - function addMatch(match) { - if (item.backref) { - // Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold the - // `undefined`s for backreferences to nonparticipating capturing groups. In such - // cases, a `hasOwnProperty` or `in` check on its own would inappropriately throw - // the exception, so also check if the backreference is a number that is within the - // bounds of the array. - if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { - throw new ReferenceError('Backreference to undefined group: ' + item.backref); - } - - matches.push(match[item.backref] || ''); - } else { - matches.push(match[0]); - } - } - - for (var i = 0; i < values.length; ++i) { - XRegExp.forEach(values[i], item.regex, addMatch); - } - - return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); - }([str], 0); -}; - -/** - * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string - * or regex, and the replacement can be a string or a function to be called for each match. To - * perform a global search and replace, use the optional `scope` argument or include flag g if using - * a regex. Replacement strings can use `${n}` or `$` for named and numbered backreferences. - * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser - * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * Replacement strings can include special replacement syntax: - * - $$ - Inserts a literal $ character. - * - $&, $0 - Inserts the matched substring. - * - $` - Inserts the string that precedes the matched substring (left context). - * - $' - Inserts the string that follows the matched substring (right context). - * - $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts - * backreference n/nn. - * - ${n}, $ - Where n is a name or any number of digits that reference an existent capturing - * group, inserts backreference n. - * Replacement functions are invoked with three or more arguments: - * - The matched substring (corresponds to $& above). Named backreferences are accessible as - * properties of this first argument. - * - 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). - * - The zero-based index of the match within the total search string. - * - The total string being searched. - * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not - * explicitly specified and using a regex with flag g, `scope` is 'all'. - * @returns {String} New string with one or all matches replaced. - * @example - * - * // Regex search, using named backreferences in replacement string - * const name = XRegExp('(?\\w+) (?\\w+)'); - * XRegExp.replace('John Smith', name, '$, $'); - * // -> 'Smith, John' - * - * // Regex search, using named backreferences in replacement function - * XRegExp.replace('John Smith', name, (match) => `${match.last}, ${match.first}`); - * // -> 'Smith, John' - * - * // String search, with replace-all - * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); - * // -> 'XRegExp builds XRegExps' - */ -XRegExp.replace = function (str, search, replacement, scope) { - var isRegex = XRegExp.isRegExp(search); - var global = search.global && scope !== 'one' || scope === 'all'; - var cacheKey = (global ? 'g' : '') + (search.sticky ? 'y' : '') || 'noGY'; - var s2 = search; - - if (isRegex) { - search[REGEX_DATA] = search[REGEX_DATA] || {}; - - // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s - // `lastIndex` isn't updated *during* replacement iterations - s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { - addG: !!global, - removeG: scope === 'one', - isInternalOnly: true - })); - } else if (global) { - s2 = new RegExp(XRegExp.escape(String(search)), 'g'); - } - - // Fixed `replace` required for named backreferences, etc. - var result = fixed.replace.call(toObject(str), s2, replacement); - - if (isRegex && search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } - - return result; -}; - -/** - * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an - * array of replacement details. Later replacements operate on the output of earlier replacements. - * Replacement details are accepted as an array with a regex or string to search for, the - * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp - * replacement text syntax, which supports named backreference properties via `${name}` or - * `$`. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {Array} replacements Array of replacement detail arrays. - * @returns {String} New string with all replacements. - * @example - * - * str = XRegExp.replaceEach(str, [ - * [XRegExp('(?a)'), 'z${name}'], - * [/b/gi, 'y'], - * [/c/g, 'x', 'one'], // scope 'one' overrides /g - * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g - * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings - * [/f/g, ($0) => $0.toUpperCase()] - * ]); - */ -XRegExp.replaceEach = function (str, replacements) { - var i = void 0; - var r = void 0; - - for (i = 0; i < replacements.length; ++i) { - r = replacements[i]; - str = XRegExp.replace(str, r[0], r[1], r[2]); - } - - return str; -}; - -/** - * Splits a string into an array of strings using a regex or string separator. Matches of the - * separator are not included in the result array. However, if `separator` is a regex that contains - * capturing groups, backreferences are spliced into the result each time `separator` is matched. - * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably - * cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to split. - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - * @example - * - * // Basic use - * XRegExp.split('a b c', ' '); - * // -> ['a', 'b', 'c'] - * - * // With limit - * XRegExp.split('a b c', ' ', 2); - * // -> ['a', 'b'] - * - * // Backreferences in result array - * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); - * // -> ['..', 'word', '1', '..'] - */ -XRegExp.split = function (str, separator, limit) { - return fixed.split.call(toObject(str), separator, limit); -}; - -/** - * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and - * `sticky` arguments specify the search start position, and whether the match must start at the - * specified position only. The `lastIndex` property of the provided regex is not used, but is - * updated for compatibility. Also fixes browser bugs compared to the native - * `RegExp.prototype.test` and can be used reliably cross-browser. - * - * @memberOf XRegExp - * @param {String} str String to search. - * @param {RegExp} regex Regex to search with. - * @param {Number} [pos=0] Zero-based index at which to start the search. - * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position - * only. The string `'sticky'` is accepted as an alternative to `true`. - * @returns {Boolean} Whether the regex matched the provided value. - * @example - * - * // Basic use - * XRegExp.test('abc', /c/); // -> true - * - * // With pos and sticky - * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false - * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true - */ -// Do this the easy way :-) -XRegExp.test = function (str, regex, pos, sticky) { - return !!XRegExp.exec(str, regex, pos, sticky); -}; - -/** - * Uninstalls optional features according to the specified options. All optional features start out - * uninstalled, so this is used to undo the actions of `XRegExp.install`. - * - * @memberOf XRegExp - * @param {Object|String} options Options object or string. - * @example - * - * // With an options object - * XRegExp.uninstall({ - * // Disables support for astral code points in Unicode addons - * astral: true - * }); - * - * // With an options string - * XRegExp.uninstall('astral'); - */ -XRegExp.uninstall = function (options) { - options = prepareOptions(options); - - if (features.astral && options.astral) { - setAstral(false); - } -}; - -/** - * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as - * regex objects or strings. Metacharacters are escaped in patterns provided as strings. - * Backreferences in provided regex objects are automatically renumbered to work correctly within - * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the - * `flags` argument. - * - * @memberOf XRegExp - * @param {Array} patterns Regexes and strings to combine. - * @param {String} [flags] Any combination of XRegExp flags. - * @param {Object} [options] Options object with optional properties: - * - `conjunction` {String} Type of conjunction to use: 'or' (default) or 'none'. - * @returns {RegExp} Union of the provided regexes and strings. - * @example - * - * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); - * // -> /a\+b\*c|(dogs)\1|(cats)\2/i - * - * XRegExp.union([/man/, /bear/, /pig/], 'i', {conjunction: 'none'}); - * // -> /manbearpig/i - */ -XRegExp.union = function (patterns, flags, options) { - options = options || {}; - var conjunction = options.conjunction || 'or'; - var numCaptures = 0; - var numPriorCaptures = void 0; - var captureNames = void 0; - - function rewrite(match, paren, backref) { - var name = captureNames[numCaptures - numPriorCaptures]; - - // Capturing group - if (paren) { - ++numCaptures; - // If the current capture has a name, preserve the name - if (name) { - return '(?<' + name + '>'; - } - // Backreference - } else if (backref) { - // Rewrite the backreference - return '\\' + (+backref + numPriorCaptures); - } - - return match; - } - - if (!(isType(patterns, 'Array') && patterns.length)) { - throw new TypeError('Must provide a nonempty array of patterns to merge'); - } - - var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var output = []; - var pattern = void 0; - for (var i = 0; i < patterns.length; ++i) { - pattern = patterns[i]; - - if (XRegExp.isRegExp(pattern)) { - numPriorCaptures = numCaptures; - captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; - - // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns are - // independently valid; helps keep this simple. Named captures are put back - output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); - } else { - output.push(XRegExp.escape(pattern)); - } - } - - var separator = conjunction === 'none' ? '' : '|'; - return XRegExp(output.join(separator), flags); -}; - -// ==--------------------------== -// Fixed/extended native methods -// ==--------------------------== - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `RegExp.prototype.exec`. Use via `XRegExp.exec`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Array} Match array with named backreference properties, or `null`. - */ -fixed.exec = function (str) { - var origLastIndex = this.lastIndex; - var match = nativ.exec.apply(this, arguments); - - if (match) { - // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating capturing - // groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of older IEs. IE 9 - // in standards mode follows the spec. - if (!correctExecNpcg && match.length > 1 && match.indexOf('') !== -1) { - var r2 = copyRegex(this, { - removeG: true, - isInternalOnly: true - }); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call(String(str).slice(match.index), r2, function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var len = args.length; - // Skip index 0 and the last 2 - for (var i = 1; i < len - 2; ++i) { - if (args[i] === undefined) { - match[i] = undefined; - } - } - }); - } - - // Attach named capture properties - if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { - // Skip index 0 - for (var i = 1; i < match.length; ++i) { - var name = this[REGEX_DATA].captureNames[i - 1]; - if (name) { - match[name] = match[i]; - } - } - } - - // Fix browsers that increment `lastIndex` after zero-length matches - if (this.global && !match[0].length && this.lastIndex > match.index) { - this.lastIndex = match.index; - } - } - - if (!this.global) { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - this.lastIndex = origLastIndex; - } - - return match; -}; - -/** - * Fixes browser bugs in the native `RegExp.prototype.test`. - * - * @memberOf RegExp - * @param {String} str String to search. - * @returns {Boolean} Whether the regex matched the provided value. - */ -fixed.test = function (str) { - // Do this the easy way :-) - return !!fixed.exec.call(this, str); -}; - -/** - * Adds named capture support (with backreferences returned as `result.name`), and fixes browser - * bugs in the native `String.prototype.match`. - * - * @memberOf String - * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. - * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, - * the result of calling `regex.exec(this)`. - */ -fixed.match = function (regex) { - if (!XRegExp.isRegExp(regex)) { - // Use the native `RegExp` rather than `XRegExp` - regex = new RegExp(regex); - } else if (regex.global) { - var result = nativ.match.apply(this, arguments); - // Fixes IE bug - regex.lastIndex = 0; - - return result; - } - - return fixed.exec.call(regex, toObject(this)); -}; - -/** - * Adds support for `${n}` (or `$`) tokens for named and numbered backreferences in replacement - * text, and provides named backreferences to replacement functions as `arguments[0].name`. Also - * fixes browser bugs in replacement text syntax when performing a replacement using a nonregex - * search value, and the value of a replacement regex's `lastIndex` property during replacement - * iterations and upon completion. Note that this doesn't support SpiderMonkey's proprietary third - * (`flags`) argument. Use via `XRegExp.replace`. - * - * @memberOf String - * @param {RegExp|String} search Search pattern to be replaced. - * @param {String|Function} replacement Replacement string or a function invoked to create it. - * @returns {String} New string with one or all matches replaced. - */ -fixed.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search); - var origLastIndex = void 0; - var captureNames = void 0; - var result = void 0; - - if (isRegex) { - if (search[REGEX_DATA]) { - captureNames = search[REGEX_DATA].captureNames; - } - // Only needed if `search` is nonglobal - origLastIndex = search.lastIndex; - } else { - search += ''; // Type-convert - } - - // Don't use `typeof`; some older browsers return 'function' for regex objects - if (isType(replacement, 'Function')) { - // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement - // functions isn't type-converted to a string - result = nativ.replace.call(String(this), search, function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (captureNames) { - // Change the `args[0]` string primitive to a `String` object that can store - // properties. This really does need to use `String` as a constructor - args[0] = new String(args[0]); - // Store named backreferences on the first argument - for (var i = 0; i < captureNames.length; ++i) { - if (captureNames[i]) { - args[0][captureNames[i]] = args[i + 1]; - } - } - } - // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari - // bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) - if (isRegex && search.global) { - search.lastIndex = args[args.length - 2] + args[0].length; - } - // ES6 specs the context for replacement functions as `undefined` - return replacement.apply(undefined, args); - }); - } else { - // Ensure that the last value of `args` will be a string when given nonstring `this`, - // while still throwing on null or undefined context - result = nativ.replace.call(this == null ? this : String(this), search, function () { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - return nativ.replace.call(String(replacement), replacementToken, replacer); - - function replacer($0, bracketed, angled, dollarToken) { - bracketed = bracketed || angled; - // Named or numbered backreference with curly or angled braces - if (bracketed) { - // XRegExp behavior for `${n}` or `$`: - // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for the - // entire match. Any number of leading zeros may be used. - // 2. Backreference to named capture `n`, if it exists and is not an integer - // overridden by numbered capture. In practice, this does not overlap with - // numbered capture since XRegExp does not allow named capture to use a bare - // integer as the name. - // 3. If the name or number does not refer to an existing capturing group, it's - // an error. - var n = +bracketed; // Type-convert; drop leading zeros - if (n <= args.length - 3) { - return args[n] || ''; - } - // Groups with the same name is an error, else would need `lastIndexOf` - n = captureNames ? captureNames.indexOf(bracketed) : -1; - if (n < 0) { - throw new SyntaxError('Backreference to undefined group ' + $0); - } - return args[n + 1] || ''; - } - // Else, special variable or numbered backreference without curly braces - if (dollarToken === '$') { - // $$ - return '$'; - } - if (dollarToken === '&' || +dollarToken === 0) { - // $&, $0 (not followed by 1-9), $00 - return args[0]; - } - if (dollarToken === '`') { - // $` (left context) - return args[args.length - 1].slice(0, args[args.length - 2]); - } - if (dollarToken === "'") { - // $' (right context) - return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - } - // Else, numbered backreference without braces - dollarToken = +dollarToken; // Type-convert; drop leading zero - // XRegExp behavior for `$n` and `$nn`: - // - Backrefs end after 1 or 2 digits. Use `${..}` or `$<..>` for more digits. - // - `$1` is an error if no capturing groups. - // - `$10` is an error if less than 10 capturing groups. Use `${1}0` or `$<1>0` - // instead. - // - `$01` is `$1` if at least one capturing group, else it's an error. - // - `$0` (not followed by 1-9) and `$00` are the entire match. - // Native behavior, for comparison: - // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. - // - `$1` is a literal `$1` if no capturing groups. - // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. - // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. - // - `$0` is a literal `$0`. - if (!isNaN(dollarToken)) { - if (dollarToken > args.length - 3) { - throw new SyntaxError('Backreference to undefined group ' + $0); - } - return args[dollarToken] || ''; - } - // `$` followed by an unsupported char is an error, unlike native JS - throw new SyntaxError('Invalid token ' + $0); - } - }); - } - - if (isRegex) { - if (search.global) { - // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) - search.lastIndex = 0; - } else { - // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) - search.lastIndex = origLastIndex; - } - } - - return result; -}; - -/** - * Fixes browser bugs in the native `String.prototype.split`. Use via `XRegExp.split`. - * - * @memberOf String - * @param {RegExp|String} separator Regex or string to use for separating the string. - * @param {Number} [limit] Maximum number of items to include in the result array. - * @returns {Array} Array of substrings. - */ -fixed.split = function (separator, limit) { - if (!XRegExp.isRegExp(separator)) { - // Browsers handle nonregex split correctly, so use the faster native method - return nativ.split.apply(this, arguments); - } - - var str = String(this); - var output = []; - var origLastIndex = separator.lastIndex; - var lastLastIndex = 0; - var lastLength = void 0; - - // Values for `limit`, per the spec: - // If undefined: pow(2,32) - 1 - // If 0, Infinity, or NaN: 0 - // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); - // If negative number: pow(2,32) - floor(abs(limit)) - // If other: Type-convert, then use the above rules - // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, unless - // Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ - limit = (limit === undefined ? -1 : limit) >>> 0; - - XRegExp.forEach(str, separator, function (match) { - // This condition is not the same as `if (match[0].length)` - if (match.index + match[0].length > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < str.length) { - Array.prototype.push.apply(output, match.slice(1)); - } - lastLength = match[0].length; - lastLastIndex = match.index + lastLength; - } - }); - - if (lastLastIndex === str.length) { - if (!nativ.test.call(separator, '') || lastLength) { - output.push(''); - } - } else { - output.push(str.slice(lastLastIndex)); - } - - separator.lastIndex = origLastIndex; - return output.length > limit ? output.slice(0, limit) : output; -}; - -// ==--------------------------== -// Built-in syntax/flag tokens -// ==--------------------------== - -/* - * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be - * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser - * consistency and to reserve their syntax, but lets them be superseded by addons. - */ -XRegExp.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function (match, scope) { - // \B is allowed in default scope only - if (match[1] === 'B' && scope === defaultScope) { - return match[0]; - } - throw new SyntaxError('Invalid escape ' + match[0]); -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit - * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag - * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to - * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior - * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or - * if you use the same in a character class. - */ -XRegExp.addToken(/\\u{([\dA-Fa-f]+)}/, function (match, scope, flags) { - var code = dec(match[1]); - if (code > 0x10FFFF) { - throw new SyntaxError('Invalid Unicode code point ' + match[0]); - } - if (code <= 0xFFFF) { - // Converting to \uNNNN avoids needing to escape the literal character and keep it - // separate from preceding tokens - return '\\u' + pad4(hex(code)); - } - // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling - if (hasNativeU && flags.indexOf('u') !== -1) { - return match[0]; - } - throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. - * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because - * character class endings can't be determined. - */ -XRegExp.addToken(/\[(\^?)\]/, -// For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. -// (?!) should work like \b\B, but is unreliable in some versions of Firefox -/* eslint-disable no-confusing-arrow */ -function (match) { - return match[1] ? '[\\s\\S]' : '\\b\\B'; -}, -/* eslint-enable no-confusing-arrow */ -{ leadChar: '[' }); - -/* - * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in - * free-spacing mode (flag x). - */ -XRegExp.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { leadChar: '(' }); - -/* - * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. - */ -XRegExp.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { flag: 'x' }); - -/* - * Dot, in dotall mode (aka singleline mode, flag s) only. - */ -XRegExp.addToken(/\./, function () { - return '[\\s\\S]'; -}, { - flag: 's', - leadChar: '.' -}); - -/* - * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, - * and $ only. Also allows numbered backreferences as `\k`. - */ -XRegExp.addToken(/\\k<([\w$]+)>/, function (match) { - // Groups with the same name is an error, else would need `lastIndexOf` - var index = isNaN(match[1]) ? this.captureNames.indexOf(match[1]) + 1 : +match[1]; - var endIndex = match.index + match[0].length; - if (!index || index > this.captureNames.length) { - throw new SyntaxError('Backreference to undefined group ' + match[0]); - } - // Keep backreferences separate from subsequent literal numbers. This avoids e.g. - // inadvertedly changing `(?)\k1` to `()\11`. - return '\\' + index + (endIndex === match.input.length || isNaN(match.input[endIndex]) ? '' : '(?:)'); -}, { leadChar: '\\' }); - -/* - * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` - * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches - * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. - */ -XRegExp.addToken(/\\(\d+)/, function (match, scope) { - if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== '0') { - throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + match[0]); - } - return match[0]; -}, { - scope: 'all', - leadChar: '\\' -}); - -/* - * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the - * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style - * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively - * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to - * Python-style named capture as octals. - */ -XRegExp.addToken(/\(\?P?<([\w$]+)>/, function (match) { - // Disallow bare integers as names because named backreferences are added to match arrays - // and therefore numeric properties may lead to incorrect lookups - if (!isNaN(match[1])) { - throw new SyntaxError('Cannot use integer as capture name ' + match[0]); - } - if (match[1] === 'length' || match[1] === '__proto__') { - throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); - } - if (this.captureNames.indexOf(match[1]) !== -1) { - throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); - } - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return '('; -}, { leadChar: '(' }); - -/* - * Capturing group; match the opening parenthesis only. Required for support of named capturing - * groups. Also adds explicit capture mode (flag n). - */ -XRegExp.addToken(/\((?!\?)/, function (match, scope, flags) { - if (flags.indexOf('n') !== -1) { - return '(?:'; - } - this.captureNames.push(null); - return '('; -}, { - optionalFlags: 'n', - leadChar: '(' -}); - -exports.default = XRegExp; -module.exports = exports['default']; -},{}]},{},[8])(8) -}); \ No newline at end of file diff --git a/scripts/yarn.lock b/scripts/yarn.lock deleted file mode 100644 index 725f35de..00000000 --- a/scripts/yarn.lock +++ /dev/null @@ -1,87 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" - integrity sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg== - dependencies: - xregexp "4.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -xregexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" - integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== From 68d3e9c901e8be1e4d3754b37b3626be50db49ae Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 02:32:36 -0500 Subject: [PATCH 118/285] adding colors to output --- math/{sphenic_no.cpp => sphenic_n_o.cpp} | 0 scripts/formatter.js | 5 +++++ scripts/package.json | 4 +++- scripts/validate.js | 17 +++++++++++------ 4 files changed, 19 insertions(+), 7 deletions(-) rename math/{sphenic_no.cpp => sphenic_n_o.cpp} (100%) diff --git a/math/sphenic_no.cpp b/math/sphenic_n_o.cpp similarity index 100% rename from math/sphenic_no.cpp rename to math/sphenic_n_o.cpp diff --git a/scripts/formatter.js b/scripts/formatter.js index 06f066c0..77b4e514 100644 --- a/scripts/formatter.js +++ b/scripts/formatter.js @@ -10,6 +10,7 @@ const glob = require('glob'); const path = require('path'); const decamelize = require('decamelize'); const shell = require('child_process').execSync; +const chalk = require('chalk'); const getFiles = (src, callback) => { glob(src + '/**', callback); @@ -30,6 +31,10 @@ getFiles('../', (err, res) => { // Can be replaced in the future shell(`mv ${file} ${decamelize(file)}`); + if (file !== decamelize(file)) { + console.log(`The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file))}`); + } + // Replace for convention .h for .hpp if (path.extname(file) === '.h') { shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`); diff --git a/scripts/package.json b/scripts/package.json index 34c7436c..2093c3a0 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -10,6 +10,8 @@ "license": "MIT", "private": true, "dependencies": { + "chalk": "^2.4.2", + "decamelize": "^2.0.0", "glob": "^7.1.3" } -} \ No newline at end of file +} diff --git a/scripts/validate.js b/scripts/validate.js index 6e527ca4..6735bc0f 100644 --- a/scripts/validate.js +++ b/scripts/validate.js @@ -1,5 +1,7 @@ /** - * The All Algorithms C++ Validate.js + * validate.js + * + * The All ▲lgorithms validator CLI * * Author: Carlos Abraham Hernandez * https://abranhe.com (abraham@abranhe.com) @@ -9,6 +11,7 @@ const glob = require('glob'); const path = require('path'); const decamelize = require('decamelize'); +const chalk = require('chalk'); const shell = require('child_process').execSync; const getFiles = (src, callback) => { @@ -25,10 +28,12 @@ getFiles('../', (err, res) => { return; } - if(file !== decamelize(file)){ - console.log('Don\'t follow the All ▲lgorithms structure. :/'); - process.exit(); - } + if (file !== decamelize(file)) { + console.log(`The file ${chalk.red(path.basename(file))} does not follow the correct style.`); + // Stop when a file with wrong format is found + throw new TypeError(`File project style does not follow the All ▲lgorithms structure.`); + } + console.log(`The file ${chalk.green(path.basename(file))} is ok.`); }); } -}); \ No newline at end of file +}); From f7cd36e56b99c724fb68871da74eda1152e49d73 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 02:42:39 -0500 Subject: [PATCH 119/285] making sure that git accepts files with capitalization --- scripts/formatter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/formatter.js b/scripts/formatter.js index 77b4e514..f058e806 100644 --- a/scripts/formatter.js +++ b/scripts/formatter.js @@ -33,6 +33,10 @@ getFiles('../', (err, res) => { if (file !== decamelize(file)) { console.log(`The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file))}`); + + // Change file on git history + // https://stackoverflow.com/a/16071375/7602110 + shell(`git mv --force ${file} ${decamelize(file)}`); } // Replace for convention .h for .hpp From 9106941405c800dd97108a92a9d195fe7fedfaaa Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 02:49:24 -0500 Subject: [PATCH 120/285] running: npm run format --- .../{pairs_with_difference_K.cpp => pairs_with_difference_k.cpp} | 0 math/{Pascals_triangle.cpp => pascals_triangle.cpp} | 0 math/{Slicker_Algorithm.cpp => slicker_algorithm.cpp} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename data-structures/hashmaps/{pairs_with_difference_K.cpp => pairs_with_difference_k.cpp} (100%) rename math/{Pascals_triangle.cpp => pascals_triangle.cpp} (100%) rename math/{Slicker_Algorithm.cpp => slicker_algorithm.cpp} (100%) diff --git a/data-structures/hashmaps/pairs_with_difference_K.cpp b/data-structures/hashmaps/pairs_with_difference_k.cpp similarity index 100% rename from data-structures/hashmaps/pairs_with_difference_K.cpp rename to data-structures/hashmaps/pairs_with_difference_k.cpp diff --git a/math/Pascals_triangle.cpp b/math/pascals_triangle.cpp similarity index 100% rename from math/Pascals_triangle.cpp rename to math/pascals_triangle.cpp diff --git a/math/Slicker_Algorithm.cpp b/math/slicker_algorithm.cpp similarity index 100% rename from math/Slicker_Algorithm.cpp rename to math/slicker_algorithm.cpp From a28ca0ce581d6ea422a43eb47647848e96505fcb Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 02:59:46 -0500 Subject: [PATCH 121/285] add build with latest nodejs --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d17fe7f..683c3b07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ -language: node_js +language: node script: cd scripts \ && npm run validate notifications: - email: false \ No newline at end of file + email: false From 791abeb08ac5b1837ad5392dc64363bcb06a577c Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 03:05:46 -0500 Subject: [PATCH 122/285] making changes to build config --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 683c3b07..fde763a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ -language: node +language: node_js +node_js: + - "9" -script: cd scripts \ - && npm run validate +before_script: npm version && install + +script: cd scripts && npm run validate notifications: email: false From 5578622110c2270a4bcab7402daed22f6eded9cf Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 21 Feb 2019 03:10:18 -0500 Subject: [PATCH 123/285] organize travis.yml config --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fde763a1..611581ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,13 @@ language: node_js node_js: - "9" -before_script: npm version && install +before_script: + - npm version + - cd scripts/ + - npm install -script: cd scripts && npm run validate +script: + - npm run validate notifications: email: false From 9473ce70d164bc3f05bf585b66700762d0a67c7d Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 22 Feb 2019 15:14:33 -0500 Subject: [PATCH 124/285] adding readme generator --- .gitignore | 3 +- artificial-intelligence/togasat.cpp | 651 ++++++++++++++++++ .../hashmaps/pairs_with_difference_k.cpp | 68 +- math/{Magic Square.cpp => magic_square.cpp} | 0 math/{termo_conv.cpp => t_ermo_conv.cpp} | 0 readme.md | 282 ++++---- scripts/formatter.js | 134 +++- scripts/validate.js | 14 +- strings/anagram_check.cpp | 24 +- strings/lexicographic_ranking.cpp | 14 +- strings/longest_palindrome_subset.cpp | 22 +- strings/naive_search.cpp | 44 +- strings/permutations_of_string.cpp | 28 +- strings/print_duplicate_string.cpp | 24 +- strings/rabin_carp.cpp | 158 ++--- strings/rabin_karp.cpp | 26 +- strings/remove_adjacent_duplicates.cpp | 10 +- strings/remove_duplicates.cpp | 27 +- strings/reverse_string.cpp | 24 +- strings/z_algorithm.cpp | 146 ++-- 20 files changed, 1212 insertions(+), 487 deletions(-) create mode 100644 artificial-intelligence/togasat.cpp rename math/{Magic Square.cpp => magic_square.cpp} (100%) rename math/{termo_conv.cpp => t_ermo_conv.cpp} (100%) diff --git a/.gitignore b/.gitignore index fc31440f..6253c156 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ DS_Store /scripts/node_modules /scripts/yarn.lock -/scripts/package-lock.json \ No newline at end of file +/scripts/package-lock.json +.vscode/ \ No newline at end of file diff --git a/artificial-intelligence/togasat.cpp b/artificial-intelligence/togasat.cpp new file mode 100644 index 00000000..735f1dc9 --- /dev/null +++ b/artificial-intelligence/togasat.cpp @@ -0,0 +1,651 @@ +/************************************************************ +* MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson +* Copyright (c) 2007-2010 Niklas Sorensson +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +// SAT Solver +// CDCL Solver +// Author togatoga +// https://github.com/togatoga/Togasat +namespace togasat +{ +using Var = int; +using CRef = int; +using lbool = int; +const CRef CRef_Undef = -1; +class Solver +{ + +private: + const lbool l_True = 0; + const lbool l_False = 1; + const lbool l_Undef = 2; + + const int var_Undef = -1; + + // Literal + struct Lit + { + int x; + inline bool operator==(Lit p) const + { + return x == p.x; + } + inline bool operator!=(Lit p) const + { + return x != p.x; + } + inline bool operator<(Lit p) const + { + return x < p.x; + } + inline Lit operator~() + { + Lit q; + q.x = x ^ 1; + return q; + } + }; + + inline Lit mkLit(Var var, bool sign) + { + Lit p; + p.x = var + var + sign; + return p; + } + inline bool sign(Lit p) const + { + return p.x & 1; + } + inline int var(Lit p) const + { + return p.x >> 1; + } + inline int toInt(Var v) + { + return v; + } + inline int toInt(Lit p) + { + return p.x; + } + inline Lit toLit(int x) + { + Lit p; + p.x = x; + return p; + } + const Lit lit_Undef = {-2}; + + // lifted boolean + // VarData + struct VarData + { + CRef reason; + int level; + }; + inline VarData mkVarData(CRef cr, int l) + { + VarData d = {cr, l}; + return d; + } + // Watcher + struct Watcher + { + CRef cref; + Lit blocker; + Watcher() + { + } + Watcher(CRef cr, Lit p) : cref(cr), blocker(p) + { + } + bool operator==(const Watcher &w) const + { + return cref == w.cref; + } + bool operator!=(const Watcher &w) const + { + return cref != w.cref; + } + }; + + // Clause + class Clause + { + public: + struct + { + bool learnt; + int size; + } header; + std::vector data; //(x1 v x2 v not x3) + Clause() + { + } + Clause(const std::vector &ps, bool learnt) + { + header.learnt = learnt; + header.size = ps.size(); + //data = move(ps); + data.resize(header.size); + for (size_t i = 0; i < ps.size(); i++) + data[i] = ps[i]; + // //data.emplace_back(ps[i]); + } + + int size() const + { + return header.size; + } + bool learnt() const + { + return header.learnt; + } + Lit &operator[](int i) + { + return data[i]; + } + Lit operator[](int i) const + { + return data[i]; + } + }; + + CRef allocClause(std::vector &ps, bool learnt = false) + { + static CRef res = 0; + ca[res] = Clause(ps, learnt); + return res++; + } + + Var newVar(bool sign = true, bool dvar = true) + { + int v = nVars(); + + assigns.emplace_back(l_Undef); + vardata.emplace_back(mkVarData(CRef_Undef, 0)); + activity.emplace_back(0.0); + seen.push_back(false); + polarity.push_back(sign); + decision.push_back(0); + setDecisionVar(v, dvar); + return v; + } + + bool addClause_(std::vector &ps) + { + //std::sort(ps.begin(), ps.end()); + // empty clause + if (ps.size() == 0) + return false; + else if (ps.size() == 1) + uncheckedEnqueue(ps[0]); + else + { + CRef cr = allocClause(ps, false); + //clauses.insert(cr); + attachClause(cr); + } + + return true; + } + void attachClause(CRef cr) + { + const Clause &c = ca[cr]; + + assert(c.size() > 1); + + watches[(~c[0]).x].emplace_back(Watcher(cr, c[1])); + watches[(~c[1]).x].emplace_back(Watcher(cr, c[0])); + } + + // Input + void readClause(const std::string &line, std::vector &lits) + { + lits.clear(); + int var; + var = 0; + std::stringstream ss(line); + while (ss) + { + int val; + ss >> val; + if (val == 0) + break; + var = abs(val) - 1; + while (var >= nVars()) + newVar(); + lits.emplace_back(val > 0 ? mkLit(var, false) : mkLit(var, true)); + } + } + + std::unordered_map ca; // store clauses + std::unordered_set clauses; // original problem; + std::unordered_set learnts; + std::unordered_map> watches; + std::vector vardata; // store reason and level for each variable + std::vector polarity; // The preferred polarity of each variable + std::vector decision; + std::vector seen; + // Todo + size_t qhead; + std::vector trail; + std::vector trail_lim; + // Todo rename(not heap) + std::set> order_heap; + std::vector activity; + double var_inc; + std::vector model; + std::vector conflict; + int nVars() const + { + return vardata.size(); + } + int decisionLevel() const + { + return trail_lim.size(); + } + void newDecisionLevel() + { + trail_lim.emplace_back(trail.size()); + } + + inline CRef reason(Var x) const + { + return vardata[x].reason; + } + inline int level(Var x) const + { + return vardata[x].level; + } + inline void varBumpActivity(Var v) + { + std::pair p = std::make_pair(activity[v], v); + activity[v] += var_inc; + if (order_heap.erase(p) == 1) + order_heap.emplace(std::make_pair(activity[v], v)); + + if (activity[v] > 1e100) + { + //Rescale + std::set> tmp_order; + tmp_order = std::move(order_heap); + order_heap.clear(); + for (int i = 0; i < nVars(); i++) + activity[i] *= 1e-100; + for (auto &val : tmp_order) + order_heap.emplace(std::make_pair(activity[val.second], val.second)); + var_inc *= 1e-100; + } + } + bool satisfied(const Clause &c) const + { + for (int i = 0; i < c.size(); i++) + if (value(c[i]) == l_True) + return true; + + return false; + } + lbool value(Var p) const + { + return assigns[p]; + } + lbool value(Lit p) const + { + if (assigns[var(p)] == l_Undef) + return l_Undef; + return assigns[var(p)] ^ sign(p); + } + void setDecisionVar(Var v, bool b) + { + decision[v] = b; + order_heap.emplace(std::make_pair(0.0, v)); + } + void uncheckedEnqueue(Lit p, CRef from = CRef_Undef) + { + assert(value(p) == l_Undef); + assigns[var(p)] = sign(p); + vardata[var(p)] = mkVarData(from, decisionLevel()); + trail.emplace_back(p); + } + // decision + Lit pickBranchLit() + { + Var next = var_Undef; + while (next == var_Undef or value(next) != l_Undef) + { + if (order_heap.empty()) + { + next = var_Undef; + break; + } + else + { + auto p = *order_heap.rbegin(); + next = p.second; + order_heap.erase(p); + } + } + return next == var_Undef ? lit_Undef : mkLit(next, polarity[next]); + } + // clause learning + void analyze(CRef confl, std::vector &out_learnt, int &out_btlevel) + { + int pathC = 0; + Lit p = lit_Undef; + int index = trail.size() - 1; + out_learnt.emplace_back(mkLit(0, false)); + do + { + assert(confl != CRef_Undef); + Clause &c = ca[confl]; + for (int j = (p == lit_Undef) ? 0 : 1; j < c.size(); j++) + { + Lit q = c[j]; + if (not seen[var(q)] and level(var(q)) > 0) + { + varBumpActivity(var(q)); + seen[var(q)] = 1; + if (level(var(q)) >= decisionLevel()) + pathC++; + else + out_learnt.emplace_back(q); + } + } + while (not seen[var(trail[index--])]) + ; + p = trail[index + 1]; + confl = reason(var(p)); + seen[var(p)] = 0; + pathC--; + } while (pathC > 0); + + out_learnt[0] = ~p; + + // unit clause + if (out_learnt.size() == 1) + out_btlevel = 0; + else + { + int max_i = 1; + for (size_t i = 2; i < out_learnt.size(); i++) + if (level(var(out_learnt[i])) > level(var(out_learnt[max_i]))) + max_i = i; + + Lit p = out_learnt[max_i]; + out_learnt[max_i] = out_learnt[1]; + out_learnt[1] = p; + out_btlevel = level(var(p)); + } + + for (size_t i = 0; i < out_learnt.size(); i++) + seen[var(out_learnt[i])] = false; + } + + // backtrack + void cancelUntil(int level) + { + if (decisionLevel() > level) + { + for (int c = trail.size() - 1; c >= trail_lim[level]; c--) + { + Var x = var(trail[c]); + assigns[x] = l_Undef; + polarity[x] = sign(trail[c]); + order_heap.emplace(std::make_pair(activity[x], x)); + } + qhead = trail_lim[level]; + trail.erase(trail.end() - (trail.size() - trail_lim[level]), trail.end()); + trail_lim.erase(trail_lim.end() - (trail_lim.size() - level), + trail_lim.end()); + } + } + CRef propagate() + { + CRef confl = CRef_Undef; + int num_props = 0; + while (qhead < trail.size()) + { + Lit p = trail[qhead++]; // 'p' is enqueued fact to propagate. + std::vector &ws = watches[p.x]; + std::vector::iterator i, j, end; + num_props++; + + for (i = j = ws.begin(), end = i + ws.size(); i != end;) + { + // Try to avoid inspecting the clause: + Lit blocker = i->blocker; + if (value(blocker) == l_True) + { + *j++ = *i++; + continue; + } + + CRef cr = i->cref; + Clause &c = ca[cr]; + Lit false_lit = ~p; + if (c[0] == false_lit) + c[0] = c[1], c[1] = false_lit; + assert(c[1] == false_lit); + i++; + + Lit first = c[0]; + Watcher w = Watcher(cr, first); + if (first != blocker && value(first) == l_True) + { + *j++ = w; + continue; + } + + // Look for new watch: + for (int k = 2; k < c.size(); k++) + if (value(c[k]) != l_False) + { + c[1] = c[k]; + c[k] = false_lit; + watches[(~c[1]).x].emplace_back(w); + goto NextClause; + } + *j++ = w; + if (value(first) == l_False) // conflict + { + confl = cr; + qhead = trail.size(); + while (i < end) + *j++ = *i++; + } + else + uncheckedEnqueue(first, cr); + NextClause:; + } + int size = i - j; + ws.erase(ws.end() - size, ws.end()); + } + return confl; + } + + static double luby(double y, int x) + { + + // Find the finite subsequence that contains index 'x', and the + // size of that subsequence: + int size, seq; + for (size = 1, seq = 0; size < x + 1; seq++, size = 2 * size + 1) + ; + + while (size - 1 != x) + { + size = (size - 1) >> 1; + seq--; + x = x % size; + } + + return std::pow(y, seq); + } + + lbool search(int nof_conflicts) + { + int backtrack_level; + std::vector learnt_clause; + learnt_clause.emplace_back(mkLit(-1, false)); + int conflictC = 0; + while (true) + { + CRef confl = propagate(); + + if (confl != CRef_Undef) + { + // CONFLICT + conflictC++; + if (decisionLevel() == 0) + return l_False; + learnt_clause.clear(); + analyze(confl, learnt_clause, backtrack_level); + cancelUntil(backtrack_level); + if (learnt_clause.size() == 1) + uncheckedEnqueue(learnt_clause[0]); + else + { + CRef cr = allocClause(learnt_clause, true); + //learnts.insert(cr); + attachClause(cr); + uncheckedEnqueue(learnt_clause[0], cr); + } + //varDecay + var_inc *= 1.05; + } + else + { + // NO CONFLICT + if ((nof_conflicts >= 0 and conflictC >= nof_conflicts)) + { + cancelUntil(0); + return l_Undef; + } + Lit next = pickBranchLit(); + + if (next == lit_Undef) + return l_True; + newDecisionLevel(); + uncheckedEnqueue(next); + } + } + } + +public: + std::vector assigns; // The current assignments (ex assigns[0] = 0 -> + // X1 = True, assigns[1] = 1 -> X2 = False) + lbool answer; // SATISFIABLE 0 UNSATISFIABLE 1 UNKNOWN 2 + Solver() + { + qhead = 0; + } + void parseDimacsProblem(std::string problem_name) + { + std::vector lits; + int vars = 0; + int clauses = 0; + std::string line; + std::ifstream ifs(problem_name, std::ios_base::in); + while (ifs.good()) + { + getline(ifs, line); + if (line.size() > 0) + { + if (line[0] == 'p') + sscanf(line.c_str(), "p cnf %d %d", &vars, &clauses); + else if (line[0] == 'c' or line[0] == 'p') + continue; + else + { + readClause(line, lits); + if (lits.size() > 0) + addClause_(lits); + } + } + } + ifs.close(); + } + lbool solve() + { + model.clear(); + conflict.clear(); + lbool status = l_Undef; + answer = l_Undef; + var_inc = 1.01; + int curr_restarts = 0; + double restart_inc = 2; + double restart_first = 100; + while (status == l_Undef) + { + double rest_base = luby(restart_inc, curr_restarts); + status = search(rest_base * restart_first); + curr_restarts++; + } + answer = status; + return status; + } + + void addClause(std::vector &clause) + { + std::vector lits; + lits.resize(clause.size()); + for (size_t i = 0; i < clause.size(); i++) + { + int var = abs(clause[i]) - 1; + while (var >= nVars()) + newVar(); + lits[i] = clause[i] > 0 ? mkLit(var, false) : mkLit(var, true); + } + addClause_(lits); + } + void printAnswer() + { + if (answer == 0) + { + std::cout << "SAT" << std::endl; + for (size_t i = 0; i < assigns.size(); i++) + { + if (assigns[i] == 0) + std::cout << (i + 1) << " "; + else + std::cout << -(i + 1) << " "; + } + std::cout << "0" << std::endl; + } + else + std::cout << "UNSAT" << std::endl; + } +}; +} // namespace togasat \ No newline at end of file diff --git a/data-structures/hashmaps/pairs_with_difference_k.cpp b/data-structures/hashmaps/pairs_with_difference_k.cpp index ddbcd552..ebdcedfa 100644 --- a/data-structures/hashmaps/pairs_with_difference_k.cpp +++ b/data-structures/hashmaps/pairs_with_difference_k.cpp @@ -1,48 +1,46 @@ -/* - - You are given with an array of integers and an integer K. - Write a program to find and print all pairs which have difference K. - - Sample Input 1 : - 4 - 5 1 2 4 - 3 - Sample Output 1 : - 2 5 - 1 4 -*/ - - -#include +/** + * + * You are given with an array of integers and an integer K. + * Write a program to find and print all pairs which have difference K. + * + * Sample Input 1 : + * 4 + * 5 1 2 4 + * 3 + * Sample Output 1 : + * 2 5 + * 1 4 + * */ + +#include using namespace std; - -void printPairs(int *input, int n, int k) { - - int hash[10000]; - for(int i = 0;i < n;i++) - { - for(int j = i+1; j < n;j++) - { - if((input[i] - input[j]) == k) - cout << input[j] << " " << input[i] << endl; - else if((input[j] - input[i]) == k) - cout << input[i] << " " << input[j] << endl; - } - } - +void printPairs(int *input, int n, int k) +{ + + int hash[10000]; + for (int i = 0; i < n; i++) + { + for (int j = i + 1; j < n; j++) + { + if ((input[i] - input[j]) == k) + cout << input[j] << " " << input[i] << endl; + else if ((input[j] - input[i]) == k) + cout << input[i] << " " << input[j] << endl; + } + } } - -int main() { +int main() +{ int n; cin >> n; int *input = new int[n]; - for(int i = 0; i < n; i++){ + for (int i = 0; i < n; i++) + { cin >> input[i]; } int k; cin >> k; printPairs(input, n, k); } - diff --git a/math/Magic Square.cpp b/math/magic_square.cpp similarity index 100% rename from math/Magic Square.cpp rename to math/magic_square.cpp diff --git a/math/termo_conv.cpp b/math/t_ermo_conv.cpp similarity index 100% rename from math/termo_conv.cpp rename to math/t_ermo_conv.cpp diff --git a/readme.md b/readme.md index 56372ed2..2d22d3f4 100644 --- a/readme.md +++ b/readme.md @@ -1,160 +1,180 @@ + +
-
-
-
-
- -
-
-
-
-
-
- -
-
-

All ▲lgorithms implemented in C++

-
- - - - -
-
- allalgorithms.com +
+
+
+
+ +
+
+
+
+
+
+ +
+
+

All ▲lgorithms implemented in C++

+ + + + + + +
+
+allalgorithms.com
+ ## Contents -- [Artificial Intelligence](#artificial-intelligence) -- [Backtracking](#backtracking) -- [Bit Manipulation](#bit-manipulation) -- [Cellular Automaton](#cellular-automaton) -- [Ciphers](#ciphers) -- [Computational Geometry](#computational-geometry) -- [Cryptography](#cryptography) -- [Data Structures](#data-structures) -- [Divide and conquer](#divide-and-conquer) -- [Dynamic Programming](#dynamic-programming) -- [Gaming Theory](#gaming-theory) -- [Graphs](#graphs) -- [Greedy Algorithms](#greedy-algorithms) -- [Math](#math) -- [Networking](#networking) -- [Numerical Analysis](#numerical-analysis) -- [Operating system](#operating-system) -- [Randomized Algorithms](#randomized-algorithms) -- [Searches](#searches) -- [Selections Algorithms](#selections-algorithms) -- [Sorting](#sorting) -- [Strings](#strings) -- [Online Challenges](#online-challenges) -- [Others](#others) - -## Data Structures - -- Queue - - [Circular Buffer](data-structures/queue/circular_buffer.cpp) - - [Queue](data-structures/queue/queue.cpp) -- Stack - - [Stack](data-structures/stack/stack.cpp) -- Linked List - - [linked list](data-structures/linkedlist) - -## Dynamic Programming - -- [Coin Change](dynamic-programming/coin_change.cpp) -- [Edit Distance](dynamic-programming/edit_distance.cpp) -- [Knapsack](dynamic-programming/knapsack.cpp) -- [Longest common subsequence](dynamic-programming/lcs.cpp) -- [Longest Path](dynamic-programming/longest_path.cpp) -- [Ways to Cover](dynamic-programming/ways_to_cover.cpp) -- [Fibonacci Numbers](dynamic-programming/fibonacci_number.cpp) -- [Rod Cutting](dynamic-programming/rod_cutting.cpp) +You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) + + + - [Artificial intelligence](#artificial-intelligence) + - [Backtracking](#backtracking) + - [Bit manipulation](#bit-manipulation) + - [Cellular automaton](#cellular-automaton) + - [Computational geometry](#computational-geometry) + - [Cryptography](#cryptography) + - [Data structures](#data-structures) + - [Divide and conquer](#divide-and-conquer) + - [Dynamic programming](#dynamic-programming) + - [Gaming theory](#gaming-theory) + - [Graphs](#graphs) + - [Greedy algorithms](#greedy-algorithms) + - [Math](#math) + - [Networking](#networking) + - [Numerical analysis](#numerical-analysis) + - [Online challenges](#online-challenges) + - [Randomized algorithms](#randomized-algorithms) + - [Serches](#serches) + - [Selections](#selections) + - [Sorting](#sorting) + - [Strings](#strings) + - [So category](#so-category) + +## Artificial intelligence + + - [Togasat](artificial-intelligence/togasat.cpp) + +## Backtracking + + - [Crossword puzzle](backtracking/crossword_puzzle.cpp) + +## Data structures + + - [Pairs with difference k](data-structures/hashmaps/pairs_with_difference_k.cpp) + - [Largest rectangle area](data-structures/largest_rectangle_area.cpp) + - [Linkedlist adt](data-structures/linkedlist/linkedlist_adt.cpp) + - [Circular buffer](data-structures/queue/circular_buffer.cpp) + - [Queue](data-structures/queue/queue.cpp) + - [Stack](data-structures/stack/stack.cpp) + +## Dynamic programming + + - [Coin change](dynamic-programming/coin_change.cpp) + - [Edit distance](dynamic-programming/edit_distance.cpp) + - [Fibonacci number](dynamic-programming/fibonacci_number.cpp) + - [Knapsack](dynamic-programming/knapsack.cpp) + - [Lcs](dynamic-programming/lcs.cpp) + - [Lis](dynamic-programming/lis.cpp) + - [Longest path](dynamic-programming/longest_path.cpp) + - [Matrix chain multiplication](dynamic-programming/matrix_chain_multiplication.cpp) + - [Rod cutting](dynamic-programming/rod_cutting.cpp) + - [Ways to cover](dynamic-programming/ways_to_cover.cpp) ## Graphs -- [Bellman Ford](graphs/bellman_ford.cpp) -- [Breadth-first search](graphs/bfs.cpp) -- [Count Disconnected Components](graphs/count_disconnected_components.cpp) -- [Depth-first search](graphs/dfs.cpp) -- [Dijkstra](graphs/dijkstra.cpp) -- [Floyed Warshall](graphs/floyd_warshall.cpp) -- [Prims Adjacency List](graphs/prims_adjacency_list.cpp) -- [Topo-Sort](graphs/toposort.cpp) + - [Bellman ford](graphs/bellman_ford.cpp) + - [Bfs](graphs/bfs.cpp) + - [Count diconnected components](graphs/count_diconnected_components.cpp) + - [Dfs](graphs/dfs.cpp) + - [Dijkstra](graphs/dijkstra.cpp) + - [Floyd warshall](graphs/floyd_warshall.cpp) + - [Prims adjacency list](graphs/prims_adjacency_list.cpp) + - [Toposort](graphs/toposort.cpp) ## Math -- [Collatz](math/collatz.cpp) -- [Euclids Greatest common divisor](math/euclids_gcd.cpp) -- [Factorial](math/factorial.cpp) -- [Greatest common divisor of array](math/gcd_of_array.cpp) -- [Least common multiple of array](math/lcm_of_array.cpp) -- [Lucky Numbers](math/lucky_numbers.cpp) -- [Modular Exponentiations](math/modular_exponentiations.cpp) -- [nth Fibonacci Number using Goldenratio](math/nth_fibonacci_using_goldenratio.cpp) -- [Armstrong Numbers](math/armstrong_number.cpp) -- [Termo Conversion](math/TermoConv.cpp) -- [Pascal Triangle](math/Pascals_triangle.cpp) -- [Modular Exponentiation](math/modular_exponentiation.cpp) -- [Maximum Subarray Problem ](math/kadence.cpp) -- [Eulers Totient (Phi-function)](math/eulers_totient.cpp) -- [Slicker Algorithm](math/Slicker_Algorithm.cpp) + - [All factors of a numbe r](math/all_factors_of_a_numbe_r.cpp) + - [Armstrong number](math/armstrong_number.cpp) + - [Bshuffll](math/bshuffll.cpp) + - [Chefres](math/chefres.cpp) + - [Collatz](math/collatz.cpp) + - [Euclids gcd](math/euclids_gcd.cpp) + - [Eulers totient](math/eulers_totient.cpp) + - [Factorial loop](math/factorial_loop.cpp) + - [Factorial](math/factorial.cpp) + - [Gcd of array](math/gcd_of_array.cpp) + - [Hoax no](math/hoax_no.cpp) + - [Kadence](math/kadence.cpp) + - [Lcm of array](math/lcm_of_array.cpp) + - [Lucky numbers](math/lucky_numbers.cpp) + - [Magic Square](math/Magic Square.cpp) + - [Modular exponentiation](math/modular_exponentiation.cpp) + - [Nth fibonacci using goldenratio](math/nth_fibonacci_using_goldenratio.cpp) + - [Pascals triangle](math/pascals_triangle.cpp) + - [Sieve of eratosthenes](math/sieve_of_eratosthenes.cpp) + - [Slicker algorithm](math/slicker_algorithm.cpp) + - [Sphenic n o](math/sphenic_n_o.cpp) + - [T ermo conv](math/t_ermo_conv.cpp) ## Searches -- [Binary Search](searches/binary_search.cpp) -- [Jump Search](searches/jump_search.cpp) -- [Linear Search](searches/linear_search.cpp) -- [Ternary Search](searches/ternary_search.cpp) -- [Exponential Search](searches/exponential_search.cpp) + - [Binary search](searches/binary_search.cpp) + - [Exponential search](searches/exponential_search.cpp) + - [Jump search](searches/jump_search.cpp) + - [Linear search](searches/linear_search.cpp) + - [Ternary search](searches/ternary_search.cpp) ## Sorting -- [Bubble Sort](sorting/bubble_sort.cpp) -- [Heap Sort](sorting/heap_sort.cpp) -- [Heap Sort without vectors](sorting/heap_sort_without_vectors.cpp) -- [Insertion Sort](sorting/insertion_sort.cpp) -- [Merge Sort](sorting/merge_sort.cpp) -- [Quick Sort](sorting/quick_sort.cpp) -- [Selection Sort](sorting/selection_sort.cpp) -- [Sort Vector](sorting/sort_vector.cpp) -- [Tree Sort](sorting/tree_sort.cpp) -- [Counting Sort](sorting/counting_sort.cpp) -- [Bogo-Sort](sorting/bogo_sort.cpp) -- [Radix-Sort](sorting/radix_sort.cpp) -- [Rank Sort](sorting/rank_sort.cpp) -- [Shell Sort](sorting/shell_sort.cpp) -- [Stooge Sort](sorting/stooge_sort.cpp) -- [Shaker Sort](sorting/shaker_sort.cpp) + - [Bogo sort](sorting/bogo_sort.cpp) + - [Bubble sort](sorting/bubble_sort.cpp) + - [Counting sort](sorting/counting_sort.cpp) + - [Heap sort without vectors](sorting/heap_sort_without_vectors.cpp) + - [Heap sort](sorting/heap_sort.cpp) + - [Insertion sort](sorting/insertion_sort.cpp) + - [Merge sort](sorting/merge_sort.cpp) + - [Quick sort](sorting/quick_sort.cpp) + - [Radix sort](sorting/radix_sort.cpp) + - [Rank sort](sorting/rank_sort.cpp) + - [Selection sort](sorting/selection_sort.cpp) + - [Shaker sort](sorting/shaker_sort.cpp) + - [Shell sort](sorting/shell_sort.cpp) + - [Sort vector](sorting/sort_vector.cpp) + - [Stooge sort](sorting/stooge_sort.cpp) + - [Tree sort](sorting/tree_sort.cpp) ## Strings -- [Anagram Check](strings/anagram_check.cpp) -- [Lexicographic Ranking](strings/lexicographic_ranking.cpp) -- [Longest Palindrome Subset](strings/longest_palindrome_subset.cpp) -- [Naive Search](strings/naive_search.cpp) -- [Permutations of string](strings/permutations_of_string.cpp) -- [Print duplicate string](strings/print_duplicate_string.cpp) -- [Rabin Karp](strings/rabin_karp.cpp) -- [Remove Adjacent Duplicates](strings/remove_adjacent_duplicates.cpp) -- [Remove Duplicates](strings/remove_duplicates.cpp) -- [Reverse String](strings/reverse_string.cpp) -- [Naive Search](strings/naive_search.cpp) - + - [Anagram check](strings/anagram_check.cpp) + - [Lexicographic ranking](strings/lexicographic_ranking.cpp) + - [Longest palindrome subset](strings/longest_palindrome_subset.cpp) + - [Naive search](strings/naive_search.cpp) + - [Permutations of string](strings/permutations_of_string.cpp) + - [Print duplicate string](strings/print_duplicate_string.cpp) + - [Rabin carp](strings/rabin_carp.cpp) + - [Rabin karp](strings/rabin_karp.cpp) + - [Remove adjacent duplicates](strings/remove_adjacent_duplicates.cpp) + - [Remove duplicates](strings/remove_duplicates.cpp) + - [Reverse string](strings/reverse_string.cpp) + - [Z algorithm](strings/z_algorithm.cpp) + + ## License - -This work is released under [MIT License](https://github.com/abranhe/algorithms/blob/master/liceense) - -[![MIT IMG](https://cdn.abranhe.com/projects/algorithms/mit-license.png)](https://github.com/abranhe/algorithms/blob/master/license) - +This work is released under [MIT License][MIT] +[![MIT IMG][MIT-logo]][MIT] To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. - - +[MIT]: https://github.com/abranhe/algorithms/blob/master/license +[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png \ No newline at end of file diff --git a/scripts/formatter.js b/scripts/formatter.js index f058e806..c22a8c67 100644 --- a/scripts/formatter.js +++ b/scripts/formatter.js @@ -6,11 +6,12 @@ */ 'use strict'; -const glob = require('glob'); +const fs = require('fs'); const path = require('path'); +const glob = require('glob'); +const chalk = require('chalk'); const decamelize = require('decamelize'); const shell = require('child_process').execSync; -const chalk = require('chalk'); const getFiles = (src, callback) => { glob(src + '/**', callback); @@ -29,14 +30,19 @@ getFiles('../', (err, res) => { // Only avilable for Linux/Macos // https://stackoverflow.com/a/41030518/7602110 // Can be replaced in the future - shell(`mv ${file} ${decamelize(file)}`); + shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`); - if (file !== decamelize(file)) { - console.log(`The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file))}`); + if (file.replace(' ', '\\ ') !== decamelize(file)) { + console.log( + `The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}` + ); // Change file on git history // https://stackoverflow.com/a/16071375/7602110 - shell(`git mv --force ${file} ${decamelize(file)}`); + shell(`cd ../\ + git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize( + file.replace(' ', '_').replace('../', '') + )}`); } // Replace for convention .h for .hpp @@ -46,3 +52,119 @@ getFiles('../', (err, res) => { }); } }); + +const categories = [ + 'artificial-intelligence', + 'backtracking', + 'bit-manipulation', + 'cellular-automaton', + 'computational-geometry', + 'cryptography', + 'data-structures', + 'divide-and-conquer', + 'dynamic-programming', + 'gaming-theory', + 'graphs', + 'greedy-algorithms', + 'math', + 'networking', + 'numerical-analysis', + 'online-challenges', + 'randomized-algorithms', + 'serches', + 'selections', + 'sorting', + 'strings', + 'so-category' +]; + +const readme = [ + ` + +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+

All ▲lgorithms implemented in C++

+ + + + + + +
+
+allalgorithms.com +
+ + + +## Contents + +You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) + +` +]; + +categories.forEach((category) => { + readme.push(` - [${category.charAt(0).toUpperCase() + category.slice(1).replace(/\-/g, ' ')}](#${category})`); +}); + +getFiles('../', (err, res) => { + let printedCategories = []; + + if (err) { + console.log('Error', err); + } else { + res.map((file) => { + if (path.extname(file) !== '.cpp') { + return; + } + let algorithmName = path.basename(file).replace('.cpp', '').replace('_', ' '); + let currentCategory = path.parse(file).dir.split(path.sep)[1]; + + if (!printedCategories.includes(currentCategory)) { + printedCategories.push(currentCategory); + readme.push(`\n## ${currentCategory.charAt(0).toUpperCase() + currentCategory.slice(1).replace(/\-/g, ' ')}\n`); + } + + readme.push( + ` - [${algorithmName.charAt(0).toUpperCase() + algorithmName.slice(1).replace(/\_/g, ' ')}](${file.replace( + '../', + '' + )})` + ); + }); + + readme.push(` + +## License +This work is released under [MIT License][MIT] +[![MIT IMG][MIT-logo]][MIT] +To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. +
+ + + +
+
+[MIT]: https://github.com/abranhe/algorithms/blob/master/license +[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png`); + + fs.writeFile(`../readme.md`, readme.join('\n'), (err) => { + if (err) throw err; + console.log(chalk.green('The file was succesfully saved!')); + }); + } +}); diff --git a/scripts/validate.js b/scripts/validate.js index 6735bc0f..2da0799b 100644 --- a/scripts/validate.js +++ b/scripts/validate.js @@ -22,18 +22,22 @@ getFiles('../', (err, res) => { if (err) { console.log('Error', err); } else { + let invalid = false; res.map((file) => { // Accept only valid C++ Files (.cpp,.hpp,.h) if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { return; } - if (file !== decamelize(file)) { - console.log(`The file ${chalk.red(path.basename(file))} does not follow the correct style.`); - // Stop when a file with wrong format is found - throw new TypeError(`File project style does not follow the All ▲lgorithms structure.`); + if (file !== decamelize(file.replace(' ', ''))) { + console.log(`${chalk.red(path.basename(file))} does not follow the correct style.`); + let invalid = true; } - console.log(`The file ${chalk.green(path.basename(file))} is ok.`); + console.log(`${chalk.green(path.basename(file))} is ok.`); }); + if (invalid) { + // Throw an error at the end of checking all files + throw new TypeError(`Expected the All ▲lgorithms structure.`); + } } }); diff --git a/strings/anagram_check.cpp b/strings/anagram_check.cpp index f4298f34..13d38364 100644 --- a/strings/anagram_check.cpp +++ b/strings/anagram_check.cpp @@ -29,16 +29,16 @@ bool areAnagram(char *str1, char *str2) // If length of both strings is not same, then they // cannot be anagram if (n1 != n2) - return false; + return false; // Sort both strings quickSort(str1, 0, n1 - 1); quickSort(str2, 0, n2 - 1); // Compare sorted strings - for (int i = 0; i < n1; i++) - if (str1[i] != str2[i]) - return false; + for (int i = 0; i < n1; i++) + if (str1[i] != str2[i]) + return false; return true; } @@ -49,8 +49,8 @@ void exchange(char *a, char *b) { char temp; temp = *a; - *a = *b; - *b = temp; + *a = *b; + *b = temp; } int partition(char A[], int si, int ei) @@ -61,13 +61,13 @@ int partition(char A[], int si, int ei) for (j = si; j <= ei - 1; j++) { - if(A[j] <= x) + if (A[j] <= x) { i++; exchange(&A[i], &A[j]); } } - exchange (&A[i + 1], &A[ei]); + exchange(&A[i + 1], &A[ei]); return (i + 1); } @@ -78,8 +78,8 @@ ei --> Ending index */ void quickSort(char A[], int si, int ei) { - int pi; /* Partitioning index */ - if(si < ei) + int pi; /* Partitioning index */ + if (si < ei) { pi = partition(A, si, ei); quickSort(A, si, pi - 1); @@ -93,9 +93,9 @@ int main() char str1[] = ""; //String 1 char str2[] = ""; //String 2 if (areAnagram(str1, str2)) - printf("The two strings are anagram of each other"); + printf("The two strings are anagram of each other"); else - printf("The two strings are not anagram of each other"); + printf("The two strings are not anagram of each other"); return 0; } diff --git a/strings/lexicographic_ranking.cpp b/strings/lexicographic_ranking.cpp index 0d20da19..06aee17c 100644 --- a/strings/lexicographic_ranking.cpp +++ b/strings/lexicographic_ranking.cpp @@ -15,16 +15,16 @@ // A utility function to find factorial of n int fact(int n) { - return (n <= 1)? 1 :n * fact(n-1); + return (n <= 1) ? 1 : n * fact(n - 1); } // A utility function to count smaller characters on right // of arr[low] -int findSmallerInRight(char* str, int low, int high) +int findSmallerInRight(char *str, int low, int high) { int countRight = 0, i; - for (i = low+1; i <= high; ++i) + for (i = low + 1; i <= high; ++i) if (str[i] < str[low]) ++countRight; @@ -33,7 +33,7 @@ int findSmallerInRight(char* str, int low, int high) // A function to find rank of a string in all permutations // of characters -int findRank (char* str) +int findRank(char *str) { int len = strlen(str); int mul = fact(len); @@ -47,9 +47,9 @@ int findRank (char* str) // count number of chars smaller than str[i] // fron str[i+1] to str[len-1] - countRight = findSmallerInRight(str, i, len-1); + countRight = findSmallerInRight(str, i, len - 1); - rank += countRight * mul ; + rank += countRight * mul; } return rank; @@ -59,6 +59,6 @@ int findRank (char* str) int main() { char str[] = ""; //Enter string here - printf ("%d", findRank(str)); + printf("%d", findRank(str)); return 0; } diff --git a/strings/longest_palindrome_subset.cpp b/strings/longest_palindrome_subset.cpp index 6d47333e..d1360a1d 100644 --- a/strings/longest_palindrome_subset.cpp +++ b/strings/longest_palindrome_subset.cpp @@ -16,18 +16,18 @@ #include // A utility function to print a substring str[low..high] -void printSubStr( char* str, int low, int high ) +void printSubStr(char *str, int low, int high) { - for( int i = low; i <= high; ++i ) + for (int i = low; i <= high; ++i) printf("%c", str[i]); } // This function prints the longest palindrome substring // of str[]. // It also returns the length of the longest palindrome -int longestPalSubstr( char *str ) +int longestPalSubstr(char *str) { - int n = strlen( str ); // get length of input string + int n = strlen(str); // get length of input string // table[i][j] will be false if substring str[i..j] // is not palindrome. @@ -42,11 +42,11 @@ int longestPalSubstr( char *str ) // check for sub-string of length 2. int start = 0; - for (int i = 0; i < n-1; ++i) + for (int i = 0; i < n - 1; ++i) { - if (str[i] == str[i+1]) + if (str[i] == str[i + 1]) { - table[i][i+1] = true; + table[i][i + 1] = true; start = i; maxLength = 2; } @@ -57,7 +57,7 @@ int longestPalSubstr( char *str ) for (int k = 3; k <= n; ++k) { // Fix the starting index - for (int i = 0; i < n-k+1 ; ++i) + for (int i = 0; i < n - k + 1; ++i) { // Get the ending index of substring from // starting index i and length k @@ -66,7 +66,7 @@ int longestPalSubstr( char *str ) // checking for sub-string from ith index to // jth index iff str[i+1] to str[j-1] is a // palindrome - if (table[i+1][j-1] && str[i] == str[j]) + if (table[i + 1][j - 1] && str[i] == str[j]) { table[i][j] = true; @@ -80,7 +80,7 @@ int longestPalSubstr( char *str ) } printf("Longest palindrome substring is: "); - printSubStr( str, start, start + maxLength - 1 ); + printSubStr(str, start, start + maxLength - 1); return maxLength; // return length of LPS } @@ -89,6 +89,6 @@ int longestPalSubstr( char *str ) int main() { char str[] = ""; //Enter string here - printf("\nLength is: %d\n", longestPalSubstr( str ) ); + printf("\nLength is: %d\n", longestPalSubstr(str)); return 0; } diff --git a/strings/naive_search.cpp b/strings/naive_search.cpp index ecb376e1..51584bb0 100644 --- a/strings/naive_search.cpp +++ b/strings/naive_search.cpp @@ -11,36 +11,36 @@ // Contributed by: Tushar Kanakagiri // Github: @tusharkanakagiri // -#include -#include +#include +#include /* A modified Naive Pettern Searching algorithn that is optimized for the cases when all characters of pattern are different */ void search(char pat[], char txt[]) { - int M = strlen(pat); - int N = strlen(txt); - int i = 0; + int M = strlen(pat); + int N = strlen(txt); + int i = 0; - while (i <= N - M) - { - int j; + while (i <= N - M) + { + int j; - /* For current index i, check for pattern match */ - for (j = 0; j < M; j++) - if (txt[i+j] != pat[j]) - break; + /* For current index i, check for pattern match */ + for (j = 0; j < M; j++) + if (txt[i + j] != pat[j]) + break; - if (j == M) // if pat[0...M-1] = txt[i, i+1, ...i+M-1] - { - printf("Pattern found at index %d \n", i); - i = i + M; - } - else if (j == 0) - i = i + 1; - else - i = i + j; // slide the pattern by j - } + if (j == M) // if pat[0...M-1] = txt[i, i+1, ...i+M-1] + { + printf("Pattern found at index %d \n", i); + i = i + M; + } + else if (j == 0) + i = i + 1; + else + i = i + j; // slide the pattern by j + } } /* Driver program to test above function */ diff --git a/strings/permutations_of_string.cpp b/strings/permutations_of_string.cpp index 901c9112..40546409 100644 --- a/strings/permutations_of_string.cpp +++ b/strings/permutations_of_string.cpp @@ -10,35 +10,35 @@ // Contributed by: Tushar Kanakagiri // Github: @tusharkanakagiri // -#include -#include -#include +#include +#include +#include /* Following function is used by the library qsort() function to sort an array of chars */ -int compare (const void * a, const void * b); +int compare(const void *a, const void *b); /* The main function that recursively prints all repeated permutations of the given string. It uses data[] to store all permutations one by one */ -void allLexicographicRecur (char *str, char* data, int last, int index) +void allLexicographicRecur(char *str, char *data, int last, int index) { int i, len = strlen(str); // One by one fix all characters at the given index and recur for // the/ subsequent indexes - for ( i=0; i -# include -# define NO_OF_CHARS 256 +#include +#include +#define NO_OF_CHARS 256 /* Fills count array with frequency of characters */ void fillCharCounts(char *str, int *count) { - int i; - for (i = 0; *(str+i); i++) - count[*(str+i)]++; + int i; + for (i = 0; *(str + i); i++) + count[*(str + i)]++; } /* Print duplicates present in the passed string */ @@ -31,8 +31,8 @@ void printDups(char *str) // Print characters having count more than 0 int i; for (i = 0; i < NO_OF_CHARS; i++) - if(count[i] > 1) - printf("%c, count = %d \n", i, count[i]); + if (count[i] > 1) + printf("%c, count = %d \n", i, count[i]); free(count); } @@ -40,8 +40,8 @@ void printDups(char *str) /* Driver program to test to pront printDups*/ int main() { - char str[] = ""; //Enter string here - printDups(str); - getchar(); - return 0; + char str[] = ""; //Enter string here + printDups(str); + getchar(); + return 0; } diff --git a/strings/rabin_carp.cpp b/strings/rabin_carp.cpp index acd6fd15..8a853caa 100644 --- a/strings/rabin_carp.cpp +++ b/strings/rabin_carp.cpp @@ -1,117 +1,71 @@ - /* - - * C++ Program to Implement Rabin-Karp Algorithm - - */ - - #include - - #include - - #include - - #include - - using namespace std; - - #define d 256 - - /* - - * search a substring in a string - - */ - - void search(char *pat, char *txt, int q) - +/** + * C++ Program to Implement Rabin-Karp Algorithm + */ + +#include +#include +#include +#include + +using namespace std; +#define d 256 + +/** + * Ssearch a substring in a string + */ + +void search(char *pat, char *txt, int q) +{ + int M = strlen(pat); + int N = strlen(txt); + int i, j; + int p = 0; + int t = 0; + int h = 1; + + for (i = 0; i < M - 1; i++) + h = (h * d) % q; + + for (i = 0; i < M; i++) { + p = (d * p + pat[i]) % q; + t = (d * t + txt[i]) % q; + } - int M = strlen(pat); - - int N = strlen(txt); - - int i, j; - - int p = 0; - - int t = 0; - - int h = 1; - - for (i = 0; i < M - 1; i++) - - h = (h * d) % q; - - for (i = 0; i < M; i++) - - { - - p = (d *p + pat[i]) % q; - - t = (d * t + txt[i]) % q; - - } - - for (i = 0; i <= N - M; i++) - + for (i = 0; i <= N - M; i++) + { + if (p == t) { - - if (p == t) - + for (j = 0; j < M; j++) { - - for (j = 0; j < M; j++) - - { - - if (txt[i + j] != pat[j]) - - break; - - } - - if (j == M) - - { - - cout<<"Pattern found at index: "< -#include +#include +#include // d is the number of characters in the input alphabet #define d 256 @@ -30,15 +30,15 @@ void search(char pat[], char txt[], int q) int h = 1; // The value of h would be "pow(d, M-1)%q" - for (i = 0; i < M-1; i++) - h = (h*d)%q; + for (i = 0; i < M - 1; i++) + h = (h * d) % q; // Calculate the hash value of pattern and first // window of text for (i = 0; i < M; i++) { - p = (d*p + pat[i])%q; - t = (d*t + txt[i])%q; + p = (d * p + pat[i]) % q; + t = (d * t + txt[i]) % q; } // Slide the pattern over text one by one @@ -48,12 +48,12 @@ void search(char pat[], char txt[], int q) // Check the hash values of current window of text // and pattern. If the hash values match then only // check for characters on by one - if ( p == t ) + if (p == t) { /* Check for characters one by one */ for (j = 0; j < M; j++) { - if (txt[i+j] != pat[j]) + if (txt[i + j] != pat[j]) break; } @@ -64,14 +64,14 @@ void search(char pat[], char txt[], int q) // Calculate hash value for next window of text: Remove // leading digit, add trailing digit - if ( i < N-M ) + if (i < N - M) { - t = (d*(t - txt[i]*h) + txt[i+M])%q; + t = (d * (t - txt[i] * h) + txt[i + M]) % q; // We might get negative value of t, converting it // to positive if (t < 0) - t = (t + q); + t = (t + q); } } } @@ -81,7 +81,7 @@ int main() { char txt[] = ""; //Enter the entire text here char pat[] = ""; //Enter the string to be searched here - int q = 101; // A prime number + int q = 101; // A prime number search(pat, txt, q); return 0; } diff --git a/strings/remove_adjacent_duplicates.cpp b/strings/remove_adjacent_duplicates.cpp index 967e531b..e28ead88 100644 --- a/strings/remove_adjacent_duplicates.cpp +++ b/strings/remove_adjacent_duplicates.cpp @@ -1,5 +1,5 @@ // -// C/C++ program to remove all adjacent duplicates from a string +// C/C++ program to remove all adjacent duplicates from a string // // The All ▲lgorithms Project // @@ -15,7 +15,7 @@ using namespace std; // Recursively removes adjacent duplicates from str and returns // new string. las_removed is a pointer to last_removed character -char* removeUtil(char *str, char *last_removed) +char *removeUtil(char *str, char *last_removed) { // If length of string is 1 or 0 if (str[0] == '\0' || str[1] == '\0') @@ -35,21 +35,21 @@ char* removeUtil(char *str, char *last_removed) // At this point, the first character is definiotely different // from its adjacent. Ignore first character and recursively // remove characters from remaining string - char* rem_str = removeUtil(str+1, last_removed); + char *rem_str = removeUtil(str + 1, last_removed); // Check if the first character of the rem_string matches with // the first character of the original string if (rem_str[0] && rem_str[0] == str[0]) { *last_removed = str[0]; - return (rem_str+1); // Remove first character + return (rem_str + 1); // Remove first character } // If remaining string becomes empty and last removed character // is same as first character of original string. This is needed // for a string like "acbbcddc" if (rem_str[0] == '\0' && *last_removed == str[0]) - return rem_str; + return rem_str; // If the two first characters of str and rem_str don't match, // append first character of str before the first character of diff --git a/strings/remove_duplicates.cpp b/strings/remove_duplicates.cpp index 46da1cae..4a56d437 100644 --- a/strings/remove_duplicates.cpp +++ b/strings/remove_duplicates.cpp @@ -1,5 +1,5 @@ // -// CPP program to remove duplicate character +// CPP program to remove duplicate character // from character array and print in sorted // order // @@ -11,7 +11,7 @@ // Contributed by: Tushar Kanakagiri // Github: @tusharkanakagiri // -#include +#include using namespace std; char *removeDuplicate(char str[], int n) @@ -20,18 +20,19 @@ char *removeDuplicate(char str[], int n) int index = 0; // Traverse through all characters - for (int i=0; i - #include - #include +#include +#include +#include - using namespace std; +using namespace std; - bool zAlgorithm(string pattern, string target) +bool zAlgorithm(string pattern, string target) +{ + string s = pattern + '$' + target; + int n = s.length(); + vector z(n, 0); + int goal = pattern.length(); + int r = 0, l = 0, i; + for (int k = 1; k < n; k++) { - - string s = pattern + '$' + target; - - int n = s.length(); - - vector z(n, 0); - - int goal = pattern.length(); - - int r = 0, l = 0, i; - - for (int k = 1; k < n; k++) - + if (k > r) { - - if (k > r) - + for (i = k; i < n && s[i] == s[i - k]; i++) + ; + if (i > k) { - - for (i = k; i < n && s[i] == s[i - k]; i++); - - if (i > k) - - { - - z[k] = i - k; - - l = k; - - r = i - 1; - - } - + z[k] = i - k; + l = k; + r = i - 1; } + } + else + { + int kt = k - l, b = r - k + 1; - else - + if (z[kt] > b) { - - int kt = k - l, b = r - k + 1; - - if (z[kt] > b) - - { - - for (i = r + 1; i < n && s[i] == s[i - k]; i++); - - z[k] = i - k; - - l = k; - - r = i - 1; - - } - + for (i = r + 1; i < n && s[i] == s[i - k]; i++) + ; + z[k] = i - k; + l = k; + r = i - 1; } - - if (z[k] == goal) - - return true; - } - return false; - + if (z[k] == goal) + return true; } + return false; +} +int main() +{ + string tar = "This is a sample Testcase"; + string pat = "case"; - int main() - + if (zAlgorithm(pat, tar)) { + cout << "'" << pat << "' found in string '" << tar << "'" << endl; + } - string tar = "This is a sample Testcase"; - - string pat = "case"; - - if (zAlgorithm(pat, tar)) - - cout<<"'"< Date: Fri, 22 Feb 2019 15:24:30 -0500 Subject: [PATCH 125/285] fixing typo --- scripts/formatter.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/formatter.js b/scripts/formatter.js index c22a8c67..cfb50f9a 100644 --- a/scripts/formatter.js +++ b/scripts/formatter.js @@ -75,7 +75,7 @@ const categories = [ 'selections', 'sorting', 'strings', - 'so-category' + 'no-category' ]; const readme = [ @@ -113,7 +113,6 @@ const readme = [ ## Contents You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) - ` ]; @@ -149,18 +148,24 @@ getFiles('../', (err, res) => { readme.push(` + ## License + This work is released under [MIT License][MIT] [![MIT IMG][MIT-logo]][MIT] + To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. + + [MIT]: https://github.com/abranhe/algorithms/blob/master/license -[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png`); +[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png +`); fs.writeFile(`../readme.md`, readme.join('\n'), (err) => { if (err) throw err; From d8286fafa45568eb6486e36a0072772872160004 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 22 Feb 2019 15:26:49 -0500 Subject: [PATCH 126/285] generate new readme --- readme.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 2d22d3f4..8e74c185 100644 --- a/readme.md +++ b/readme.md @@ -33,7 +33,6 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) - - [Artificial intelligence](#artificial-intelligence) - [Backtracking](#backtracking) - [Bit manipulation](#bit-manipulation) @@ -55,7 +54,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http - [Selections](#selections) - [Sorting](#sorting) - [Strings](#strings) - - [So category](#so-category) + - [No category](#no-category) ## Artificial intelligence @@ -114,7 +113,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http - [Kadence](math/kadence.cpp) - [Lcm of array](math/lcm_of_array.cpp) - [Lucky numbers](math/lucky_numbers.cpp) - - [Magic Square](math/Magic Square.cpp) + - [Magic square](math/magic_square.cpp) - [Modular exponentiation](math/modular_exponentiation.cpp) - [Nth fibonacci using goldenratio](math/nth_fibonacci_using_goldenratio.cpp) - [Pascals triangle](math/pascals_triangle.cpp) @@ -166,15 +165,19 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http - [Z algorithm](strings/z_algorithm.cpp) + ## License -This work is released under [MIT License][MIT] -[![MIT IMG][MIT-logo]][MIT] + +This work is released under [MIT License][MIT] [![MIT IMG][MIT-logo]][MIT] + To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. + + [MIT]: https://github.com/abranhe/algorithms/blob/master/license -[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png \ No newline at end of file +[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png From d3d63c4104b3fe69e1eb27be3f9dab2cc0280084 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Sat, 23 Feb 2019 14:27:34 -0500 Subject: [PATCH 127/285] fixing img license --- readme.md | 4 +++- scripts/formatter.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 8e74c185..ceb76c88 100644 --- a/readme.md +++ b/readme.md @@ -168,7 +168,9 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http ## License -This work is released under [MIT License][MIT] [![MIT IMG][MIT-logo]][MIT] +This work is released under [MIT License][MIT] + +[![MIT IMG][MIT-logo]][MIT] To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. diff --git a/scripts/formatter.js b/scripts/formatter.js index cfb50f9a..d3f4e0eb 100644 --- a/scripts/formatter.js +++ b/scripts/formatter.js @@ -1,6 +1,6 @@ /** * The All Algorithms C++ Formatter - * + * * Author: Carlos Abraham Hernandez * https://abranhe.com (abraham@abranhe.com) */ @@ -152,6 +152,7 @@ getFiles('../', (err, res) => { ## License This work is released under [MIT License][MIT] + [![MIT IMG][MIT-logo]][MIT] To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. From b00733e665c8d01b07f77d3d5e0147bcbb4e7951 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Tue, 26 Feb 2019 20:06:37 -0500 Subject: [PATCH 128/285] adding maintainers on readme --- .github/contributing.md | 2 +- readme.md | 13 +++++ scripts/format.js | 55 +++++++++++++++++++ scripts/{formatter.js => generate-readme.js} | 58 ++++++-------------- scripts/package.json | 5 +- scripts/validate.js | 9 +-- 6 files changed, 94 insertions(+), 48 deletions(-) create mode 100644 scripts/format.js rename scripts/{formatter.js => generate-readme.js} (75%) diff --git a/.github/contributing.md b/.github/contributing.md index def0aa77..e75d9db6 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -136,4 +136,4 @@ If you are modifying an algorithm make sure you add a benchmark using [Repl.it]( #### Lastly and not less important: -Make sure you start ⭐️ and follow [@abranhe](https://git.io/abranhe) +Make sure you start ⭐️ and follow [@abranhe](https://github.com/abranhe) diff --git a/readme.md b/readme.md index ceb76c88..ccd0f222 100644 --- a/readme.md +++ b/readme.md @@ -135,6 +135,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http - [Bogo sort](sorting/bogo_sort.cpp) - [Bubble sort](sorting/bubble_sort.cpp) - [Counting sort](sorting/counting_sort.cpp) + - [Gnome sort](sorting/gnome_sort.cpp) - [Heap sort without vectors](sorting/heap_sort_without_vectors.cpp) - [Heap sort](sorting/heap_sort.cpp) - [Insertion sort](sorting/insertion_sort.cpp) @@ -166,6 +167,12 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http +## Maintainers + +|[![1][1-avatar]][1]|[![2][2-avatar]][2]| +| :-: | :-: | +| [Carlos Abraham][1] | [Christian Bender][2] | + ## License This work is released under [MIT License][MIT] @@ -183,3 +190,9 @@ To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github [MIT]: https://github.com/abranhe/algorithms/blob/master/license [MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png + + +[1]: https://github.com/abranhe +[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50 +[2]: https://github.com/christianbender +[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50 diff --git a/scripts/format.js b/scripts/format.js new file mode 100644 index 00000000..9864e6fc --- /dev/null +++ b/scripts/format.js @@ -0,0 +1,55 @@ +#!/usr/bin/env node +'use strict'; + +/** + * Usage: node format.js + * + * Author: Carlos Abraham Hernandez + * https://abranhe.com (abraham@abranhe.com) + */ + +const path = require('path'); +const glob = require('glob'); +const chalk = require('chalk'); +const decamelize = require('decamelize'); +const shell = require('child_process').execSync; + +const getFiles = (src, callback) => { + glob(src + '/**', callback); +}; + +getFiles('../', (err, res) => { + if (err) { + console.log('Error', err); + } else { + res.map((file) => { + // Accept only valid C++ Files (.cpp,.hpp,.h) + if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { + return; + } + + // Only avilable for Linux/Macos + // https://stackoverflow.com/a/41030518/7602110 + // Can be replaced in the future + shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`); + + if (file.replace(' ', '\\ ') !== decamelize(file)) { + console.log( + `The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}` + ); + + // Change file on git history + // https://stackoverflow.com/a/16071375/7602110 + shell(`cd ../\ + git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize( + file.replace(' ', '_').replace('../', '') + )}`); + } + + // Replace for convention .h for .hpp + if (path.extname(file) === '.h') { + shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`); + } + }); + } +}); diff --git a/scripts/formatter.js b/scripts/generate-readme.js similarity index 75% rename from scripts/formatter.js rename to scripts/generate-readme.js index d3f4e0eb..6ffe5379 100644 --- a/scripts/formatter.js +++ b/scripts/generate-readme.js @@ -1,58 +1,22 @@ +#!/usr/bin/env node +'use strict'; + /** - * The All Algorithms C++ Formatter + * Usage: node generate-readme.js * * Author: Carlos Abraham Hernandez * https://abranhe.com (abraham@abranhe.com) */ -'use strict'; const fs = require('fs'); const path = require('path'); const glob = require('glob'); const chalk = require('chalk'); -const decamelize = require('decamelize'); -const shell = require('child_process').execSync; const getFiles = (src, callback) => { glob(src + '/**', callback); }; -getFiles('../', (err, res) => { - if (err) { - console.log('Error', err); - } else { - res.map((file) => { - // Accept only valid C++ Files (.cpp,.hpp,.h) - if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { - return; - } - - // Only avilable for Linux/Macos - // https://stackoverflow.com/a/41030518/7602110 - // Can be replaced in the future - shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`); - - if (file.replace(' ', '\\ ') !== decamelize(file)) { - console.log( - `The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}` - ); - - // Change file on git history - // https://stackoverflow.com/a/16071375/7602110 - shell(`cd ../\ - git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize( - file.replace(' ', '_').replace('../', '') - )}`); - } - - // Replace for convention .h for .hpp - if (path.extname(file) === '.h') { - shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`); - } - }); - } -}); - const categories = [ 'artificial-intelligence', 'backtracking', @@ -149,6 +113,12 @@ getFiles('../', (err, res) => { readme.push(` +## Maintainers + +|[![1][1-avatar]][1]|[![2][2-avatar]][2]| +| :-: | :-: | +| [Carlos Abraham][1] | [Christian Bender][2] | + ## License This work is released under [MIT License][MIT] @@ -166,6 +136,12 @@ To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github [MIT]: https://github.com/abranhe/algorithms/blob/master/license [MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png + + +[1]: https://github.com/abranhe +[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50 +[2]: https://github.com/christianbender +[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50 `); fs.writeFile(`../readme.md`, readme.join('\n'), (err) => { @@ -173,4 +149,4 @@ To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github console.log(chalk.green('The file was succesfully saved!')); }); } -}); +}); \ No newline at end of file diff --git a/scripts/package.json b/scripts/package.json index 2093c3a0..cf9afa5f 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -1,11 +1,12 @@ { "name": "scripts", "version": "1.0.0", - "description": "Maintaining clean the All ▲lgorithms Project", + "description": "Keeping clean the All ▲lgorithms Project", "main": "formatter.js", "scripts": { "validate": "node validate.js", - "format": "node formatter.js" + "format": "node format.js", + "readme": "node generate-readme.js" }, "license": "MIT", "private": true, diff --git a/scripts/validate.js b/scripts/validate.js index 2da0799b..bc561140 100644 --- a/scripts/validate.js +++ b/scripts/validate.js @@ -1,18 +1,19 @@ +#!/usr/bin/env node +'use strict'; + /** - * validate.js - * * The All ▲lgorithms validator CLI * + * Usage: node validate.js + * * Author: Carlos Abraham Hernandez * https://abranhe.com (abraham@abranhe.com) */ -'use strict'; const glob = require('glob'); const path = require('path'); const decamelize = require('decamelize'); const chalk = require('chalk'); -const shell = require('child_process').execSync; const getFiles = (src, callback) => { glob(src + '/**', callback); From b17719f4541170aa471a71bbf493efe0bc8de35e Mon Sep 17 00:00:00 2001 From: mohammd mahdi reisi Date: Sun, 4 Aug 2019 06:40:44 -0700 Subject: [PATCH 129/285] Add files via upload --- graphs/gr.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 graphs/gr.cpp diff --git a/graphs/gr.cpp b/graphs/gr.cpp new file mode 100644 index 00000000..54483d21 --- /dev/null +++ b/graphs/gr.cpp @@ -0,0 +1,64 @@ +#include + +using namespace std; + + +typedef vector vi; +typedef pair pi; + +#define int long long +#define F first +#define S second +#define PB push_back +#define MP make_pair +#define REP(i, a, b) for(int i =a;i < b; i++) + +const int MX = 2e5 + 3; +vi adj[MX]; +int mark[MX],dis[MX], ans; + +void DFS(int u, int par, int k); + +int32_t main() +{ + ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); + int n, m; + int u, v; + cin>>n>>m; + ans = m + 1; + REP(i, 0, m) + { + cin>>u>>v; + adj[v].PB(u); + adj[u].PB(v); + } + REP(i, 1, n+1) + { + dis[i]=0; + DFS(i, -1, mark[i]); + } + if(ans == m+1) cout<<-1; + else cout< Date: Sun, 4 Aug 2019 18:11:21 +0430 Subject: [PATCH 130/285] Delete gr.cpp --- graphs/gr.cpp | 64 --------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 graphs/gr.cpp diff --git a/graphs/gr.cpp b/graphs/gr.cpp deleted file mode 100644 index 54483d21..00000000 --- a/graphs/gr.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include - -using namespace std; - - -typedef vector vi; -typedef pair pi; - -#define int long long -#define F first -#define S second -#define PB push_back -#define MP make_pair -#define REP(i, a, b) for(int i =a;i < b; i++) - -const int MX = 2e5 + 3; -vi adj[MX]; -int mark[MX],dis[MX], ans; - -void DFS(int u, int par, int k); - -int32_t main() -{ - ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); - int n, m; - int u, v; - cin>>n>>m; - ans = m + 1; - REP(i, 0, m) - { - cin>>u>>v; - adj[v].PB(u); - adj[u].PB(v); - } - REP(i, 1, n+1) - { - dis[i]=0; - DFS(i, -1, mark[i]); - } - if(ans == m+1) cout<<-1; - else cout< Date: Sun, 4 Aug 2019 06:41:53 -0700 Subject: [PATCH 131/285] Add files via upload --- graphs/grith.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 graphs/grith.cpp diff --git a/graphs/grith.cpp b/graphs/grith.cpp new file mode 100644 index 00000000..54483d21 --- /dev/null +++ b/graphs/grith.cpp @@ -0,0 +1,64 @@ +#include + +using namespace std; + + +typedef vector vi; +typedef pair pi; + +#define int long long +#define F first +#define S second +#define PB push_back +#define MP make_pair +#define REP(i, a, b) for(int i =a;i < b; i++) + +const int MX = 2e5 + 3; +vi adj[MX]; +int mark[MX],dis[MX], ans; + +void DFS(int u, int par, int k); + +int32_t main() +{ + ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); + int n, m; + int u, v; + cin>>n>>m; + ans = m + 1; + REP(i, 0, m) + { + cin>>u>>v; + adj[v].PB(u); + adj[u].PB(v); + } + REP(i, 1, n+1) + { + dis[i]=0; + DFS(i, -1, mark[i]); + } + if(ans == m+1) cout<<-1; + else cout< Date: Mon, 16 Sep 2019 13:34:46 +0530 Subject: [PATCH 132/285] Hamiltonion Problem --- graphs/hamiltonion.cpp | 138 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 graphs/hamiltonion.cpp diff --git a/graphs/hamiltonion.cpp b/graphs/hamiltonion.cpp new file mode 100644 index 00000000..69ce0bd4 --- /dev/null +++ b/graphs/hamiltonion.cpp @@ -0,0 +1,138 @@ +#include +#include +#include +#include + +using namespace std; + +class Edge { + public: + int nbr; + int wt; +}; +vector> graph; + +void addEdge(int v1, int v2, int wt) +{ + Edge e1; + e1.nbr = v2; + e1.wt = wt; + graph[v1].push_back(e1); + + Edge e2; + e2.nbr = v1; + e2.wt = wt; + graph[v2].push_back(e2); +} + +void display() +{ + for(int v = 0; v < graph.size(); v++) + { + cout << v << " -> "; + for(int n = 0; n < graph[v].size(); n++) + { + Edge ne = graph[v][n]; + cout << "[" << ne.nbr << "-" << ne.wt << "], "; + } + cout << "." << endl; + } +} + +bool haspath(int s, int d, vector& visited) +{ + if(s == d) + { + return true; + } + + visited[s] = true; + for(int n = 0; n < graph[s].size(); n++) + { + Edge ne = graph[s][n]; + if(visited[ne.nbr] == false) + { + bool hpfntod = haspath(ne.nbr, d, visited); + if(hpfntod == true) + { + return true; + } + } + } + + return false; +} + +void printallpaths(int s, int d, vector& visited, + string psf, int dsf) +{ + if(s == d) + { + cout << psf << d << "@" << dsf << endl; + return; + } + visited[s] = true; + for(int n = 0; n < graph[s].size(); n++) + { + Edge ne = graph[s][n]; + if(visited[ne.nbr] == false) + { + printallpaths(ne.nbr, d, visited, + psf + to_string(s), + dsf + ne.wt); + } + } + visited[s] = false; +} +void hamiltonian(int s, vector& visited, string asf, int os) +{ + if(csf == graph.size()-1) + cout<()); // 0 + graph.push_back(vector()); // 1 + graph.push_back(vector()); // 2 + graph.push_back(vector()); // 3 + graph.push_back(vector()); // 4 + graph.push_back(vector()); // 5 + graph.push_back(vector()); // 6 + + addEdge(0, 1, 10); + addEdge(1, 2, 10); + addEdge(2, 3, 10); + addEdge(0, 3, 40); + addEdge(3, 4, 2); + addEdge(4, 5, 3); + addEdge(5, 6, 3); + addEdge(4, 6, 8); + + display(); + vector visited (7, false); + // cout << haspath(0, 6, visited) << endl; + printallpaths(0, 6, visited, "", 0); +} \ No newline at end of file From c6e09a0cfa98eedd062096d7bee5539d1ca22fe3 Mon Sep 17 00:00:00 2001 From: Akhil Ratna Chettri <47321384+arctistic@users.noreply.github.com> Date: Wed, 2 Oct 2019 06:32:18 +0530 Subject: [PATCH 133/285] Longest continious subset that adds up to zero Given an array consisting of positive and negative integers, find the length of the longest continuous subset whose sum is zero. To be done in O(n) time complexity. The use of hash-maps helps bring down the complexity to O(n). Eg: Array size: 10 Array: 95 -97 -387 -435 -5 -70 897 127 23 284 Then the length longest continious subset/sequence which sums up to zero is 5 Since the longest continious subset which sums up to zero is -387 -435 -5 -70 897. This program makes use of hashmaps and the STL is unordered_map. --- .../longest-continious-subset-to-zero | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 data-structures/hashmaps/longest-continious-subset-to-zero diff --git a/data-structures/hashmaps/longest-continious-subset-to-zero b/data-structures/hashmaps/longest-continious-subset-to-zero new file mode 100644 index 00000000..e4c3eae9 --- /dev/null +++ b/data-structures/hashmaps/longest-continious-subset-to-zero @@ -0,0 +1,51 @@ +/* +Given an array consisting of positive and negative integers, find the length of the longest continuous subset whose sum is zero. +To be done in O(n) time complexity. + +Eg: Array size: 10 + Array: 95 -97 -387 -435 -5 -70 897 127 23 284 + Then the length longest continious subset/sequence which sums up to zero is 5 + Since the longest continious subset which sums up to zero is -387 -435 -5 -70 897. + +This program makes use of hashmaps and the STL is unordered_map. +*/ +#include +#include +using namespace std; + +int lengthOfLongestSubsetWithZeroSum(int* arr, int size){ + unordered_map mymap; + int sum = 0; + int maxLength = -1; + for(int i = 0; i < size; i++){ + sum += arr[i]; + int length = 0; + + if(sum == 0){ + length = i+1; + }else if(mymap.count(sum)){ + length = i - mymap[sum]; + + }else{ + mymap[sum] = i; + } + + if(length > maxLength){ + maxLength = length; + } + } + return maxLength; +} + +int main(){ + int size; + + cin >> size; + int* arr = new int[size]; + for(int i = 0; i < size; i++){ + cin >> arr[i]; + } + int ans = lengthOfLongestSubsetWithZeroSum(arr,size); + cout << ans << endl; + delete arr; +} From 70c0de13cde7cb193cdd5f128e9a3c2a970a75f5 Mon Sep 17 00:00:00 2001 From: Akhil Ratna Chettri <47321384+arctistic@users.noreply.github.com> Date: Wed, 2 Oct 2019 06:43:01 +0530 Subject: [PATCH 134/285] Finding k-th largest element in the array. Given an array A of random integers and an integer k, find and return the kth largest element in the array. This programs achieves the goal with a time complexity of O(nlogn). --- searches/k-th largest element in the array | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 searches/k-th largest element in the array diff --git a/searches/k-th largest element in the array b/searches/k-th largest element in the array new file mode 100644 index 00000000..954201d1 --- /dev/null +++ b/searches/k-th largest element in the array @@ -0,0 +1,32 @@ +/*Finding k-th largest element in the array with the lowest possible time complexity O(nlogn). + +#include +#include +#include +using namespace std; + +int kthLargest (vector arr, int n, int k){ + priority_queue, greater > pq; + for(int i = 0; i < k; i++){ + pq.push(arr[i]); + } + for(int i = k; i < n; i++){ + if(arr[i] > pq.top()){ + pq.pop(); + pq.push(arr[i]); + } + } + return pq.top(); +} + +int main(){ + int n, k, s; + vector arr; + cin>>n; + for(int i = 0; i < n; i++){ + cin>>s; + arr.push_back(s); + } + cin >> k; + cout << kthLargest(arr, n, k) << endl; +} From 91f2ac5ee16f5ce7298d8186bf5399fb0bfe8cf4 Mon Sep 17 00:00:00 2001 From: Akhil Ratna Chettri <47321384+arctistic@users.noreply.github.com> Date: Wed, 2 Oct 2019 06:59:37 +0530 Subject: [PATCH 135/285] Find the Unique Element Given an integer array of size 2N + 1. In this given array, N numbers are present twice and one number is present only once in the array. You need to find and return that number which is unique in the array. --- data-structures/Find the Unique Element | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 data-structures/Find the Unique Element diff --git a/data-structures/Find the Unique Element b/data-structures/Find the Unique Element new file mode 100644 index 00000000..ce2a7bd8 --- /dev/null +++ b/data-structures/Find the Unique Element @@ -0,0 +1,32 @@ +/* +Given an integer array of size 2N + 1. In this given array, +N numbers are present twice and one number is present only once in the array. +You need to find and return that number which is unique in the array. +*/ + +#include +#include +#include "solution.h" +using namespace std; + +int FindUnique(int arr[], int size){ + int xor1 = 0; + for(int i = 0; i < size; i++) + xor1 ^= arr[i]; + return xor1; +} + +int main() { + + int size; + + cin>>size; + int *input=new int[1+size]; + + for(int i=0;i>input[i]; + + cout< Date: Wed, 2 Oct 2019 22:11:35 +0530 Subject: [PATCH 136/285] Create Floyd_Warshall.cpp --- dynamic-programming/Floyd_Warshall.cpp | 112 +++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 dynamic-programming/Floyd_Warshall.cpp diff --git a/dynamic-programming/Floyd_Warshall.cpp b/dynamic-programming/Floyd_Warshall.cpp new file mode 100644 index 00000000..93ccff62 --- /dev/null +++ b/dynamic-programming/Floyd_Warshall.cpp @@ -0,0 +1,112 @@ +#include +#include +#include + +using namespace std; + +//Wrapper class for storing a graph +class Graph +{ +public: + int vertexNum; + int **edges; + + //Constructs a graph with V vertices and E edges + Graph(int V) + { + this->vertexNum = V; + this->edges = (int **)malloc(V * sizeof(int *)); + for (int i = 0; i < V; i++) + { + this->edges[i] = (int *)malloc(V * sizeof(int)); + for (int j = 0; j < V; j++) + this->edges[i][j] = INT_MAX; + this->edges[i][i] = 0; + } + } + + //Adds the given edge to the graph + void addEdge(int src, int dst, int weight) + { + this->edges[src][dst] = weight; + } +}; + +//Utility function to print distances +void print(int dist[], int V) +{ + cout << "\nThe Distance matrix for Floyd - Warshall" << endl; + for (int i = 0; i < V; i++) + { + for (int j = 0; j < V; j++) + { + + if (dist[i * V + j] != INT_MAX) + cout << dist[i * V + j] << "\t"; + else + cout << "INF" + << "\t"; + } + cout << endl; + } +} + +//The main function that finds the shortest path from a vertex +//to all other vertices using Floyd-Warshall Algorithm. +void FloydWarshall(Graph graph) +{ + int V = graph.vertexNum; + int dist[V][V]; + + //Initialise distance array + for (int i = 0; i < V; i++) + for (int j = 0; j < V; j++) + dist[i][j] = graph.edges[i][j]; + + //Calculate distances + for (int k = 0; k < V; k++) + //Choose an intermediate vertex + + for (int i = 0; i < V; i++) + //Choose a source vertex for given intermediate + + for (int j = 0; j < V; j++) + //Choose a destination vertex for above source vertex + + if (dist[i][k] != INT_MAX && dist[k][j] != INT_MAX && dist[i][k] + dist[k][j] < dist[i][j]) + //If the distance through intermediate vertex is less than direct edge then update value in distance array + dist[i][j] = dist[i][k] + dist[k][j]; + + //Convert 2d array to 1d array for print + int dist1d[V * V]; + for (int i = 0; i < V; i++) + for (int j = 0; j < V; j++) + dist1d[i * V + j] = dist[i][j]; + + print(dist1d, V); +} + +//Driver Function +int main() +{ + int V, E; + int src, dst, weight; + cout << "Enter number of vertices: "; + cin >> V; + cout << "Enter number of edges: "; + cin >> E; + Graph G(V); + for (int i = 0; i < E; i++) + { + cout << "\nEdge " << i + 1 << "\nEnter source: "; + cin >> src; + cout << "Enter destination: "; + cin >> dst; + cout << "Enter weight: "; + cin >> weight; + G.addEdge(src, dst, weight); + } + FloydWarshall(G); + + return 0; +} From 2c1a1751c99730f4508806186d64ae7336ae94b4 Mon Sep 17 00:00:00 2001 From: Milan Pokharna Date: Thu, 3 Oct 2019 16:43:07 +0530 Subject: [PATCH 137/285] Extra Long Factorial in minimum complexity --- math/ExtraLongFactorial.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 math/ExtraLongFactorial.txt diff --git a/math/ExtraLongFactorial.txt b/math/ExtraLongFactorial.txt new file mode 100644 index 00000000..ddcaec0f --- /dev/null +++ b/math/ExtraLongFactorial.txt @@ -0,0 +1,16 @@ +#!/bin/python3 + +import math +import os +import random +import re +import sys + +# Complete the extraLongFactorials function below. +def extraLongFactorials(n): + print(math.factorial(n)) + +if __name__ == '__main__': + n = int(input()) + + extraLongFactorials(n) From 2c1efe4f86a8284fb43294c5435dce7c656d6b02 Mon Sep 17 00:00:00 2001 From: ssquare55 Date: Fri, 4 Oct 2019 19:14:16 +0530 Subject: [PATCH 138/285] cyclic_sort --- sorting/cyclic_sort.cpp | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sorting/cyclic_sort.cpp diff --git a/sorting/cyclic_sort.cpp b/sorting/cyclic_sort.cpp new file mode 100644 index 00000000..210c44bf --- /dev/null +++ b/sorting/cyclic_sort.cpp @@ -0,0 +1,65 @@ +#include +#include +#include + +using namespace std; + +class cSort +{ +public: + void doIt( vector s ) + { + sq = s; display(); c_sort(); + cout << "writes: " << wr << endl; display(); + } +private: + void display() + { + copy( sq.begin(), sq.end(), ostream_iterator( std::cout, " " ) ); + cout << endl; + } + void c_sort() + { + wr = 0; + unsigned it, p, vlen = static_cast( sq.size() ); + for( unsigned c = 0; c < vlen - 1; c++ ) + { + it = sq[c]; + p = c; + for( unsigned d = c + 1; d < vlen; d++ ) + if( sq[d] < it ) p++; + + if( c == p ) continue; + + doSwap( p, it ); + + while( c != p ) + { + p = c; + for( unsigned e = c + 1; e < vlen; e++ ) + if( sq[e] < it ) p++; + + doSwap( p, it ); + } + } + } + void doSwap( unsigned& p, unsigned& it ) + { + while( sq[p] == it ) p++; + swap( it, sq[p] ); + wr++; + } + vector sq; + unsigned wr; +}; + +int main(int argc, char ** argv) +{ + srand( static_cast( time( NULL ) ) ); + vector s; + for( int x = 0; x < 20; x++ ) + s.push_back( rand() % 100 + 21 ); + + cSort c; c.doIt( s ); + return 0; +} From 38bb8e8b3bb3286002faa69c63969466d8c5fce7 Mon Sep 17 00:00:00 2001 From: Hemlatha Pandey Date: Mon, 7 Oct 2019 02:58:15 +0530 Subject: [PATCH 139/285] kruskals_017.cpp Kruskals By Hemlatha --- graphs/kruskals_017.cpp | 156 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 graphs/kruskals_017.cpp diff --git a/graphs/kruskals_017.cpp b/graphs/kruskals_017.cpp new file mode 100644 index 00000000..333b6f97 --- /dev/null +++ b/graphs/kruskals_017.cpp @@ -0,0 +1,156 @@ +#include +using namespace std; + +// Creating shortcut for an integer pair +typedef pair iPair; + +// Structure to represent a graph +struct Graph +{ + int V, E; + vector< pair > edges; + + // Constructor + Graph(int V, int E) + { + this->V = V; + this->E = E; + } + + // Utility function to add an edge + void addEdge(int u, int v, int w) + { + edges.push_back({w, {u, v}}); + } + + // Function to find MST using Kruskal's + // MST algorithm + int kruskalMST(); +}; + +// To represent Disjoint Sets +struct DisjointSets +{ + int *parent, *rnk; + int n; + + // Constructor. + DisjointSets(int n) + { + // Allocate memory + this->n = n; + parent = new int[n+1]; + rnk = new int[n+1]; + + // Initially, all vertices are in + // different sets and have rank 0. + for (int i = 0; i <= n; i++) + { + rnk[i] = 0; + + //every element is parent of itself + parent[i] = i; + } + } + + // Find the parent of a node 'u' + // Path Compression + int find(int u) + { + /* Make the parent of the nodes in the path + from u--> parent[u] point to parent[u] */ + if (u != parent[u]) + parent[u] = find(parent[u]); + return parent[u]; + } + + // Union by rank + void merge(int x, int y) + { + x = find(x), y = find(y); + + /* Make tree with smaller height + a subtree of the other tree */ + if (rnk[x] > rnk[y]) + parent[y] = x; + else // If rnk[x] <= rnk[y] + parent[x] = y; + + if (rnk[x] == rnk[y]) + rnk[y]++; + } +}; + + /* Functions returns weight of the MST*/ + +int Graph::kruskalMST() +{ + int mst_wt = 0; // Initialize result + + // Sort edges in increasing order on basis of cost + sort(edges.begin(), edges.end()); + + // Create disjoint sets + DisjointSets ds(V); + + // Iterate through all sorted edges + vector< pair >::iterator it; + for (it=edges.begin(); it!=edges.end(); it++) + { + int u = it->second.first; + int v = it->second.second; + + int set_u = ds.find(u); + int set_v = ds.find(v); + + // Check if the selected edge is creating + // a cycle or not (Cycle is created if u + // and v belong to same set) + if (set_u != set_v) + { + // Current edge will be in the MST + // so print it + cout << u << " - " << v << endl; + + // Update MST weight + mst_wt += it->first; + + // Merge two sets + ds.merge(set_u, set_v); + } + } + + return mst_wt; +} + +// Driver program to test above functions +int main() +{ + /* Let us create above shown weighted + and unidrected graph */ + int V = 9, E = 14; + Graph g(V, E); + + // making above shown graph + g.addEdge(0, 1, 4); + g.addEdge(0, 7, 8); + g.addEdge(1, 2, 8); + g.addEdge(1, 7, 11); + g.addEdge(2, 3, 7); + g.addEdge(2, 8, 2); + g.addEdge(2, 5, 4); + g.addEdge(3, 4, 9); + g.addEdge(3, 5, 14); + g.addEdge(4, 5, 10); + g.addEdge(5, 6, 2); + g.addEdge(6, 7, 1); + g.addEdge(6, 8, 6); + g.addEdge(7, 8, 7); + + cout << "Edges of MST are \n"; + int mst_wt = g.kruskalMST(); + + cout << "\nWeight of MST is " << mst_wt; + + return 0; +} From 38d10ec1f8ca8eafaade82bef0a44bae9166e809 Mon Sep 17 00:00:00 2001 From: Rituparno Biswas Date: Mon, 7 Oct 2019 08:58:01 +0530 Subject: [PATCH 140/285] added segment tree implementation --- data-structures/segment_tree/min_in_range.cpp | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 data-structures/segment_tree/min_in_range.cpp diff --git a/data-structures/segment_tree/min_in_range.cpp b/data-structures/segment_tree/min_in_range.cpp new file mode 100644 index 00000000..2a5fcb63 --- /dev/null +++ b/data-structures/segment_tree/min_in_range.cpp @@ -0,0 +1,98 @@ +// +// SEGMENT TREE : A Segment Tree is a data structure that allows +// answering range queries over an array effectively, +// while still being flexible enough to allow modifying the array. +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/data-scructures/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: RITUPARNO BISWAS +// Github: @roopbiswas +// + + +#include +using namespace std; + + +int st[400005],a[100005],y,l,r,x; + +void build(int in,int s,int e) +{ + if(s==e) + { + st[in]=a[s]; + return; + } + int m=(s+e)/2; + build(2*in,s,m); + build(2*in+1,m+1,e); + st[in]= min(st[2*in],st[2*in+1]); +} + +void update(int in,int s,int e) +{ + if(s==e) + { + st[in]=y; + return; + } + int m=(s+e)/2; + if(s<=x && x<=m) + update(2*in,s,m); + else + update(2*in+1,m+1,e); + st[in]=min(st[2*in],st[2*in+1]); +} + +int query(int in,int s,int e) +{ + if(r>n; + for(i=0;i>a[i]; + cin>>t; + char ch; + build(1,0,n-1); + while(t--) + { + cout<<"Enter choice : \nu : for update\nq : for query\n"; + cin>>ch; + + if(ch=='u') + { + cout<<"Enter values of index(1 based) and updated value\n"; + cin>>x>>y; + x--; + update(1,0,n-1); + } + else + { + cout<<"Enter values(1 based) of upper and lower index\n"; + cin>>l>>r; + l--; + r--; + cout<<"\nMINIMUM : "< Date: Mon, 7 Oct 2019 09:16:41 +0530 Subject: [PATCH 141/285] added sum in range using segment tree --- data-structures/segment_tree/a.out | Bin 0 -> 16048 bytes data-structures/segment_tree/sum_in_range.cpp | 98 ++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100755 data-structures/segment_tree/a.out create mode 100644 data-structures/segment_tree/sum_in_range.cpp diff --git a/data-structures/segment_tree/a.out b/data-structures/segment_tree/a.out new file mode 100755 index 0000000000000000000000000000000000000000..2aa14deb1ac3e2f932605d5d5e0d87464e458d92 GIT binary patch literal 16048 zcmeHOdvH`$n!lY8h!R4?D2ON*78O+5GJCA$Lx%Zsj>uplLdQ7=|R5rRcD87@f1djq! zlBKZjLn}z}!&M?Vjs_*HF=f36phtdQZcyg6^(wz&^)jUVXG--*;jVC~v!U*;aBy)r z6iN0j?rm&X+)(FEMBPh7xye4s-nXWM#6^2^Rgurt3L}2$g6CJo|K-QupLbi;o_99? z!_c~8th-A&C+yThXiUJ zX$tS+BD`syj+my+Qn-eGkg$S*JMN&iZ_o^5drvfCBrJd2G7QaV-LTpSnsIY`C}ElL z4Xam#qY-n1zcXw~USZCrb}OD}4YXSxPoUc$H>|inWC8Gc*8{8V^d~|A0~X_^zo&JB zv7yHBwl^5-+iQ{IrZw$WV)q4kOUL!|3vd!l(MGDc+TjWgo}QJ zP~a3jPxM2(;?i+hi=M=gRjNIr+S3J%d5H7)P#p?QqmgW8eaLSv*+cuo*ns~l}Ps@GjvQsm4&9{HpD#@Pk4ZKl)T+7yX0?OVJ#C`hQ zCd4S+O)8^jvIw_qqBJ$l=n0WtPiZRZ=&(rNPiZRR=rNIQp)?h3^oU5`O=&99=pm6_ zLTM_>Xun9`j&#={q($(2)|z^6n=kc&Z{X~?bsO3S%N~KOZ*bb@FyR}#_aWqzy>2pe zzL-9DrGOS8(cv2`n+NJ!cHWoz(7FLd{pIyYqNvlhX3uoFr_bFd>~B3zr5sDc2tm5d+(w(3kLsA8LS|K#q9Op`>R>HrX}z44cxmH z3NQ(ODtzgCcO#XVh9YNtxV>5SD&$<`PCq&J`Ei&;c}RTgXcr_XhE~&4dp=DiGpUZV zX>aBp@7ZK6sBg$OSiPV0Q0}K6Z`9J&C28-c1XnQJ3HzyP*XWawN_S+^-m|U~sn=io zc&_Wjd*@T$3y>eI00)sw>dn;8GihX+_Ffo_xxjJ_5BfmQrd|i>K$Lqi)hor#XJj6u9)p;$Azgqr&Gz1 zRL9A5*}ya8>B!!x=`u@1PwtuW3bp1ZJJV&IlKI$zblGOf+h41(4#CoD5t=(qDW<2I}7KSzpODti-=0`4vPI-4DR4vs?eeGHK>_AJ?d zOB(x*wErSGcvwPx%Km;~e>>aXM)u3LaI&4G2J2suCR@p*Mf%jJEO5~oed*Pips%(nP~c zRjEA}QpxiJdoH+=OTNA5d^U@bZxKrU($I1(;}Y3l_c$!W`M(B)K{QAyROk!;oy{JS zgTPNoO}6g~=#5*CkB!brt*I~D7SSkK z?tAU)(#%X4_3i)6(mn6<_}rHIsx9^9%G7U~v(=}41IJyyW&fW1nC8CCTbs8uZ*AVz zY#cu{mgDEg(QIT-%#O4sLH($}G3tsGpM;C%*eYB)t|nalxWqz+1sutO@)PKwmx_F7 z0;Nfl=6bS0Ya&|z&{~JqHK;fdyb&zJ^+0zt6fpI>^{bP(bw%TPG8V)_^y)`d^3kLj z?<0LFztbO1nh8DHrH3Lxvv;9Kr^R(}k?xNKm1y3%SKr$AC1Ed#@?m|o$ zyjr`uy<;`<7CyUfEWPJpZm(T1pJ38oiK_;7seL$*?iO52 zP_8osHdj_1C|NOWa>@JfNZNi3@bAF?D3AYv;OoGi#q}!cgX$@#?;R*D`GFA8bil*J zLLDule#d!0rgUyeE}yett-=V}3YwECS()QcLcK-7zs}BIC-b1PEdW0TzDfL+%Bt^{ zv{cS|qSRZd4^C>STzIg|S6OplvahmnV9M&srg&vzb7f6)<-(Rq9deLwsVo=IN*H#A zV251260X$1l^VEG16OL`N)248fh#p|r3S9l!2ib@;P2x69h|>=W2q~GlhQYM3Kf!Q zmMe!n}Y{Nr!wv!s|N-VIco2)&m_| z`P)C|f3wnOIlK;v@NRUbE=?tDHdt=>zqoztN3`W5`0x1%KHBu$?YRMOg5+j ztWxwrMY|N;sptVkpHkFe=CYH#-*VrI6?f|kJ35mQE2%Ga*Sc#KFIk!tNzb=DjqaMd zMH0RY%cc0x(a05Rlczl@-Ve9IVwcJ)C_gFJKlA0wa{V$NpPcKz`S=u#+ch6A*SJ6A z<2dEO4}gtPimw#hKW#AlpPGA4^YIEzFVH@v+BEG*LA)||{vzMbbd8_;e7s6)nr=sA zyc9dOe2&1*Eyd37c^)8aj8g5|+_?xFjB-`y#*cjbI-HBp?U0CZTZ)Ja``jDn z>jI+uD6GQeDo_tSz{x(3?<7m150|SzeGUOH!p}JHA1M5+1AklL8HMxk_n*LN zTzXI)QV`#CF$Ua>1r_1E4(0V49;1TeQVrx?m@i%^a9F6&IJR6Y*v8L04+uNs=Zj53 z{@QW#%MOL}x>k;2n)WSWXZ-wf7&x6znx)1)bQ=*CEBxX4x=2?)B3Ft}0k6V*RHaK? zFmZbh_zcv~_tir8BgOav6{{DRzg`md$L3$o_f_EY*{F@4QuY_Cg}wM55B@L7PRUG- z*I}&kk&x%q7~PBcY=$;|J&-LTe;)o*x%gZs?`_;5@G-j_+g1d>TjV=_owFPAtRrwCv&t5ty>G7GkdN`zP}cDrS?zApTZe&*R*G--q7y-2O9-)cs4pd!tWqY?dx1` z>;jMEs~!Gy!A=$Mg$fr&aHGu{!ky)sD(Zoy#%PVeE45+u+?k5i1f24ntkkfv81wJqn>w6DQPDx@!ahlW&hji#ZK%gfqSZm{BMfb z*8*`XVI{k|+yQOu{GVa<7y&u~n7{$IVAR+ij&}OPM$n4J6NW$8s|BJxv9M{GLHE*z zWptXbfRKShav{SXkNf)!Gh)U2w63_n$25Y;o}NCa*ir^0tvu00vIn3M_eZvy?m#Ri z&g`{$mc>G5z}yu|m_{HP!O6a4fDZAsTWy|Ne>fZs_~9Z9ZI@s}XnQ0Y$03#p&EZM z8k6c|9VZg&abnW!m0tQIR-&yw6u@3ASuMzJh(r^~&O}juBkYHIaOAM4#L_@C9LDBw zQ2|elcg5=F_CP!ovx*AUi$j}5*^OqeWnynRSX83cziUTPX5IF<87s=IHz#C!mKfAF zeUWHS$R93h#Z%kkw*uYVrk9k9L@lE;dTDzkXI`dUXLQ$PFAV(V=uchu+jAj-BJEIUO(;=g?6XiKx+yV$m6XOgi#Zy^>T1)a^&x z^KJZ*XX~BjMf2p2(vM|PhXUYV23(JrpT&WEhdSUt^8W=+L-n1>P&g>+(V)7ePCyM{ zbS4rUAODX8`n!R{l05GpNF+t`YH?Au;x7aa!HND+F=m9;NH8J)(BQD({A+#NRM*7xm_jN5ymEHoMhovO5SPoRX??St&I*jvV|wp#XfM$IOjBpt-T6?ZGlN zx5ED4MQDG=g^Sny{C%A%@9%IfBx?_Uf&^Z5a{Bxoo~dpZMx5Vg8TKGz*XQr`Oc$`A zqE7vlz;RSA%Ki_j2-Ag151&~?!0T6DSc4S3ny~(`iZJb01*W$^in2cM4?PGBpSW`R zP0B&0ysrfj5uEk64JhpyasIrYz*LuNx&J7#9Mc`((;gJ3dEbHQI;BtklMMT>U~M-d z>dj#( z#O(UI(r4PAlavwOreJ#5p?^f_Gi86-45yjW>1%ub{5^!}<6JOhfb(U0&pY(%)O$En zybk9DXZc@L`nmQ~`b~BnH%^>g2sbg9Gnum#rR^f^Qb3YH1nyR`US?#pHZh_8LSA>4zJn#6=cV)T#eJM*Mj> literal 0 HcmV?d00001 diff --git a/data-structures/segment_tree/sum_in_range.cpp b/data-structures/segment_tree/sum_in_range.cpp new file mode 100644 index 00000000..95b80225 --- /dev/null +++ b/data-structures/segment_tree/sum_in_range.cpp @@ -0,0 +1,98 @@ +// +// SEGMENT TREE : A Segment Tree is a data structure that allows +// answering range queries over an array effectively, +// while still being flexible enough to allow modifying the array. +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/data-scructures/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: RITUPARNO BISWAS +// Github: @roopbiswas +// + + +#include +using namespace std; + + +int st[400005],a[100005],y,l,r,x; + +void build(int in,int s,int e) +{ + if(s==e) + { + st[in]=a[s]; + return; + } + int m=(s+e)/2; + build(2*in,s,m); + build(2*in+1,m+1,e); + st[in]= st[2*in]+st[2*in+1]; +} + +void update(int in,int s,int e) +{ + if(s==e) + { + st[in]=y; + return; + } + int m=(s+e)/2; + if(s<=x && x<=m) + update(2*in,s,m); + else + update(2*in+1,m+1,e); + st[in]=st[2*in]+st[2*in+1]; +} + +int query(int in,int s,int e) +{ + if(r>n; + for(i=0;i>a[i]; + cin>>t; + char ch; + build(1,0,n-1); + while(t--) + { + cout<<"Enter choice : \nu : for update\nq : for query\n"; + cin>>ch; + + if(ch=='u') + { + cout<<"Enter values of index(1 based) and updated value\n"; + cin>>x>>y; + x--; + update(1,0,n-1); + } + else + { + cout<<"Enter values(1 based) of upper and lower index\n"; + cin>>l>>r; + l--; + r--; + cout<<"\nSUM : "< Date: Mon, 7 Oct 2019 20:01:30 +0530 Subject: [PATCH 142/285] To check palindrome. --- PALIN.CPP | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 PALIN.CPP diff --git a/PALIN.CPP b/PALIN.CPP new file mode 100644 index 00000000..7e4cc7d6 --- /dev/null +++ b/PALIN.CPP @@ -0,0 +1,25 @@ +#include +#include +int main() +{ +clrscr(); +char string[100],c; +cout<<"Enter the string:\n"; +cin.getline(string,100); +for(int len=0;string[len]!='\0';len++); +int i,j,flag=1; +for(i=0,j=len-1;i Date: Mon, 7 Oct 2019 22:57:18 +0800 Subject: [PATCH 143/285] add sudoku solver --- backtracking/sudoku_solver.cc | 107 ++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 backtracking/sudoku_solver.cc diff --git a/backtracking/sudoku_solver.cc b/backtracking/sudoku_solver.cc new file mode 100644 index 00000000..898d79b6 --- /dev/null +++ b/backtracking/sudoku_solver.cc @@ -0,0 +1,107 @@ +/* +https://leetcode.com/problems/sudoku-solver/ + +Sudoku Solver +============== + +Write a program to solve a Sudoku puzzle by filling the empty cells. + +Empty cells are indicated by the character '.'. + +You may assume that there will be only one unique solution. + +![before filled](http://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Sudoku-by-L2G-20050714.svg/250px-Sudoku-by-L2G-20050714.svg.png) +A sudoku puzzle... + +![after filled](http://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Sudoku-by-L2G-20050714_solution.svg/250px-Sudoku-by-L2G-20050714_solution.svg.png) +...and its solution numbers marked in red. +*/ +#include +#include +#include +#include +#include +#include +using namespace std; + +class Solution { + static const int kSize = 9; + bool rowUsed[kSize][kSize]; + bool colUsed[kSize][kSize]; + bool areaUsed[kSize][kSize]; + +public: + bool backtrack(vector >& board, int r, int c) { + if(r >= kSize) return true; // the last cell. + if(c >= kSize) return backtrack(board, r+1, 0); // row complete, move to next row. + if(isdigit(board[r][c])) return backtrack(board, r, c+1); // skip the given cell. + + // empty cell, try each value [0-9] to fill it. + for(int num = 1; num <= kSize; ++num) { + int area = (r/3) * 3 + (c/3); + if(rowUsed[r][num] || colUsed[num][c] || areaUsed[area][num]) { + continue; + } + + // emplace num as char. + board[r][c] = num + '0'; + rowUsed[r][num] = colUsed[num][c] = areaUsed[area][num] = true; + + // try next position... + if(backtrack(board, r, c+1)) return true; // stop searching when the first solution found. + + // can not continue to place, backtrack. + board[r][c] = '.'; + rowUsed[r][num] = colUsed[num][c] = areaUsed[area][num] = false; + } + return false; + } + + void solveSudoku(vector >& board) { + memset(rowUsed, false, sizeof(rowUsed)); + memset(colUsed, false, sizeof(colUsed)); + memset(areaUsed, false, sizeof(areaUsed)); + vector > result(board); + if (backtrack(result, 0, 0)) { // found solution + board = result; // copy back + } + } +}; + +template +void printMatrix(Matrix m) +{ + for(int i = 0; i < m.size(); i++) { + for(int j = 0; j < m[i].size(); j++) { + cout << m[i][j]; + } + cout << "\n"; + } + cout << endl; +} + +// get sudoku puzzle from sudokupuzzle.org: +// curl -s "http://sudokupuzzle.org/online2.php?nd=0&y=`date +%Y\&m=%m\&d=%d`" | grep tmda= | sed "s/.*tmda='//g" | cut -c -81 + +int main(int argc, char* argv[]) +{ + const int N = 9; + vector > board; + string puzzle = argc > 1 ? argv[1] : "000005001097004000005620008951060873804510209063700050149076080032041690780350402"; + + board.resize(N); + for (int i = 0; i < N; i++) { + board[i].resize(N); + for (int j = 0; j < N; j++) { + const char c = puzzle[i*N + j]; + board[i][j] = (c == '0' ? '.' : c); + } + } + printMatrix(board); + + Solution().solveSudoku(board); + printMatrix(board); + + return 0; +} + From 162ad9c23923d33d487927fa3b4c7f2bb783f1d7 Mon Sep 17 00:00:00 2001 From: Sankalp Godghate <30720192+sankalp24@users.noreply.github.com> Date: Wed, 9 Oct 2019 10:55:15 +0530 Subject: [PATCH 144/285] Create palindrome_check.cpp --- strings/palindrome_check.cpp | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 strings/palindrome_check.cpp diff --git a/strings/palindrome_check.cpp b/strings/palindrome_check.cpp new file mode 100644 index 00000000..42ed0418 --- /dev/null +++ b/strings/palindrome_check.cpp @@ -0,0 +1,40 @@ +// +// C/C++ program to check whether the given string is a palindrome +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/strings +// https://github.com/allalgorithms/cpp +// +// Contributed by: Sankalp Godghate +// Github: @sankalp24 +// +#include +using namespace std; +// A function to check if a string str is palindrome +void isPalindrome(string str) +{ + // Start from leftmost and rightmost corners of str + int l = 0; + int h = str.size() - 1; + + // Keep comparing characters while they are same + while (h > l) + { + if (str[l++] != str[h--]) + { + cout<>str; + isPalindrome(str); + return 0; +} From 2b27e1909a1658fe35d63ef886961d23b3b26e1a Mon Sep 17 00:00:00 2001 From: ishaan112233 Date: Wed, 9 Oct 2019 16:15:12 +0530 Subject: [PATCH 145/285] added --- dynamic-programming/binomial_dp.cpp | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 dynamic-programming/binomial_dp.cpp diff --git a/dynamic-programming/binomial_dp.cpp b/dynamic-programming/binomial_dp.cpp new file mode 100644 index 00000000..e2792652 --- /dev/null +++ b/dynamic-programming/binomial_dp.cpp @@ -0,0 +1,32 @@ +#include +using namespace std; +int comb(int n, int k){ + int dp[n+1][k+1]; + for(int i=0;i<=n;i++){ + for(int j=0;j<=min(i,k);j++){ + if(j==0 || j==i){ + dp[i][j] = 1; + } + else{ + dp[i][j] = dp[i-1][j]+dp[i][j-1]; + } + } + } + return dp[n][k]; +} + +//Space Optimized Solution +int comb(int n, int k){ + int dp[k+1]; + dp[0]=1; + for(int i=1;i<=n;i++){ + for(int j=min(i,k);j>0;j--){ + dp[j] = dp[j]+dp[j-1]; + } + } + return dp[k]; +} +int main(){ + int n=4,k=2; + cout< Date: Thu, 10 Oct 2019 15:41:21 +0530 Subject: [PATCH 146/285] dp_problem --- .../longest_increasing_subsequence.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dynamic-programming/longest_increasing_subsequence.cpp diff --git a/dynamic-programming/longest_increasing_subsequence.cpp b/dynamic-programming/longest_increasing_subsequence.cpp new file mode 100644 index 00000000..55073440 --- /dev/null +++ b/dynamic-programming/longest_increasing_subsequence.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; +int longestIncreasingSubsequence(int A[],int size){ + int dp[size]; + for(int i=0;i Date: Thu, 10 Oct 2019 18:11:24 +0530 Subject: [PATCH 147/285] Adding a program that calulate value of sine series upto n terms in CPP language --- dynamic-programming/Sine_Series.CPP | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dynamic-programming/Sine_Series.CPP diff --git a/dynamic-programming/Sine_Series.CPP b/dynamic-programming/Sine_Series.CPP new file mode 100644 index 00000000..0123af85 --- /dev/null +++ b/dynamic-programming/Sine_Series.CPP @@ -0,0 +1,29 @@ +#include //to add input and output stream +#include //to add console based functions + +void main() +{ + int i,j,n,fact,sign=-1; + float x, p,sum=0; + cout<<"\nEnter the value of x : "; + cin>>x; //values of sine series + cout<<"\nEnter the value of n : "; + cin>>n; //number of terms required in sine series + + for(i=1;i<=n;i+=2) + { + p=1; + fact=1; + for(j=1;j<=i;j++) + { + p=p*x; + fact=fact*j; + } + sign=-1*sign; + sum+=sign*p/fact; + } + cout<<"\nsin "< Date: Fri, 11 Oct 2019 00:38:06 +0530 Subject: [PATCH 148/285] Added algorithm to find articulation points in a graph --- graphs/find_articulation_points.cpp | 69 +++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 graphs/find_articulation_points.cpp diff --git a/graphs/find_articulation_points.cpp b/graphs/find_articulation_points.cpp new file mode 100755 index 00000000..cf6d772b --- /dev/null +++ b/graphs/find_articulation_points.cpp @@ -0,0 +1,69 @@ +//this code can be used to find Articulation points in a Graph +#include +using namespace std; + +int timee;// a variable to keep track of the time at which a particular vertex is encounterd + +vector graph[100];//adjacency list for the graph (100 is the max number of vertices.. you can change as per your needs) +bool visited[100] , AP[100]; +//visited - bool array used in DFS to know whether the node is visited or not +//AP - bool array to tell whether ith vertex is a AP or NOT + +int disc[100] , low[100] , parent[100]; +//disc - discovery time of a vertex +//low - exit time of a source +//parent - array to tell the parent of ith vertex + +//finding all APs +void printAP2(int source){ + visited[source] = true; + disc[source] = timee++; + low[source] = disc[source]; + int child = 0; + for(auto i : graph[source]){ + if(!visited[i]){ + child++; + parent[i] = source; + printAP2(i); + low[source] = min(low[i] , low[source]); + + if(parent[source] == source){ + if(child > 1) AP[source] = true; + } + else{ + if(low[i] >= disc[source]) AP[source] = true; // IMP + } + } + else if(i != parent[source]) low[source] = min(low[i] , low[source]); + } +} + +//find and print all APs +void printAP(int n , int source){ + for(int i = 0 ; i < n ; i++) low[i] = INT_MAX; + parent[source] = source; //initializing source os source vertex to itself + printAP2(source); + for(int i = 0 ; i < n ; i++){ + if(!visited[i]){ + parent[i] = i; + printAP2(i); + } + } + for(int i = 0 ; i < n ; i++){ + if(AP[i]) cout << i << " "; + } + cout << endl; +} + +int main(){ + //n - no. of vertices , e - no. of edges + int n , e , u , v; + cin >> n >> e; + //inputting e edges + for(int i = 0 ; i < e ; i++){ + cin >> u >> v; + graph[u].push_back(v); + graph[v].push_back(u); + } + printAP(n , 0); +} From 5bddafd3d21672d42a29877c391181328ff5eab8 Mon Sep 17 00:00:00 2001 From: makjn10 Date: Fri, 11 Oct 2019 00:44:42 +0530 Subject: [PATCH 149/285] Added KOSARAJU algorithm to find strongly connected components in a graph --- graphs/Kosaraju.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 graphs/Kosaraju.cpp diff --git a/graphs/Kosaraju.cpp b/graphs/Kosaraju.cpp new file mode 100644 index 00000000..288bdbdf --- /dev/null +++ b/graphs/Kosaraju.cpp @@ -0,0 +1,69 @@ +//this code if for kosaraju algorithm +//the algorithm is used to find strongly connected components in a graph +#include +using namespace std; + +vector g[100000]; //adjacency list for the graph +vector grev[100000]; //adjacency list for the reversed graph + +//printing a vector +void print(vector cc){ + int size = cc.size(); + for(int i = 0 ; i < size ; i++){ + cout << cc[i] << " "; + } + cout << endl; +} + +//DFS CALLS +void dfs1(int source , stack &order , bool * visited){ + visited[source] = true; + for(auto i : g[source]){ + if(!visited[i]) dfs1(i , order , visited); + } + order.push(source); +} +void dfs2(int source , bool * visited , vector &cc){ + visited[source] = true; + cc.push_back(source); + for(auto i : grev[source]){ + if(!visited[i]) dfs2(i , visited , cc); + } +} + +//code for finding and printing SCC(Stongly Connected Components) +void SCC(int n){ + bool * visited = new bool[n]{false}; + stack order; + for(int i = 0 ; i < n ; i++){ + if(!visited[i]){ + dfs1(i , order , visited); + } + } + delete []visited; + bool * visited2 = new bool[n]{false}; + while(!order.empty()){ + int source = order.top(); + order.pop(); + vector cc; + dfs2(source , visited2 , cc); + print(cc); + } + delete []visited2; +} + + +int main(){ + //n is number of vertices + //m is number of edges + int n , m , a , b; + cin >> n >> m; //inputting number of vertices and edges + //inputting m edges + for(int i = 0 ; i < m ; i++){ + //a directed edge from a to b + cin >> a >> b; + g[a].push_back(b); + grev[b].push_back(a); + } + SCC(n);//call function to find and print SCC +} From c11d8a9ed94232526f62c07673371b826e0bb5be Mon Sep 17 00:00:00 2001 From: Ankit Date: Fri, 11 Oct 2019 09:40:12 +0530 Subject: [PATCH 150/285] naive_dsu --- dsu/naive_dsu.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 dsu/naive_dsu.cpp diff --git a/dsu/naive_dsu.cpp b/dsu/naive_dsu.cpp new file mode 100644 index 00000000..84ea37a9 --- /dev/null +++ b/dsu/naive_dsu.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +const int MAX_SIZE = 1e5+7; //It can be increased to maximum global size available +int parent[MAX_SIZE]; + +void make_set(int val) +{ + parent[val] = val; +} + +int find_parent(int val) +{ + if(val == parent[val]) + { + return val; + } + return find_parent(parent[val]); +} + +void union_set(int x, int y) +{ + x = find_parent(x); + y = find_parent(y); + if(x != y) + { + parent[y] = x; + } +} + +int main() +{ + int n = 5; + int elements[n]; + for(int i=0;i Date: Fri, 11 Oct 2019 01:23:35 -0300 Subject: [PATCH 151/285] Create kruskal.cpp Minimum spanning tree (MST) with Kruskal --- graphs/kruskal.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 graphs/kruskal.cpp diff --git a/graphs/kruskal.cpp b/graphs/kruskal.cpp new file mode 100644 index 00000000..f57dd6e2 --- /dev/null +++ b/graphs/kruskal.cpp @@ -0,0 +1,81 @@ +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Leonardo Su +// Github: @Leonardosu + +#include +#define f first +#define s second +#define mp make_pair +#define pb push_back + +using namespace std; + +const int N = 100010; +typedef pair ii; +typedef pair iii; +vector edges; + +int p[N],lv[N]; +int total_cost = 0,n,m; + +//Union-Find +//------- +int find(int x) +{ + if(p[x] == x) return x; + return p[x] = find(p[x]); +} + +void join(int x,int y) +{ + x = find(x); + y = find(y); + + if(x == y) return; + if(lv[x] < lv[y]) p[x] = y; + else if(lv[x] > lv[y]) p[y] = x; + else + { + p[x] = y; + lv[y]++; + } +} +//------- + + +int main() +{ + + cin>>n>>m; // "n" is the number of vertex and "m" = number of edges + + for(int i=1;i<=n;++i) + p[i] = i,lv[i] = 0; + + int a,b,c; + for(int i=1;i<=m;++i) // Read the input, there is an edge between "a" and "b" with cost c + { + cin>>a>>b>>c; + edges.pb(mp(c,mp(a,b) )); + } + + // Kruskal + // -------- + sort(edges.begin(),edges.end()); + + for(int i=0;i Date: Sat, 12 Oct 2019 14:51:19 +0530 Subject: [PATCH 152/285] dynamicstack --- dynamic.cpp | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dynamic.cpp diff --git a/dynamic.cpp b/dynamic.cpp new file mode 100644 index 00000000..15563d86 --- /dev/null +++ b/dynamic.cpp @@ -0,0 +1,79 @@ +//Stack is a data structure based on a last in first out (LIFO) method +//This code defines and implements stack's functions using linked list + + +#include +#include +void pop(); +void push(); +void display(); +struct node{ + int value; + struct node *link; + }*top=NULL; + +void main(){ + int choice; + do{ + printf("*****Menu*****"); + printf("\n1.Push\n2.Pop\n3.Display\n4.Exit"); + printf("\nEnter you choice number::\t"); + scanf("%d",&choice"); + switch(choice){ + case 1: push(); + break; + case 2: pop(); + break; + case 3: display(); + break; + case 4: exit(0); + default:printf("\nWrong choice, Try entering again"); + } + }while(1); + getch(); + } + + void push(){ + int n; + ptr=(struct node *)malloc(sizeof(struct node)); + if (!ptr) + { + printf("\nMemory Overflow"); + return; + } + + printf("\nEnter the number to be pushed"); + scanf("%d",n); + ptr->value=n; + top->link=ptr; + top=ptr; + printf("\nElement pushed Successfully"); + } +void pop(){ + struct node *ptr=top; + if(!top) + { + printf("\nMemory Underflow"); + return; + } + top=top->link; + free(ptr); + printf("\nElement popped succefully"); + } + void display(){ + struct node *ptr=top; + printf("\n"); + if(!top) + { + printf("The stack is Empty"); + return; + } + while(!ptr) + { + printf("\t%d",ptr->value"); + ptr=ptr->link; + } + } + + + From 75d63451148f629b3d21f69fb172c20067125062 Mon Sep 17 00:00:00 2001 From: Aaryan Tyagi <42247648+aaryantyagi182@users.noreply.github.com> Date: Sat, 12 Oct 2019 16:18:14 +0530 Subject: [PATCH 153/285] Create interpolationSEARCH.cpp One more search technique --- searches/interpolationSEARCH.cpp | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 searches/interpolationSEARCH.cpp diff --git a/searches/interpolationSEARCH.cpp b/searches/interpolationSEARCH.cpp new file mode 100644 index 00000000..6a8699b5 --- /dev/null +++ b/searches/interpolationSEARCH.cpp @@ -0,0 +1,55 @@ +#include +using namespace std; +int interpolationSearch(int arr[], int n, int x) +{ + // Find indexes of two corners + int lo = 0, hi = (n - 1); + + // Since array is sorted, an element present + // in array must be in range defined by corner + while (lo <= hi && x >= arr[lo] && x <= arr[hi]) + { + if (lo == hi) + { + if (arr[lo] == x) return lo; + return -1; + } + // Probing the position with keeping + // uniform distribution in mind. + int pos = lo + (((double)(hi - lo) / + (arr[hi] - arr[lo])) * (x - arr[lo])); + + // Condition of target found + if (arr[pos] == x) + return pos; + + // If x is larger, x is in upper part + if (arr[pos] < x) + lo = pos + 1; + + // If x is smaller, x is in the lower part + else + hi = pos - 1; + } + return -1; +} + +// Driver Code +int main() +{ + // Array of items on which search will + // be conducted. + int arr[] = {10, 12, 13, 16, 18, 19, 20, 21, + 22, 23, 24, 33, 35, 42, 47}; + int n = sizeof(arr)/sizeof(arr[0]); + + int x = 18; // Element to be searched + int index = interpolationSearch(arr, n, x); + + // If element was found + if (index != -1) + cout << "Element found at index " << index; + else + cout << "Element not found."; + return 0; +} From aa75a1d4b212c0fa69e02cb287fa4c6c868c1b5c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Oct 2019 17:32:50 +0530 Subject: [PATCH 154/285] Added basic image processing code --- image-processing/RGBtoGrey.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 image-processing/RGBtoGrey.cpp diff --git a/image-processing/RGBtoGrey.cpp b/image-processing/RGBtoGrey.cpp new file mode 100644 index 00000000..d99b2b86 --- /dev/null +++ b/image-processing/RGBtoGrey.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; +using namespace cv; + +int main() +{ + Mat RGBimage=("cat.jpg"); + Mat Greyimage(RGBimage.rows,RGBimage.cols,CV_8UC1); + for(int i=0;i(i,j)=(RGBimage.at(i,j)[0]+RGBimage.at(i,j)[1]+RGBimage.at(i,j)[2])/3; + } + } + imshow("RGBimage",RGBimage); + imshow("Greyimage",Greyimage); + waitKey(0); + return 0; +} From b0fc6e7d6a37a0e9cee8c27b49daafd6fb11a695 Mon Sep 17 00:00:00 2001 From: Mohammad Rahim Khan Date: Sun, 13 Oct 2019 02:03:49 +0530 Subject: [PATCH 155/285] Added the promlem to print the lexicographically kth smallest suffix of the string S --- ...lexicographically_kth_ smallest_suffix.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 strings/lexicographically_kth_ smallest_suffix.cpp diff --git a/strings/lexicographically_kth_ smallest_suffix.cpp b/strings/lexicographically_kth_ smallest_suffix.cpp new file mode 100644 index 00000000..867cb24c --- /dev/null +++ b/strings/lexicographically_kth_ smallest_suffix.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; +#define ll long long + +//Print the lexicographically kth smallest suffix of the string S. + +int main() +{ + ll int i,j,k; + string s; + cin>>s>>k; + string s1[s.size()]; + for(i=0;i Date: Sun, 13 Oct 2019 09:51:20 +0530 Subject: [PATCH 156/285] path compression in dsu --- dsu/path_compression_in_dsu.cpp | 75 +++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 dsu/path_compression_in_dsu.cpp diff --git a/dsu/path_compression_in_dsu.cpp b/dsu/path_compression_in_dsu.cpp new file mode 100644 index 00000000..668981bf --- /dev/null +++ b/dsu/path_compression_in_dsu.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +const int MAX_SIZE = 1e5+7; //It can be increased to maximum global size available +int parent[MAX_SIZE]; + +void make_set(int val) +{ + parent[val] = val; +} + +int find_parent_path_compression(int val) +{ + if(val == parent[val]) + { + return val; + } + return parent[val] = find_parent_path_compression(parent[val]); +} + +void union_set(int x, int y) +{ + x = find_parent(x); + y = find_parent(y); + if(x != y) + { + parent[y] = x; + } +} + +int main() +{ + int n = 5; + int elements[n]; + for(int i=0;i Date: Sun, 13 Oct 2019 09:58:58 +0530 Subject: [PATCH 157/285] fix function name --- dsu/path_compression_in_dsu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsu/path_compression_in_dsu.cpp b/dsu/path_compression_in_dsu.cpp index 668981bf..0decf027 100644 --- a/dsu/path_compression_in_dsu.cpp +++ b/dsu/path_compression_in_dsu.cpp @@ -42,8 +42,8 @@ int find_parent_path_compression(int val) void union_set(int x, int y) { - x = find_parent(x); - y = find_parent(y); + x = find_parent_path_compression(x); + y = find_parent_path_compression(y); if(x != y) { parent[y] = x; @@ -61,7 +61,7 @@ int main() } union_set(elements[2], elements[4]); union_set(elements[1], elements[4]); - if (find_parent(elements[2]) != find_parent(elements[1])) + if (find_parent_path_compression(elements[2]) != find_parent_path_compression(elements[1])) { cout<<"The union set method failed!! \n"; } From 84b43262970073e299af568b9e1a5db4c1dcbb04 Mon Sep 17 00:00:00 2001 From: Ankit Date: Sun, 13 Oct 2019 10:07:30 +0530 Subject: [PATCH 158/285] union by rank in dsu --- dsu/union_by_rank_in_dsu.cpp | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 dsu/union_by_rank_in_dsu.cpp diff --git a/dsu/union_by_rank_in_dsu.cpp b/dsu/union_by_rank_in_dsu.cpp new file mode 100644 index 00000000..46e79571 --- /dev/null +++ b/dsu/union_by_rank_in_dsu.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +const int MAX_SIZE = 1e5+7; //It can be increased to maximum global size available +int parent[MAX_SIZE]; +int rank_v[MAX_SIZE]; + +void make_set(int val) +{ + parent[val] = val; + rank_v[val] = 0; +} +int find_parent_path_compression(int val) +{ + if(val == parent[val]) + { + return val; + } + return parent[val] = find_parent_path_compression(parent[val]); +} + +void union_set(int x, int y) +{ + x = find_parent_path_compression(x); + y = find_parent_path_compression(y); + if(x != y) + { + if(rank_v[x] Date: Sun, 13 Oct 2019 10:12:21 +0530 Subject: [PATCH 159/285] union by size in dsu --- dsu/union_by_size_in_dsu.cpp | 81 ++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 dsu/union_by_size_in_dsu.cpp diff --git a/dsu/union_by_size_in_dsu.cpp b/dsu/union_by_size_in_dsu.cpp new file mode 100644 index 00000000..02aa2844 --- /dev/null +++ b/dsu/union_by_size_in_dsu.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +const int MAX_SIZE = 1e5+7; //It can be increased to maximum global size available +int parent[MAX_SIZE]; +int size_v[MAX_SIZE]; + +void make_set(int val) +{ + parent[val] = val; + size_v[val] = 1; +} +int find_parent_path_compression(int val) +{ + if(val == parent[val]) + { + return val; + } + return parent[val] = find_parent_path_compression(parent[val]); +} + +void union_set(int x, int y) +{ + x = find_parent_path_compression(x); + y = find_parent_path_compression(y); + if(x != y) + { + if(size_v[x] Date: Wed, 16 Oct 2019 00:05:46 +0530 Subject: [PATCH 160/285] Create kmp_pattern_matching.cpp added kmp pattern searching algorithm --- strings/kmp_pattern_matching.cpp | 88 ++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 strings/kmp_pattern_matching.cpp diff --git a/strings/kmp_pattern_matching.cpp b/strings/kmp_pattern_matching.cpp new file mode 100644 index 00000000..d9082506 --- /dev/null +++ b/strings/kmp_pattern_matching.cpp @@ -0,0 +1,88 @@ +// C++ program for implementation of KMP pattern searching +// algorithm +#include + +void computeLPSArray(char* pat, int M, int* lps); + +// Prints occurrences of txt[] in pat[] +void KMPSearch(char* pat, char* txt) +{ + int M = strlen(pat); + int N = strlen(txt); + + // create lps[] that will hold the longest prefix suffix + // values for pattern + int lps[M]; + + // Preprocess the pattern (calculate lps[] array) + computeLPSArray(pat, M, lps); + + int i = 0; // index for txt[] + int j = 0; // index for pat[] + while (i < N) { + if (pat[j] == txt[i]) { + j++; + i++; + } + + if (j == M) { + printf("Found pattern at index %d ", i - j); + j = lps[j - 1]; + } + + // mismatch after j matches + else if (i < N && pat[j] != txt[i]) { + // Do not match lps[0..lps[j-1]] characters, + // they will match anyway + if (j != 0) + j = lps[j - 1]; + else + i = i + 1; + } + } +} + +// Fills lps[] for given patttern pat[0..M-1] +void computeLPSArray(char* pat, int M, int* lps) +{ + // length of the previous longest prefix suffix + int len = 0; + + lps[0] = 0; // lps[0] is always 0 + + // the loop calculates lps[i] for i = 1 to M-1 + int i = 1; + while (i < M) { + if (pat[i] == pat[len]) { + len++; + lps[i] = len; + i++; + } + else // (pat[i] != pat[len]) + { + // This is tricky. Consider the example. + // AAACAAAA and i = 7. The idea is similar + // to search step. + if (len != 0) { + len = lps[len - 1]; + + // Also, note that we do not increment + // i here + } + else // if (len == 0) + { + lps[i] = 0; + i++; + } + } + } +} + +// Driver program to test above function +int main() +{ + char txt[] = "ABABDABACDABABCABAB"; + char pat[] = "ABABCABAB"; + KMPSearch(pat, txt); + return 0; +} From 654e000d1ffab6ee789405f91abfeb202d6380b0 Mon Sep 17 00:00:00 2001 From: karki53 <42163189+karki53@users.noreply.github.com> Date: Wed, 16 Oct 2019 15:34:58 +0530 Subject: [PATCH 161/285] Create trie_data_structure_String_search This is trie tree data structure implementation in c++. We want to search a string an array of string if string is present or not with trie data structure .Trie data structure has less time complexity as compared to linear search for large value of n. --- searches/trie_data_structure_String_search | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 searches/trie_data_structure_String_search diff --git a/searches/trie_data_structure_String_search b/searches/trie_data_structure_String_search new file mode 100644 index 00000000..89621319 --- /dev/null +++ b/searches/trie_data_structure_String_search @@ -0,0 +1,90 @@ +/* + +Author-Krishan singh karki +Algorithm name-trie tree for seaching a string in n number of string +this is trie tree data structure implementation in c++. We want to search +a string an array of string if string is present or not with trie data structure +.Trie data structure has less time complexity as compared to linear search for large +value of n. +*/ + +/* +HACKTOBERFEST +*/ + +#include +using namespace std; + +struct trie//creating structure name trie +{ + struct trie* m[26];//creating mapping for the 26 small latters alphabet + int end=0;//0 means not a leaf node and 1 means it is a leaf node + +}; +struct trie * BuildtrieTree(struct trie * root,string s, int start, int size){ + if(start==size&&root==NULL){//cheking if this is last char of string and that node does not exist already + struct trie *temp; + temp=(struct trie*)malloc(sizeof(struct trie));//dynamically allocating memory + temp->end=1; + root=temp; + } + else if(start==size){//cheking if this is last char of string but node exist already + + } + else if(root!=NULL){//cheking for this is not last char in string and node for that char does not exist + //cout<end=0; + root->m[s[start]-'a']=BuildtrieTree( root->m[s[start]-'a'], s, start+1, size );//recursivly calling child node + + } + else {// finally cheking for this is not last char but that char node exist already + struct trie *temp; + temp=(struct trie*)malloc(sizeof(struct trie)); + temp->end=0; + root=temp; + root->m[s[start]-'a']=BuildtrieTree( root->m[s[start]-'a'], s, start+1, size ); + + } + + return root; +} +void checkString(struct trie *root, string s, int start ,int size){ + if(start==size&&root->end==1){// if the start pointer has reached to the end and this is a leaf node + + cout<<"YES this string exist in the array of string "; + } + else if(root->m[s[start]-'a']!=NULL){//start pointer has not reached to the end and there are more + //char left in string to be searched + checkString(root->m[s[start]-'a'],s,start+1,size);//recursivly calling there child node + } + else{//start pointer has not reached to the end and no strings from all the string has meached to this string + cout<<"SORRY, this string does not exist in the array of string"; + } + +} +int main(){ + struct trie *root = NULL; + + //dynamcally alocating the first root node + root=(struct trie*)malloc(sizeof(struct trie)); + root->end=1; + + int num; + cout<<"Enter the number of strings you want to insert : "; + cin>>num; + + string s[num]; + cout<>s[i]; + + for(int i=0;i>s2; + + + checkString( root, s2, 0, s2.length()); + +} From 99e28b26943b2226e7b104d3314c66cc2bd8f84d Mon Sep 17 00:00:00 2001 From: pratik-kumar-k Date: Wed, 16 Oct 2019 20:02:53 +0530 Subject: [PATCH 162/285] added tree --- .../inorder_traversal_without_recurrsion.cpp | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 data-structures/tree/inorder_traversal_without_recurrsion.cpp diff --git a/data-structures/tree/inorder_traversal_without_recurrsion.cpp b/data-structures/tree/inorder_traversal_without_recurrsion.cpp new file mode 100644 index 00000000..68ed0d31 --- /dev/null +++ b/data-structures/tree/inorder_traversal_without_recurrsion.cpp @@ -0,0 +1,167 @@ +#include +#include +struct tree //declaring a structure tree +{ + int data; + struct tree* left; + struct tree* right; +}*root=NULL; //creates a root pointer + +struct node //declaring a sructure node +{ + struct tree* link; //node refering to structure tree + struct node* next; +}*top=NULL; //creates a top pointer + + +void insert_bt(int d) //Insertion in Binary tree +{ + struct tree* temp; + temp=(struct tree*)malloc(sizeof(struct tree)); + temp->left=NULL; + temp->right=NULL; + temp->data=d; + if( root == NULL) + root = temp; + else + { + struct tree* parent,*curr; + curr=root; + while(curr) + { + parent=curr; + if(d < curr->data) + { + curr=curr->left; + } + else + { + curr=curr->right; + } + + } + if(d < parent->data) + { + parent->left=temp; + } + else + { + parent->right=temp; + } + + } + +} +//********************************************************* +void inorder(struct tree*t) // Inorder traversal using recurrsion +{ + if(t!=NULL) + { + inorder(t->left); + printf(" %d",t->data); + inorder(t->right); + } +} +//********************************************************* + + +void push(struct tree* c) //Pushing into the stack +{ + struct node* temp; + temp=(struct node*)malloc(sizeof(struct node)); + temp->link=c; + + temp->next=top; + top=temp; +} +//******************************************************** + +int pop() //poping out +{ + if(top == NULL) + return 0; + else + { + struct node* temp; + temp=top; + printf(" %d",temp->link->data); + top=top->next; + + temp->link=NULL; + temp->next=NULL; + free(temp); + temp=NULL; //assinging the top to the root + + + } +} +//********************************************************* +void display() //display function +{ + struct node* t; + t=top; + printf("\n"); + while(t!=NULL) + { + printf(" %d",t->link->data); + t=t->next; + } +} +//*************************************************** +int isempty() //function to check wheather the function is empty or not +{ + if( top == NULL) + return 1; + else return 0; +} +//****************************************************** + +void iterative(struct tree* t) // iterative method +{ + while(1) + { + if(t!=NULL) + { + push(t); + t=t->left; + } + else + { + if(isempty()) + break; + else + { + t=top->link; // before poping we need to initialize the root to + // to the top of the stack + pop(); + + t=t->right; + } + + } + + } +} + +//*******************************MAIN FUNCTION************************************** +int main() +{ + int n; + printf("\n Enter how many element you want to enter: "); + scanf("%d",&n); + int i,m; + printf("\n Enter the elements: "); + for( int i=0; i Date: Wed, 16 Oct 2019 21:10:47 +0530 Subject: [PATCH 163/285] Add files via upload This is a stack using array in cpp --- data-structures/stack/stacks_using_array.cpp | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 data-structures/stack/stacks_using_array.cpp diff --git a/data-structures/stack/stacks_using_array.cpp b/data-structures/stack/stacks_using_array.cpp new file mode 100644 index 00000000..02d4db84 --- /dev/null +++ b/data-structures/stack/stacks_using_array.cpp @@ -0,0 +1,66 @@ +#include +using namespace std; +int stack[100], n=100, top=-1; +void push(int val) //Used for pushing in to the stack +{ + if(top>=n-1) + cout<<"Stack Overflow"<=0) { + cout<<"Stack elements are:"; + for(int i=top; i>=0; i--) + cout<>ch; + switch(ch) { + case 1: { + cout<<"Enter value to be pushed:"<>val; + push(val); + break; + } + case 2: { + pop(); + break; + } + case 3: { + display(); + break; + } + case 4: { + cout<<"Exit"< Date: Wed, 16 Oct 2019 21:21:09 +0530 Subject: [PATCH 164/285] Add files via upload Program to implement vector --- data-structures/vector.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 data-structures/vector.cpp diff --git a/data-structures/vector.cpp b/data-structures/vector.cpp new file mode 100644 index 00000000..6f96952e --- /dev/null +++ b/data-structures/vector.cpp @@ -0,0 +1,20 @@ +#include +#include +using namespace std; +int main() +{ + vector v; + int n; + cin>>n; //to enter the element + for(int i=0; i>m; + v.push_back(m); + } + for(int i: v) + { + cout<<" "< Date: Thu, 17 Oct 2019 11:05:28 +0530 Subject: [PATCH 165/285] Create suffix tree ukkonen algorithm I tried to make the code as simple and clear as possible :) I do not know if I managed to do so and hope for your feedback and questions. --- graphs/suffix tree ukkonen algorithm | 82 ++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 graphs/suffix tree ukkonen algorithm diff --git a/graphs/suffix tree ukkonen algorithm b/graphs/suffix tree ukkonen algorithm new file mode 100644 index 00000000..d53679f3 --- /dev/null +++ b/graphs/suffix tree ukkonen algorithm @@ -0,0 +1,82 @@ +#include + +using namespace std; + +#define fpos adla +const int inf = 1e9; +const int maxn = 1e4; +char s[maxn]; +map to[maxn]; +int len[maxn], fpos[maxn], link[maxn]; +int node, pos; +int sz = 1, n = 0; + +int make_node(int _pos, int _len) +{ + fpos[sz] = _pos; + len [sz] = _len; + return sz++; +} + +void go_edge() +{ + while(pos > len[to[node][s[n - pos]]]) + { + node = to[node][s[n - pos]]; + pos -= len[node]; + } +} + +void add_letter(int c) +{ + s[n++] = c; + pos++; + int last = 0; + while(pos > 0) + { + go_edge(); + int edge = s[n - pos]; + int &v = to[node][edge]; + int t = s[fpos[v] + pos - 1]; + if(v == 0) + { + v = make_node(n - pos, inf); + link[last] = node; + last = 0; + } + else if(t == c) + { + link[last] = node; + return; + } + else + { + int u = make_node(fpos[v], pos - 1); + to[u][c] = make_node(n - 1, inf); + to[u][t] = v; + fpos[v] += pos - 1; + len [v] -= pos - 1; + v = u; + link[last] = u; + last = u; + } + if(node == 0) + pos--; + else + node = link[node]; + } +} + +int main() +{ + len[0] = inf; + string s; + cin >> s; + int ans = 0; + for(int i = 0; i < s.size(); i++) + add_letter(s[i]); + for(int i = 1; i < sz; i++) + ans += min((int)s.size() - fpos[i], len[i]); + cout << ans << "\n"; +} + From f9178f0cddf152f53e58e1c3f4dda64b501cd13b Mon Sep 17 00:00:00 2001 From: Alok pundir <38955311+rusty12rusty@users.noreply.github.com> Date: Thu, 17 Oct 2019 11:13:13 +0530 Subject: [PATCH 166/285] Create DFS algo I hope you have enjoyed this short introduction to graphs and I really hope this can help anyone willing to study graphs to come across a rigorous, yet simple and understandable text Best regards, Alok --- graphs/DFS algo | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 graphs/DFS algo diff --git a/graphs/DFS algo b/graphs/DFS algo new file mode 100644 index 00000000..b0973491 --- /dev/null +++ b/graphs/DFS algo @@ -0,0 +1,65 @@ +#include +#include +#include +#include +using namespace std; + +vector visited; //this vector will mark visited components +vector > graph; //this will store the graph represented internally as an adjacency list +//this is because the adjacency list representation is the most suited to use DFS procedure on a given graph + +int sz_connect_comp = 0; //this will store the size of current connected component (problem-specific feature) + +void dfs(int v) +{ + sz_connect_comp++; //"useful feature" performed on this DFS, this can vary from problem to problem + visited[v] = true; + + for(vector::iterator it = graph[v].begin(); it != graph[v].end(); it++) + { + if(! visited[*it]) //note that *it represents the adjacent vertex itself + { + dfs(*it); + } + } +} + +int main() +{ + int t; + cin >> t; + while(t--) + { + int n,m; + cin >> n >> m; + graph = vector > (n); //initialization of the graph + for(int i = 0; i < m; i++) + { + int u,v; + cin >> u >> v; + u--; + v--; + //these are added this way due to the friendship relation being mutual + graph.push_back(v); + graph[v].push_back(u); + } + int res = 0; // the number of fire escape routes + int ways = 1; // the number of ways to choose drill captains + visited = vector (n, 0); // initially mark all vertices as unvisited + for(int u = 0; u < n; u++) + { + //if the vertex was visited we skip it. + if(visited==true) + continue; + // if vertex was not visited it starts a new component + res++; // so we increase res + sz_connect_comp = 0; // init sz_connect_comp + dfs(u); // and calculate it through the dfs, marking visited vertices + // we multiply ways by sz_connect_comp modulo 1000000007 + ways = (long long)sz_connect_comp * ways % 1000000007; + } + printf("%d %d", res, ways); + + } + return 0; +} From 141f6b5c19e67fd682409a9ca3ae882fee0d8d54 Mon Sep 17 00:00:00 2001 From: Alok pundir <38955311+rusty12rusty@users.noreply.github.com> Date: Thu, 17 Oct 2019 11:17:53 +0530 Subject: [PATCH 167/285] Create BFS.cpp detect cycle in graph using bfs --- graphs/BFS.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 graphs/BFS.cpp diff --git a/graphs/BFS.cpp b/graphs/BFS.cpp new file mode 100644 index 00000000..d2b504d6 --- /dev/null +++ b/graphs/BFS.cpp @@ -0,0 +1,68 @@ +#include +using namespace std; +char mx[100][100]; +bool visited[100][100]; +int V,E,k,l,N,M; +bool isvalid(int x,int y) +{ + if(x<=N && y<=M && x>=1 && y>=1) + return true; + return false; +} +bool bfs(int x,int y) +{ + for(int i=1;i<100;i++) + for(int j=1;j<100;j++) + visited[i][j]=0; +queue > q; +q.push({x,y}); +visited[x][y]=1; +while(!q.empty()) +{ + x=q.front().first; + y=q.front().second; + visited[x][y]=true; + q.pop(); + if(isvalid(x,y+1) && !visited[x][y+1] && mx[x][y+1]==mx[x][y]) + q.push({x,y+1}); + if(isvalid(x,y-1) && !visited[x][y-1] && mx[x][y-1]==mx[x][y]) + q.push({x,y-1}); + if(isvalid(x+1,y) && !visited[x+1][y] && mx[x+1][y]==mx[x][y]) + q.push({x+1,y}); + if(isvalid(x-1,y) && !visited[x-1][y] && mx[x-1][y]==mx[x][y]) + q.push({x-1,y}); + int counter=0; + if(visited[x][y+1]) + counter++; + if(visited[x][y-1]) + counter++; + if(visited[x+1][y]) + counter++; + if(visited[x-1][y]) + counter++; + if(counter>1) + return true; + +} +return false; +} + +int main() +{ + cin>>N>>M; + for(int i=1;i<=N;i++) + for(int j=1;j<=M;j++) + cin>>mx[i][j]; + for(int i=1;i<=N;i++) + for(int j=1;j<=M;j++) + if( bfs(i,j)){ + cout<<"Yes"; + return 0; + } + + cout<<"No"; + + + + return 0; +} From fbcf72642716a5c49e1e324acc191ca6569d1abd Mon Sep 17 00:00:00 2001 From: pratik07101999 <42681860+pratik07101999@users.noreply.github.com> Date: Sat, 19 Oct 2019 09:46:22 +0530 Subject: [PATCH 168/285] Tic Tac Toe It is basic example of Min-Max Algorithm implementation in AI --- artificial-intelligence/TicTac(maxmin).cpp | 242 +++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 artificial-intelligence/TicTac(maxmin).cpp diff --git a/artificial-intelligence/TicTac(maxmin).cpp b/artificial-intelligence/TicTac(maxmin).cpp new file mode 100644 index 00000000..963a6659 --- /dev/null +++ b/artificial-intelligence/TicTac(maxmin).cpp @@ -0,0 +1,242 @@ +#include +#include +using namespace std; +const int M = 3; +const int N = 3; +int c=0; +struct Move +{ + int row, col; +}; +bool isMovesLeft(string Game[M][N]) +{ + for (int i = 0; i bestVal) + { + bestMove.row = i; + bestMove.col = j; + } + } + } + } + return bestMove; +} +void display(string Game[M][N]) +{ + cout << " " << Game[0][0] << " | " << Game[0][1] << " | " << Game[0][2] << " " << endl + << "---+---+---" << endl + << " " << Game[1][0] << " | " << Game[1][1] << " | " << Game[1][2] << " " << endl + << "---+---+---" << endl + << " " << Game[2][0] << " | " << Game[2][1] << " | " << Game[2][2] << " " << endl; +} +int main() +{ + string Game[M][N]; + int l,m; + int b=0; + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + Game[i][j]=" "; + } + } + display(Game); + for(int k=0;k>=0;k++) + { + if(b==0) + { + cout<<"Enter the move of Player 1(write Rowno. and ColNo.) "<>l>>m; + if(Game[l-1][m-1]==" ") + { + Game[l-1][m-1]="x"; + c++; + b++; + display(Game); + if((Game[0][0]=="x" && Game[0][1]=="x" && Game[0][2]=="x" )|| (Game[1][0]=="x" && Game[1][1]=="x" && Game[1][2]=="x") || (Game[2][0]=="x" && Game[2][1]=="x" && Game[2][2]=="x") || (Game[0][2]=="x" && Game[1][2]=="x" && Game[2][2]=="x") || (Game[0][1]=="x" && Game[1][1]=="x" && Game[2][1]=="x") || (Game[0][0]=="x" && Game[1][0]=="x" && Game[2][0]=="x") || (Game[0][0]=="x" && Game[1][1]=="x" && Game[2][2]=="x") || (Game[0][2]=="x" && Game[1][1]=="x" && Game[2][0]=="x")) + { + cout<<"Player 1 Wins"<4) + { + Move bestMove = findBestMove(Game); + int k=bestMove.row; + int l=bestMove.col; + Game[k+1][l+1]="O"; + } + else + { + { + srand(time(0)); + int computer= (rand()%9)+1; + int row=(computer-1)/3; + int col=(computer-1)%3; + if(Game[row][col]=="x" || Game[row][col]=="O") + { + continue; + } + else + { + Game[row][col]="O"; + } + } + } + + c++; + b--; + display(Game); + if((Game[0][0]=="x" && Game[0][1]=="x" && Game[0][2]=="x" )|| (Game[1][0]=="x" && Game[1][1]=="x" && Game[1][2]=="x") || (Game[2][0]=="x" && Game[2][1]=="x" && Game[2][2]=="x") || (Game[0][2]=="x" && Game[1][2]=="x" && Game[2][2]=="x") || (Game[0][1]=="x" && Game[1][1]=="x" && Game[2][1]=="x") || (Game[0][0]=="x" && Game[1][0]=="x" && Game[2][0]=="x") || (Game[0][0]=="x" && Game[1][1]=="x" && Game[2][2]=="x") || (Game[0][2]=="x" && Game[1][1]=="x" && Game[2][0]=="x")) + { + cout<<"Player 1 Wins"< Date: Sat, 19 Oct 2019 09:51:09 +0530 Subject: [PATCH 169/285] FiboSearch.cpp Fibonacci Search is a comparison-based technique that uses Fibonacci numbers to search an element in a sorted array. --- searches/FibonacciSearch.cpp | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 searches/FibonacciSearch.cpp diff --git a/searches/FibonacciSearch.cpp b/searches/FibonacciSearch.cpp new file mode 100644 index 00000000..b562e930 --- /dev/null +++ b/searches/FibonacciSearch.cpp @@ -0,0 +1,67 @@ +# Python3 program for Fibonacci search. +from bisect import bisect_left + +# Returns index of x if present, else +# returns -1 +def fibMonaccianSearch(arr, x, n): + + # Initialize fibonacci numbers + fibMMm2 = 0 # (m-2)'th Fibonacci No. + fibMMm1 = 1 # (m-1)'th Fibonacci No. + fibM = fibMMm2 + fibMMm1 # m'th Fibonacci + + # fibM is going to store the smallest + # Fibonacci Number greater than or equal to n + while (fibM < n): + fibMMm2 = fibMMm1 + fibMMm1 = fibM + fibM = fibMMm2 + fibMMm1 + + # Marks the eliminated range from front + offset = -1; + + # while there are elements to be inspected. + # Note that we compare arr[fibMm2] with x. + # When fibM becomes 1, fibMm2 becomes 0 + while (fibM > 1): + + # Check if fibMm2 is a valid location + i = min(offset+fibMMm2, n-1) + + # If x is greater than the value at + # index fibMm2, cut the subarray array + # from offset to i + if (arr[i] < x): + fibM = fibMMm1 + fibMMm1 = fibMMm2 + fibMMm2 = fibM - fibMMm1 + offset = i + + # If x is greater than the value at + # index fibMm2, cut the subarray + # after i+1 + elif (arr[i] > x): + fibM = fibMMm2 + fibMMm1 = fibMMm1 - fibMMm2 + fibMMm2 = fibM - fibMMm1 + + # element found. return index + else : + return i + + # comparing the last element with x */ + if(fibMMm1 and arr[offset+1] == x): + return offset+1; + + # element not found. return -1 + return -1 + +# Driver Code +arr = [10, 22, 35, 40, 45, 50, + 80, 82, 85, 90, 100] +n = len(arr) +x = 85 +print("Found at index:", + fibMonaccianSearch(arr, x, n)) + +# This code is contributed by Pratik_yadav From 69be52edb2899456f40b347ef373059e2d3d232e Mon Sep 17 00:00:00 2001 From: Arnab Saha <42444789+Arnabsaha6@users.noreply.github.com> Date: Sun, 20 Oct 2019 00:52:04 +0530 Subject: [PATCH 170/285] Create floyd_warshall.cpp --- floyd_warshall.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 floyd_warshall.cpp diff --git a/floyd_warshall.cpp b/floyd_warshall.cpp new file mode 100644 index 00000000..07951274 --- /dev/null +++ b/floyd_warshall.cpp @@ -0,0 +1,51 @@ +#include +using namespace std; +#define V 4 +#define INF 99999 +void printSolution(int dist[][V]); +void floydWarshall (int graph[][V]) +{ + int dist[V][V], i, j, k; + for (i = 0; i < V; i++) + for (j = 0; j < V; j++) + dist[i][j] = graph[i][j]; + for (k = 0; k < V; k++) + { + for (i = 0; i < V; i++) + { + for (j = 0; j < V; j++) + { + if (dist[i][k] + dist[k][j] < dist[i][j]) + dist[i][j] = dist[i][k] + dist[k][j]; + } + } + } + printSolution(dist); +} +void printSolution(int dist[][V]) +{ + cout<<"The following matrix shows the shortest distances" + " between every pair of vertices \n"; + for (int i = 0; i < V; i++) + { + for (int j = 0; j < V; j++) + { + if (dist[i][j] == INF) + cout<<"INF"<<" "; + else + cout< Date: Mon, 21 Oct 2019 10:40:20 +0530 Subject: [PATCH 171/285] Add files via upload Adding some Sorting Algorithms whicch are not present in your Repository . --- sorting/BucketSort.cpp | 36 ++++++++++++++++++++++ sorting/CombSort.cpp | 53 ++++++++++++++++++++++++++++++++ sorting/CycleSort.cpp | 63 ++++++++++++++++++++++++++++++++++++++ sorting/PigeonholeSort.cpp | 42 +++++++++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 sorting/BucketSort.cpp create mode 100644 sorting/CombSort.cpp create mode 100644 sorting/CycleSort.cpp create mode 100644 sorting/PigeonholeSort.cpp diff --git a/sorting/BucketSort.cpp b/sorting/BucketSort.cpp new file mode 100644 index 00000000..79fa2dff --- /dev/null +++ b/sorting/BucketSort.cpp @@ -0,0 +1,36 @@ +#include +#include +#include +using namespace std; + +void bucketSort(float arr[], int n) +{ + vector b[n]; + + for (int i=0; i +using namespace std; + +int getNextGap(int gap) +{ + gap = (gap*10)/13; + + if (gap < 1) + return 1; + return gap; +} + +void combSort(int a[], int n) +{ + + int gap = n; + + bool swapped = true; + + + while (gap != 1 || swapped == true) + { + + gap = getNextGap(gap); + + swapped = false; + + + for (int i=0; i a[i+gap]) + { + swap(a[i], a[i+gap]); + swapped = true; + } + } + } +} + + +int main() +{ + int a[] = {8, 4, 1, 56, 3, -44, 23, -6, 28, 0}; + int n = sizeof(a)/sizeof(a[0]); + + combSort(a, n); + + printf("Sorted array: \n"); + for (int i=0; i +using namespace std; + +void cycleSort(int arr[], int n) +{ + int writes = 0; + + for (int cycle_start = 0; cycle_start <= n - 2; cycle_start++) { + + int item = arr[cycle_start]; + + int pos = cycle_start; + for (int i = cycle_start + 1; i < n; i++) + if (arr[i] < item) + pos++; + + + if (pos == cycle_start) + continue; + + + while (item == arr[pos]) + pos += 1; + + + if (pos != cycle_start) { + swap(item, arr[pos]); + writes++; + } + + + while (pos != cycle_start) { + pos = cycle_start; + + + for (int i = cycle_start + 1; i < n; i++) + if (arr[i] < item) + pos += 1; + + + while (item == arr[pos]) + pos += 1; + + + if (item != arr[pos]) { + swap(item, arr[pos]); + writes++; + } + } + } +} + +int main() +{ + int arr[] = { 1, 8, 3, 9, 10, 10, 2, 4 }; + int n = sizeof(arr) / sizeof(arr[0]); + cycleSort(arr, n); + + cout << "After sort : " << endl; + for (int i = 0; i < n; i++) + cout << arr[i] << " "; + return 0; +} diff --git a/sorting/PigeonholeSort.cpp b/sorting/PigeonholeSort.cpp new file mode 100644 index 00000000..68339633 --- /dev/null +++ b/sorting/PigeonholeSort.cpp @@ -0,0 +1,42 @@ +#include +using namespace std; + +void pigeonholeSort(int arr[], int n) +{ + int min = arr[0], max = arr[0]; + for (int i = 1; i < n; i++) + { + if (arr[i] < min) + min = arr[i]; + if (arr[i] > max) + max = arr[i]; + } + int range = max - min + 1; // Find range + + vector holes[range]; + + for (int i = 0; i < n; i++) + holes[arr[i]-min].push_back(arr[i]); + + int index = 0; // index in sorted array + for (int i = 0; i < range; i++) + { + vector::iterator it; + for (it = holes[i].begin(); it != holes[i].end(); ++it) + arr[index++] = *it; + } +} + +int main() +{ + int arr[] = {8, 3, 2, 7, 4, 6, 8}; + int n = sizeof(arr)/sizeof(arr[0]); + + pigeonholeSort(arr, n); + + printf("Sorted order is : "); + for (int i = 0; i < n; i++) + printf("%d ", arr[i]); + + return 0; +} From 835857aa830acc056d0847f5f1d407a6540ab1ee Mon Sep 17 00:00:00 2001 From: ameycodes Date: Mon, 21 Oct 2019 13:11:48 +0530 Subject: [PATCH 172/285] Create largest_sum_contiguous_subarray.cpp --- .idea/cpp.iml | 11 ++ .idea/encodings.xml | 4 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 168 ++++++++++++++++++ .../largest_sum_contiguous_subarray.cpp | 31 ++++ 7 files changed, 235 insertions(+) create mode 100644 .idea/cpp.iml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 dynamic-programming/largest_sum_contiguous_subarray.cpp diff --git a/.idea/cpp.iml b/.idea/cpp.iml new file mode 100644 index 00000000..f3aeec39 --- /dev/null +++ b/.idea/cpp.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..15a15b21 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..bc9e86fa --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..e009e75f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..78237c03 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -92,12 +95,28 @@ - @@ -110,16 +129,11 @@ + - - + - - - - - - + @@ -127,11 +141,17 @@ - - + + + + + + + + @@ -162,12 +182,32 @@ + + + + + + - + + - - + + diff --git a/dynamic-programming/golomb_sequence.cpp b/dynamic-programming/golomb_sequence.cpp new file mode 100644 index 00000000..ceffed83 --- /dev/null +++ b/dynamic-programming/golomb_sequence.cpp @@ -0,0 +1,25 @@ +#include +#define blue ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); + +using namespace std; + + +void golombSequence(int n) +{ + int dp[n + 1]; + dp[1] = 1; + cout << dp[1] << " "; + for (int i = 2; i <= n; i++) + { + dp[i] = 1 + dp[i - dp[dp[i - 1]]]; + cout << dp[i] << " "; + } +} + +int main() +{ + blue; + int n = 10; + golombSequence(n); + return 0; +} From d5984e4d37264d51dc9bd36f6a35e9d417c65ac5 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 14:49:32 +0530 Subject: [PATCH 177/285] Delete cpp.iml --- .idea/cpp.iml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .idea/cpp.iml diff --git a/.idea/cpp.iml b/.idea/cpp.iml deleted file mode 100644 index f3aeec39..00000000 --- a/.idea/cpp.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 76e4eea44d1cb7d061c3807b2b962d9097b676e7 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 14:49:45 +0530 Subject: [PATCH 178/285] Delete misc.xml --- .idea/misc.xml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index bc9e86fa..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file From d3fcee52f9ae31c7cba5e2ff480b8aec7c7dabad Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 14:49:54 +0530 Subject: [PATCH 179/285] Delete modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e009e75f..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 7ac6fb9ec8b8ba887ca83ab524cc07da196e0dda Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 14:50:03 +0530 Subject: [PATCH 180/285] Delete workspace.xml --- .idea/workspace.xml | 215 -------------------------------------------- 1 file changed, 215 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0a02d3ce..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + 1571643102463 + + + 1571646697584 + + + 1571648707187 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From c391864694df919cd784863ed037219a24b64d43 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:15:55 +0530 Subject: [PATCH 183/285] Delete encodings.xml --- .idea/encodings.xml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .idea/encodings.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 15a15b21..00000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 20d625adbf4e274fb319ee06fe511eeb3e75ecec Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:16:04 +0530 Subject: [PATCH 184/285] Delete vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 8961980759bcba5f68162ba7662dfb83cae935a2 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:16:22 +0530 Subject: [PATCH 185/285] Delete workspace.xml --- .idea/workspace.xml | 214 -------------------------------------------- 1 file changed, 214 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index afe624a1..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -95,7 +97,8 @@ 1571643102463 - + + 1571646697584 @@ -115,7 +118,7 @@ - @@ -130,7 +133,7 @@ - + @@ -205,8 +208,15 @@ - - + + + + + + + + + diff --git a/dynamic-programming/newman_conway_sequence.cpp b/dynamic-programming/newman_conway_sequence.cpp new file mode 100644 index 00000000..81fcfb09 --- /dev/null +++ b/dynamic-programming/newman_conway_sequence.cpp @@ -0,0 +1,27 @@ +#include +#define blue ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); + +using namespace std; + +int sequence(int n) +{ + int f[n + 1]; + int i; + f[0] = 0; + f[1] = 1; + f[2] = 1; + + for (i = 3; i <= n; i++) + f[i] = f[f[i - 1]] + f[i - f[i - 1]]; + + return f[n]; +} + + +int main() +{ + blue; + int n = 50; + cout << sequence(n); + return 0; +} From a5b7fd77118515ad493d97c1b58879c96f942b87 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:32:59 +0530 Subject: [PATCH 187/285] Delete golomb_sequence.cpp --- dynamic-programming/golomb_sequence.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 dynamic-programming/golomb_sequence.cpp diff --git a/dynamic-programming/golomb_sequence.cpp b/dynamic-programming/golomb_sequence.cpp deleted file mode 100644 index ceffed83..00000000 --- a/dynamic-programming/golomb_sequence.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include -#define blue ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); - -using namespace std; - - -void golombSequence(int n) -{ - int dp[n + 1]; - dp[1] = 1; - cout << dp[1] << " "; - for (int i = 2; i <= n; i++) - { - dp[i] = 1 + dp[i - dp[dp[i - 1]]]; - cout << dp[i] << " "; - } -} - -int main() -{ - blue; - int n = 10; - golombSequence(n); - return 0; -} From 5cb2e2c8e4e22d129d06d3cf82670c5bded6dcc1 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:35:19 +0530 Subject: [PATCH 188/285] Delete vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 8f545b83211ba5ee20b941ca32089ac9c5af703d Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:35:29 +0530 Subject: [PATCH 189/285] Delete workspace.xml --- .idea/workspace.xml | 224 -------------------------------------------- 1 file changed, 224 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index bfd3a201..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1571643102463 - - - 1571646697584 - - - 1571648707187 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 4b3328d6c76c19a44188deb09ae1a47fc19c8563 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:49:14 +0530 Subject: [PATCH 195/285] Delete golomb_sequence.cpp --- dynamic-programming/golomb_sequence.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 dynamic-programming/golomb_sequence.cpp diff --git a/dynamic-programming/golomb_sequence.cpp b/dynamic-programming/golomb_sequence.cpp deleted file mode 100644 index ceffed83..00000000 --- a/dynamic-programming/golomb_sequence.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include -#define blue ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); - -using namespace std; - - -void golombSequence(int n) -{ - int dp[n + 1]; - dp[1] = 1; - cout << dp[1] << " "; - for (int i = 2; i <= n; i++) - { - dp[i] = 1 + dp[i - dp[dp[i - 1]]]; - cout << dp[i] << " "; - } -} - -int main() -{ - blue; - int n = 10; - golombSequence(n); - return 0; -} From 2527d6b91dbacf73b0c96519d0b4066299acde75 Mon Sep 17 00:00:00 2001 From: ameycodes <46608231+ameycodes@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:49:24 +0530 Subject: [PATCH 196/285] Delete newman_conway_sequence.cpp --- .../newman_conway_sequence.cpp | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 dynamic-programming/newman_conway_sequence.cpp diff --git a/dynamic-programming/newman_conway_sequence.cpp b/dynamic-programming/newman_conway_sequence.cpp deleted file mode 100644 index 81fcfb09..00000000 --- a/dynamic-programming/newman_conway_sequence.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#define blue ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); - -using namespace std; - -int sequence(int n) -{ - int f[n + 1]; - int i; - f[0] = 0; - f[1] = 1; - f[2] = 1; - - for (i = 3; i <= n; i++) - f[i] = f[f[i - 1]] + f[i - f[i - 1]]; - - return f[n]; -} - - -int main() -{ - blue; - int n = 50; - cout << sequence(n); - return 0; -} From cd3fa730c65c459c963946f01812a072c5ecf119 Mon Sep 17 00:00:00 2001 From: eunuch74 Date: Tue, 22 Oct 2019 00:21:25 +0900 Subject: [PATCH 197/285] Add : count_triangle cpp input the graph, it will count the all of the posslble case to make triangle --- graphs/count_triangle.cpp | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 graphs/count_triangle.cpp diff --git a/graphs/count_triangle.cpp b/graphs/count_triangle.cpp new file mode 100644 index 00000000..215dcc94 --- /dev/null +++ b/graphs/count_triangle.cpp @@ -0,0 +1,73 @@ +#include + +using namespace std; + +long long answer = 0; +int N, M; +bool map[50][50] = { + 0, +}; + +void dfs(int start, int current, int before, int depth) { + if (depth == 2) { + if (current == start) { + answer++; + } + return; + } + + int iteration_start, iteration_end; + if (depth != 1) { + iteration_start = current + 1; + iteration_end = N; + } else { + iteration_start = 0; + iteration_end = current; + } + + for (int i = iteration_start; i < iteration_end; i++) { + if (map[current][i] && i != before) { + dfs(start, i, current, depth + 1); + } + } +} + +void solution() { + answer = 0; + cin >> N >> M; + + for (int i = 0; i < N; i++) { + for (int j = 0; j < N; j++) { + map[i][j] = 0; + } + } + + int x, y; + for (int i = 0; i < M; i++) { + cin >> x >> y; + x--; + y--; + map[x][y] = 1; + map[y][x] = 1; + } + + for (int i = 0; i < N - 1; i++) { + for (int j = i + 1; j < N; j++) { + if (map[i][j]) { + dfs(i, j, i, 0); + } + } + } + + cout << "number of triangle : " << answer; +} + +int main() { + ios_base ::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + solution(); + + return 0; +} \ No newline at end of file From 4269ee2f42ddefd360d840276cd0522e18c89c08 Mon Sep 17 00:00:00 2001 From: CREVIOS <48938983+CREVIOS@users.noreply.github.com> Date: Mon, 21 Oct 2019 23:51:03 +0600 Subject: [PATCH 198/285] Ford_Fulkerson Algorithm for maximum flow --- graphs/ford_fulkerson.cpp | 75 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 graphs/ford_fulkerson.cpp diff --git a/graphs/ford_fulkerson.cpp b/graphs/ford_fulkerson.cpp new file mode 100644 index 00000000..b0df6e6a --- /dev/null +++ b/graphs/ford_fulkerson.cpp @@ -0,0 +1,75 @@ + + +#include +#include + +using namespace std; + +#define N 7 +#define INF 9999999 + +// flow network +int Flow[N][N]; +// visited array +bool visited[N]; + +// original flow network graph shown in the above example +//0 1 2 3 4 5 6 +int graph[N][N] = { + { 0, 5, 4, 0, 0, 0, 0 }, //0 + { 0, 0, 0, 0, 0, 0, 4 }, //1 + { 0, 0, 0, 3, 0, 0, 6 }, //2 + { 0, 0, 0, 0, 5, 0, 0 }, //3 + { 0, 0, 0, 0, 0, 0, 8 }, //4 + { 6, 0, 0, 2, 0, 0, 0 }, //5 + { 0, 0, 0, 0, 0, 0, 0 }, //6 +}; + +int dfs(int s, int t, int minimum) +{ + visited[s] = true; + + // if source and sink is same + if (s == t) + return minimum; + + for (int i = 0; i < N; i++) + { + int flow_capacity = graph[s][i] - Flow[s][i]; + if (!visited[i] && flow_capacity > 0) + // find min capacity in dfs path + if (int sent = dfs (i, t, min (minimum, flow_capacity))) + { + // adjust the capacity + Flow[s][i] += sent; + Flow[i][s] -= sent; + return sent; + } + } + + return false; +} + +int main() +{ + // initialize initial flow capacity 0 + memset(Flow, 0, sizeof(Flow)); + + // initialize visited array false initially + memset(visited, 0, sizeof(visited)); + + int s = 5; + int t = 6; + + int max_flow = 0; + // while ther is augmenting path , from s and t + // with positive flow capacity + while (int sent = dfs(s, t, INF)) + { + max_flow += sent; + // reset visited array , for searching next path + memset(visited, 0, sizeof(visited)); + } + cout << "The max flow from node 5 to sink node 6 is " << max_flow; + cout << endl; +} From 0a989e68363861e696c546c0f6aa8f023de68f4e Mon Sep 17 00:00:00 2001 From: CREVIOS <48938983+CREVIOS@users.noreply.github.com> Date: Tue, 22 Oct 2019 00:14:19 +0600 Subject: [PATCH 199/285] Catalan Number --- math/catalan_number_dynamic.cpp | 19 +++++++++++++++++++ math/catalan_number_recursive.cpp | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 math/catalan_number_dynamic.cpp create mode 100644 math/catalan_number_recursive.cpp diff --git a/math/catalan_number_dynamic.cpp b/math/catalan_number_dynamic.cpp new file mode 100644 index 00000000..45b05bc3 --- /dev/null +++ b/math/catalan_number_dynamic.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; + + +int main() +{ + int n; + cin >> n; + + long long cat[100000]; + cat[0] = 1; + cout << cat[0]; + + for (int i = 1; i <= n; i++) + { + cat[i] = 2 * (4 * i + 1) * cat[i - 1] / (i + 2); + cout << cat[i] << endl; + } +} diff --git a/math/catalan_number_recursive.cpp b/math/catalan_number_recursive.cpp new file mode 100644 index 00000000..72bac476 --- /dev/null +++ b/math/catalan_number_recursive.cpp @@ -0,0 +1,21 @@ +#include +using namespace std; + + +int main() +{ + int n; + cin >> n; + + long long cat[100000]; + cat[0] = 1; + cout << cat[0]; + + for (int i = 1; i <= n; i++) + { + cat[i] = 0; + for (int j = 0; j < i; j++) + cat[i] += cat[j] * cat[i - j - 1]; + cout << cat[i] << endl; + } +} From 051d31aced141a6355fe0d846e657ff8d53d3f42 Mon Sep 17 00:00:00 2001 From: CREVIOS <48938983+CREVIOS@users.noreply.github.com> Date: Tue, 22 Oct 2019 00:15:46 +0600 Subject: [PATCH 200/285] Delete ford_fulkerson.cpp --- graphs/ford_fulkerson.cpp | 75 --------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 graphs/ford_fulkerson.cpp diff --git a/graphs/ford_fulkerson.cpp b/graphs/ford_fulkerson.cpp deleted file mode 100644 index b0df6e6a..00000000 --- a/graphs/ford_fulkerson.cpp +++ /dev/null @@ -1,75 +0,0 @@ - - -#include -#include - -using namespace std; - -#define N 7 -#define INF 9999999 - -// flow network -int Flow[N][N]; -// visited array -bool visited[N]; - -// original flow network graph shown in the above example -//0 1 2 3 4 5 6 -int graph[N][N] = { - { 0, 5, 4, 0, 0, 0, 0 }, //0 - { 0, 0, 0, 0, 0, 0, 4 }, //1 - { 0, 0, 0, 3, 0, 0, 6 }, //2 - { 0, 0, 0, 0, 5, 0, 0 }, //3 - { 0, 0, 0, 0, 0, 0, 8 }, //4 - { 6, 0, 0, 2, 0, 0, 0 }, //5 - { 0, 0, 0, 0, 0, 0, 0 }, //6 -}; - -int dfs(int s, int t, int minimum) -{ - visited[s] = true; - - // if source and sink is same - if (s == t) - return minimum; - - for (int i = 0; i < N; i++) - { - int flow_capacity = graph[s][i] - Flow[s][i]; - if (!visited[i] && flow_capacity > 0) - // find min capacity in dfs path - if (int sent = dfs (i, t, min (minimum, flow_capacity))) - { - // adjust the capacity - Flow[s][i] += sent; - Flow[i][s] -= sent; - return sent; - } - } - - return false; -} - -int main() -{ - // initialize initial flow capacity 0 - memset(Flow, 0, sizeof(Flow)); - - // initialize visited array false initially - memset(visited, 0, sizeof(visited)); - - int s = 5; - int t = 6; - - int max_flow = 0; - // while ther is augmenting path , from s and t - // with positive flow capacity - while (int sent = dfs(s, t, INF)) - { - max_flow += sent; - // reset visited array , for searching next path - memset(visited, 0, sizeof(visited)); - } - cout << "The max flow from node 5 to sink node 6 is " << max_flow; - cout << endl; -} From d9b496a7d5a9f5545ab196c80ca164c04246bf66 Mon Sep 17 00:00:00 2001 From: vivek Date: Tue, 22 Oct 2019 03:12:46 +0530 Subject: [PATCH 201/285] Added a graph class containing all algorithms as member functions with adjacency list implementation --- graphs/cpp-graph_class.cpp | 198 +++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 graphs/cpp-graph_class.cpp diff --git a/graphs/cpp-graph_class.cpp b/graphs/cpp-graph_class.cpp new file mode 100644 index 00000000..039c23aa --- /dev/null +++ b/graphs/cpp-graph_class.cpp @@ -0,0 +1,198 @@ +/**Author : Vivek Bhardwaj + * Contributed to : https://github.com/AllAlgorithms/cpp + **/ + +#include +using namespace std; + +class graph{ + private : + vector> adj; + vector> weight_matrix; + vector visited; + vector distance; + vector> edge_list; + long long ** weight; + const long long INF=1e18; + + + void visited_util(){ + fill(visited.begin(),visited.end(),false); + } + + void dfs_util(int start){ + visited[start]=true; + //do something ...... + cout< q; q.push(start); visited[start]=true; + //do something ...... + //cout<vertices=vertex; + } + + void add_directed_edge(int from,int to){ + adj[from].push_back(to); + edge_list.emplace_back(from,to); + } + + void add_directed_edge(int from,int to,int weigh){ + adj[from].push_back(to); + weight[from][to]=weigh; + edge_list.emplace_back(from,to); + } + + void add_undirected_edge(int x,int y,int weigh=1){ + adj[x].push_back(y); + adj[y].push_back(x); + edge_list.emplace_back(x,y); + edge_list.emplace_back(y,x); + weight[x][y]=weigh; + weight[y][x]=weigh; + } + + void bfs(int start){ + visited_util(); + bfs_util(start); + } + + void dfs(int start){ + visited_util(); + dfs_util(start); + } + + void dijkstra(int start){ + visited_util(); + fill(distance.begin(),distance.end(),INF); + distance[start]=0; + dijkstra_util(start); + } + + void bellman_ford(int start){ + visited_util(); + fill(distance.begin(),distance.end(),INF); + distance[start]=0; + bellman_ford_util(start); + } + + void floyd_warshell(){ + + for(int i=0;i Date: Tue, 22 Oct 2019 19:49:27 +0530 Subject: [PATCH 202/285] Added Deque in Data Structures --- data-structures/Deque/deque.c | 202 ++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 data-structures/Deque/deque.c diff --git a/data-structures/Deque/deque.c b/data-structures/Deque/deque.c new file mode 100644 index 00000000..047cbf9d --- /dev/null +++ b/data-structures/Deque/deque.c @@ -0,0 +1,202 @@ +#include +#include +#define MAX 30 + +typedef struct dequeue +{ + int data[MAX]; + int rear,front; +}dequeue; + +void initialize(dequeue *p); +int empty(dequeue *p); +int full(dequeue *p); +void enqueueR(dequeue *p,int x); +void enqueueF(dequeue *p,int x); +int dequeueF(dequeue *p); +int dequeueR(dequeue *p); +void print(dequeue *p); + +void main() +{ + int i,x,op,n; + dequeue q; + + initialize(&q); + + do + { + printf("\n1.Create\n2.Insert(rear)\n3.Insert(front)\n4.Delete(rear)\n5.Delete(front)"); + printf("\n6.Print\n7.Exit\n\nEnter your choice:"); + scanf("%d",&op); + + switch(op) + { + case 1: printf("\nEnter number of elements:"); + scanf("%d",&n); + initialize(&q); + printf("\nEnter the data:"); + + for(i=0;irear=-1; + P->front=-1; +} + +int empty(dequeue *P) +{ + if(P->rear==-1) + return(1); + + return(0); +} + +int full(dequeue *P) +{ + if((P->rear+1)%MAX==P->front) + return(1); + + return(0); +} + +void enqueueR(dequeue *P,int x) +{ + if(empty(P)) + { + P->rear=0; + P->front=0; + P->data[0]=x; + } + else + { + P->rear=(P->rear+1)%MAX; + P->data[P->rear]=x; + } +} + +void enqueueF(dequeue *P,int x) +{ + if(empty(P)) + { + P->rear=0; + P->front=0; + P->data[0]=x; + } + else + { + P->front=(P->front-1+MAX)%MAX; + P->data[P->front]=x; + } +} + +int dequeueF(dequeue *P) +{ + int x; + + x=P->data[P->front]; + + if(P->rear==P->front) //delete the last element + initialize(P); + else + P->front=(P->front+1)%MAX; + + return(x); +} + +int dequeueR(dequeue *P) +{ + int x; + + x=P->data[P->rear]; + + if(P->rear==P->front) + initialize(P); + else + P->rear=(P->rear-1+MAX)%MAX; + + return(x); +} + +void print(dequeue *P) +{ + if(empty(P)) + { + printf("\nQueue is empty!!"); + exit(0); + } + + int i; + i=P->front; + + while(i!=P->rear) + { + printf("\n%d",P->data[i]); + i=(i+1)%MAX; + } + + printf("\n%d\n",P->data[P->rear]); +} From eb3b72709bf92ba16abc1f33cfabdac775ad6c1d Mon Sep 17 00:00:00 2001 From: Amal Ramesh <44441397+amalrhk@users.noreply.github.com> Date: Thu, 24 Oct 2019 18:24:46 +0530 Subject: [PATCH 203/285] Sublist Search Its a searching algorithm to search a list inside a list --- SublistSearch.cpp | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 SublistSearch.cpp diff --git a/SublistSearch.cpp b/SublistSearch.cpp new file mode 100644 index 00000000..2e7bb981 --- /dev/null +++ b/SublistSearch.cpp @@ -0,0 +1,112 @@ +// C++ program to find a list in second list +#include +using namespace std; + +// A Linked List node +struct Node +{ + int data; + Node* next; +}; + +// Returns true if first list is present in second +// list +bool findList(Node* first, Node* second) +{ + Node* ptr1 = first, *ptr2 = second; + + // If both linked lists are empty, return true + if (first == NULL && second == NULL) + return true; + + // Else If one is empty and other is not return + // false + if ( first == NULL || + (first != NULL && second == NULL)) + return false; + + // Traverse the second list by picking nodes + // one by one + while (second != NULL) + { + // Initialize ptr2 with current node of second + ptr2 = second; + + // Start matching first list with second list + while (ptr1 != NULL) + { + // If second list becomes empty and first + // not then return false + if (ptr2 == NULL) + return false; + + // If data part is same, go to next + // of both lists + else if (ptr1->data == ptr2->data) + { + ptr1 = ptr1->next; + ptr2 = ptr2->next; + } + + // If not equal then break the loop + else break; + } + + // Return true if first list gets traversed + // completely that means it is matched. + if (ptr1 == NULL) + return true; + + // Initialize ptr1 with first again + ptr1 = first; + + // And go to next node of second list + second = second->next; + } + + return false; +} + +/* Function to print nodes in a given linked list */ +void printList(Node* node) +{ + while (node != NULL) + { + printf("%d ", node->data); + node = node->next; + } +} + +// Function to add new node to linked lists +Node *newNode(int key) +{ + Node *temp = new Node; + temp-> data= key; + temp->next = NULL; + return temp; +} + +/* Driver program to test above functions*/ +int main() +{ + /* Let us create two linked lists to test + the above functions. Created lists shall be + a: 1->2->3->4 + b: 1->2->1->2->3->4*/ + Node *a = newNode(1); + a->next = newNode(2); + a->next->next = newNode(3); + a->next->next->next = newNode(4); + + Node *b = newNode(1); + b->next = newNode(2); + b->next->next = newNode(1); + b->next->next->next = newNode(2); + b->next->next->next->next = newNode(3); + b->next->next->next->next->next = newNode(4); + + findList(a,b) ? cout << "LIST FOUND" : + cout << "LIST NOT FOUND"; + + return 0; +} From a7e60a394d210378ae7ff02cd463bbfda5df6320 Mon Sep 17 00:00:00 2001 From: BlairTodd97 Date: Sat, 26 Oct 2019 23:15:48 -0500 Subject: [PATCH 204/285] Added file with Functions from an old assignment --- data-structures/linkedlist/linkedLists.cpp | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 data-structures/linkedlist/linkedLists.cpp diff --git a/data-structures/linkedlist/linkedLists.cpp b/data-structures/linkedlist/linkedLists.cpp new file mode 100644 index 00000000..518031bd --- /dev/null +++ b/data-structures/linkedlist/linkedLists.cpp @@ -0,0 +1,151 @@ +#include + +using namespace std; + + + +struct btNode +{ + int data; + btNode* left; + btNode* right; +}; + + + + + + +void bst_insert(btNode*& bst_root, int anInt) +{ + if(bst_root == 0) // if list is empty + { + btNode* newNode = new btNode; + + newNode->data = anInt; + newNode->left = 0; + newNode->right= 0; + + bst_root = newNode; + return; // end function call + } + + btNode* marker = new btNode; // traverse pointer + marker = bst_root; + + while( marker != 0) // not at a leaf + { + if(marker->data == anInt) // if duplicate is found + { + marker->data = anInt; // overwrite and leave function + return; + } + + + + if(marker->data > anInt) // if # is less than + { + if(marker->left != 0) + { + marker = marker->left; // if not empty move left + } + + else // if empty, populate + { + btNode* newNode = new btNode; // create + + newNode->data = anInt; // populate + newNode->left = 0; + newNode->right = 0; + + marker->left = newNode; // attach + return; + + } + } + + if(marker->data < anInt) // if # is greater + { + if(marker->right != 0) + marker = marker->right; + + else + { + btNode* newNode = new btNode; + + newNode->data = anInt; + newNode->left = 0; + newNode->right = 0; + + marker->right = newNode; + return; + } + + } + + } +} + + + bool bst_remove(btNode*& bst_root, int anInt) + { + + if(bst_root == 0) // if empty tree return false + return false; + + + if(bst_root->data > anInt) // if # is less than + return bst_remove(bst_root->left,anInt); // shift and recurse + + if(bst_root->data < anInt) // if # is greater than + return bst_remove(bst_root->right,anInt); + + + if(bst_root->data == anInt) // if # is found + { + if(bst_root->left == 0) // if no left node + { + btNode* temp = bst_root; //mini remove max + + bst_root = bst_root->right; + + delete temp; + return true; + } + + // if left node is occupied + bst_remove_max(bst_root->left, bst_root->data); + return true; + } + + return false; // if nothing is found + + } + + void bst_remove_max(btNode*& bst_root, int& info) + { + + if(bst_root->right != 0) // if right node is still occupied + return bst_remove_max(bst_root->right, info); + + + btNode* tempNode = new btNode; // prepare node to be deleted + tempNode = 0; // make NULL + + btNode* marker = new btNode; // make a node to traverse tree + marker = bst_root; + + + if(bst_root->right == 0) // if at rightmost node + { + info = bst_root->data; // get information stored in node + + tempNode = marker; + + bst_root = bst_root->left; + + delete tempNode; + } + + } + From ec9b74bf9167adce48d013277f933305baeee5e0 Mon Sep 17 00:00:00 2001 From: alfredo Date: Mon, 28 Oct 2019 11:48:59 -0200 Subject: [PATCH 205/285] feat(data-structures): add avl and red-black tree --- data-structures/avl-tree/AVL.cpp | 125 +++++++++++++++++ data-structures/avl-tree/AVL.h | 17 +++ data-structures/red-black-tree/RedBlack.cpp | 143 ++++++++++++++++++++ data-structures/red-black-tree/RedBlack.h | 14 ++ 4 files changed, 299 insertions(+) create mode 100644 data-structures/avl-tree/AVL.cpp create mode 100644 data-structures/avl-tree/AVL.h create mode 100644 data-structures/red-black-tree/RedBlack.cpp create mode 100644 data-structures/red-black-tree/RedBlack.h diff --git a/data-structures/avl-tree/AVL.cpp b/data-structures/avl-tree/AVL.cpp new file mode 100644 index 00000000..556e74d3 --- /dev/null +++ b/data-structures/avl-tree/AVL.cpp @@ -0,0 +1,125 @@ +#include "AVL.h" +using namespace std; + +//Calcule altura de um n +int height_node(struct _Node_* node){ + if(node == NULL) + return -1; + else + return node->height; +} +//Calcule o fator de balanceamento de um n +int fatorBalanceamento_node(struct _Node_* node){ + int valor = (height_node(node->right))-(height_node(node->left)); + return valor; +} +//Calcula o maior valor +int maior(int x, int y){ + if(x > y) + return x; + else + return y; +} +//Rotao a esquerda +AVLnode* RotationLL(AVLnode* root){ + AVLnode*node; + node = root->left; + root->left = node->right; + root->height = maior(height_node(root->left),height_node(root->right)) + 1; + node->height = maior(height_node(node->left),height_node(root)) + 1; + root = node; + return root; +} +//Rotao a direita +AVLnode* RotationRR(AVLnode* root){ + AVLnode* node; + node = root->right; + root->right = node->left; + root->height = maior(height_node(root->left),height_node(root->right)) + 1; + node->height = maior(height_node(node->right),height_node(root)) + 1; + root = node; + return root; +} +//Rotao dupla a esquerda +AVLnode* RotationLR(AVLnode* root){ + root->left = RotationRR(root->left); + root = RotationLL(root); + return root; +} +//Rotao dupla a direita +AVLnode* RotationRL(AVLnode* root){ + root->right = RotationLL(root->right); + root = RotationRR(root); + return root; +} +//Insert AVLtree +AVLnode* insert_AVLnode(AVLnode* root,Data* data){ + //rvore vazia ou n folha + if(root == NULL){ + AVLnode* novo; + novo = new AVLnode[1]; + if(novo == NULL) + return NULL; + novo->data = data; + novo->height = 0; + novo->left = NULL; + novo->right = NULL; + return novo; + } + + AVLnode* current = root; + + /*Balaneamento*/ + if(data->key < current->data->key){ + current->left = insert_AVLnode(current->left, data); + if(current->left != NULL){ + if(fatorBalanceamento_node(current) <= -2){ + if(data->key < current->left->data->key) + root = RotationLL(root); + else + root = RotationLR(root); + } + } + return root; + }else{ + if(data->key > current->data->key){ + current->right = insert_AVLnode(current->right, data); + if(current->right != NULL){ + if(fatorBalanceamento_node(current) >= 2){ + if(data->key > current->right->data->key) + root = RotationRR(root); + else + root = RotationRL(root); + } + } + } + return root; + } + return NULL; +} +//Query +void Query(AVLnode* root,Data** aux,string str,int* passos){ + int value = valorString(str); + if(root != NULL){ + if(root->data->key == value){ + *aux = root->data; + }else if(value > root->data->key){ + Query(root->right, &*aux, str, &*passos); + }else{ + Query(root->left, &*aux, str, &*passos); + } + } + *passos = *passos + 1; +} + +//Destruir +void Destroy(AVLnode *t){ + if(t != NULL){ + Destroy(t->left); + Destroy(t->right); + t->data->linhas.clear(); + t->data->ocorrencias.clear(); + delete[]t->data; + delete[]t; + } +} diff --git a/data-structures/avl-tree/AVL.h b/data-structures/avl-tree/AVL.h new file mode 100644 index 00000000..2e22c600 --- /dev/null +++ b/data-structures/avl-tree/AVL.h @@ -0,0 +1,17 @@ +#ifndef _AVL_H_ +#define _AVL_H_ +#include "structs.h" + +typedef struct _Node_{ + struct _data_ *data; + int height; + struct _Node_ *left; + struct _Node_ *right; +} AVLnode; + +AVLnode* insert_AVLnode(AVLnode* root,Data* data); +void Query(AVLnode* root,Data** aux,string str, int* passos); +void Destroy(AVLnode *t); + +#endif + diff --git a/data-structures/red-black-tree/RedBlack.cpp b/data-structures/red-black-tree/RedBlack.cpp new file mode 100644 index 00000000..2710e388 --- /dev/null +++ b/data-structures/red-black-tree/RedBlack.cpp @@ -0,0 +1,143 @@ +#include "RedBlack.h" + +//Rotao a esquerda +void rightRotate(RBnode** root, RBnode* x){ + RBnode* y = x->left; + x->left = y->right; + if(y->right != NULL) + y->right->dad = x; + y->dad = x->dad; + if (x->dad == NULL){ + *root = y; + }else{ + if(x == x->dad->right) + x->dad->right = y; + else + x->dad->left = y; + } + y->right = x; + x->dad = y; +} +//Rotao a direita +void leftRotate(RBnode** root,RBnode* x){ + RBnode* y = x->right; + x->right = y->left; + if(y->left != NULL) + y->left->dad = x; + y->dad = x->dad; + if(x->dad == NULL) + *root = y; + else{ + if(x == x->dad->left) + x->dad->left = y; + else + x->dad->right = y; + } + y->left = x; + x->dad = y; +} + +//color 1-red 0-black +void fix_insert(RBnode **root, RBnode *node){ + RBnode* z = node; + while((*root != z) && (z->dad->color==1)){ + if(z->dad == z->dad->dad->left){ + RBnode* y = z->dad->dad->right; + /*Caso 1: Um n x est sendo inserido, e seu tio + vermelho ento necessrio recolorir o pai, o tio + o av*/ + if((y!=NULL) && (y->color == 1)){ + z->dad->color = 0; + y->color = 0; + z->dad->dad->color = 1; + z = z->dad->dad; + }else{ + if(z == z->dad->right){ + /*Caso 2:irmo preto e pai vermelho*/ + z = z->dad; + leftRotate(&*root,z); + } + /*Caso 3:pai vermelho, irmo preto, av preto*/ + z->dad->color = 0; + z->dad->dad->color = 1; + rightRotate(&*root,z->dad->dad); + } + }else{ + RBnode* y = z->dad->dad->left; + if((y!=NULL) && (y->color == 1)){ + /*caso 4*/ + z->dad->color = 0; + y->color = 0; + z->dad->dad->color = 1; + z = z->dad->dad; + }else{ + /*Caso 5:*/ + if(z == z->dad->left){ + z = z->dad; + rightRotate(&*root,z); + } + /*Caso 6:pai vermelho, av preto, tio preto*/ + z->dad->color = 0;//pai fica preto + z->dad->dad->color = 1;//av fica vermelho + leftRotate(&*root, z->dad->dad);//gera uma rotao a esquerda + } + } + } +} + +void RB_Insert(RBnode** root, Data* data){ + RBnode* y = NULL; + RBnode* x = *root; + while(x != NULL){ + y = x; + if(data->key < x->data->key) + x = x->left; + else + x = x->right; + } + RBnode* newnode = new RBnode[1]; + if(newnode != NULL){ + newnode->data = data; + newnode->color = 1; + newnode->left = NULL; + newnode->right = NULL; + newnode->dad = y; + } + if(y == NULL){ + *root = newnode; + }else{ + if(data->key < y->data->key) + y->left = newnode; + else + y->right = newnode; + } + fix_insert(&*root, newnode); + (*root)->color = 0; +} + +//Query +void RBQuery(RBnode* root,Data** aux,string str,int* passos){ + int value = valorString(str); + if(root != NULL){ + if(root->data->key == value){ + *aux = root->data; + }else if(value > root->data->key){ + RBQuery(root->right, &*aux, str, &*passos); + }else{ + RBQuery(root->left, &*aux, str, &*passos); + } + } + *passos = *passos+1; +} + +//Destruir +void RBDestroy(RBnode *t){ + if(t != NULL){ + RBDestroy(t->left); + RBDestroy(t->right); + t->data->linhas.clear(); + t->data->ocorrencias.clear(); + delete[]t->data; + delete[]t; + } +} diff --git a/data-structures/red-black-tree/RedBlack.h b/data-structures/red-black-tree/RedBlack.h new file mode 100644 index 00000000..d2743f54 --- /dev/null +++ b/data-structures/red-black-tree/RedBlack.h @@ -0,0 +1,14 @@ +#ifndef _REDBLACK_H_ +#define _REDBLACK_H_ +#include "structs.h" + + typedef struct _RBNode_{ + int color; + struct _data_ *data; + struct _RBNode_ *left, *right, *dad; + } RBnode; + + extern void RB_Insert(RBnode** root, Data* data); + extern void RBQuery(RBnode* root,Data** aux,string str,int* passos); + void RBDestroy(RBnode *t); +#endif From e0bfdd7fa9c5c502f205ba289eed0326eaa347ad Mon Sep 17 00:00:00 2001 From: bhanupsingh10 <32353670+bhanupsingh10@users.noreply.github.com> Date: Mon, 28 Oct 2019 20:54:54 +0530 Subject: [PATCH 206/285] Uploaded c++ file --- dynamic-programming/WordBreakProblem.cpp | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 dynamic-programming/WordBreakProblem.cpp diff --git a/dynamic-programming/WordBreakProblem.cpp b/dynamic-programming/WordBreakProblem.cpp new file mode 100644 index 00000000..fd2e8e46 --- /dev/null +++ b/dynamic-programming/WordBreakProblem.cpp @@ -0,0 +1,63 @@ +// A recursive program to test whether a given +// string can be segmented into space separated +// words in dictionary +#include +using namespace std; + +/* A utility function to check whether a word is +present in dictionary or not. An array of strings +is used for dictionary. Using array of strings for +dictionary is definitely not a good idea. We have +used for simplicity of the program*/ +int dictionaryContains(string word) +{ + string dictionary[] = {"mobile","samsung","sam","sung", + "man","mango","icecream","and", + "go","i","like","ice","cream"}; + int size = sizeof(dictionary)/sizeof(dictionary[0]); + for (int i = 0; i < size; i++) + if (dictionary[i].compare(word) == 0) + return true; + return false; +} + +// returns true if string can be segmented into space +// separated words, otherwise returns false +bool wordBreak(string str) +{ + int size = str.size(); + + // Base case + if (size == 0) return true; + + // Try all prefixes of lengths from 1 to size + for (int i=1; i<=size; i++) + { + // The parameter for dictionaryContains is + // str.substr(0, i) which is prefix (of input + // string) of length 'i'. We first check whether + // current prefix is in dictionary. Then we + // recursively check for remaining string + // str.substr(i, size-i) which is suffix of + // length size-i + if (dictionaryContains( str.substr(0, i) ) && + wordBreak( str.substr(i, size-i) )) + return true; + } + + // If we have tried all prefixes and + // none of them worked + return false; +} + +// Driver program to test above functions +int main() +{ + wordBreak("ilikesamsung")? cout <<"Yes\n": cout << "No\n"; + wordBreak("iiiiiiii")? cout <<"Yes\n": cout << "No\n"; + wordBreak("")? cout <<"Yes\n": cout << "No\n"; + wordBreak("ilikelikeimangoiii")? cout <<"Yes\n": cout << "No\n"; + wordBreak("samsungandmango")? cout <<"Yes\n": cout << "No\n"; + wordBreak("samsungandmangok")? cout <<"Yes\n": cout << "No\n"; + return 0; +} From 173b783cf32906a236841a76ec5588f490e8adf3 Mon Sep 17 00:00:00 2001 From: bhanupsingh10 <32353670+bhanupsingh10@users.noreply.github.com> Date: Tue, 29 Oct 2019 11:42:06 +0530 Subject: [PATCH 207/285] Added file --- sorting/Insertion_Sort.cpp | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sorting/Insertion_Sort.cpp diff --git a/sorting/Insertion_Sort.cpp b/sorting/Insertion_Sort.cpp new file mode 100644 index 00000000..c5a7cf15 --- /dev/null +++ b/sorting/Insertion_Sort.cpp @@ -0,0 +1,47 @@ +// C++ program for insertion sort +#include +using namespace std; + +/* Function to sort an array using insertion sort*/ +void insertionSort(int arr[], int n) +{ + int i, key, j; + for (i = 1; i < n; i++) + { + key = arr[i]; + j = i - 1; + + /* Move elements of arr[0..i-1], that are + greater than key, to one position ahead + of their current position */ + while (j >= 0 && arr[j] > key) + { + arr[j + 1] = arr[j]; + j = j - 1; + } + arr[j + 1] = key; + } +} + +// A utility function to print an array of size n +void printArray(int arr[], int n) +{ + int i; + for (i = 0; i < n; i++) + cout << arr[i] << " "; + cout << endl; +} + +/* Driver code */ +int main() +{ + int arr[] = { 12, 11, 13, 5, 6 }; + int n = sizeof(arr) / sizeof(arr[0]); + + insertionSort(arr, n); + printArray(arr, n); + + return 0; +} + +// This is code is contributed by rathbhupendra From 5ef4452d5baba8f524e4b31ac8f0ec7cd96eaa20 Mon Sep 17 00:00:00 2001 From: Vaibhav Jain Date: Tue, 29 Oct 2019 16:51:23 +0530 Subject: [PATCH 208/285] Added algorithm for Digit DP --- dynamic-programming/digit_dp.cpp | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 dynamic-programming/digit_dp.cpp diff --git a/dynamic-programming/digit_dp.cpp b/dynamic-programming/digit_dp.cpp new file mode 100644 index 00000000..326b2b6a --- /dev/null +++ b/dynamic-programming/digit_dp.cpp @@ -0,0 +1,64 @@ +#include "bits/stdc++.h" +using namespace std; + +long long dp[20][180][2]; + +long long getDigits(long long x, vector &digit) +{ + while (x) + { + digit.push_back(x%10); + x /= 10; + } +} + +long long digitSum(int idx, int sum, int tight, + vector &digit) +{ + if (idx == -1) + return sum; + + if (dp[idx][sum][tight] != -1 and tight != 1) + return dp[idx][sum][tight]; + + long long ret = 0; + + int k = (tight)? digit[idx] : 9; + + for (int i = 0; i <= k ; i++) + { + int newTight = (digit[idx] == i)? tight : 0; + + ret += digitSum(idx-1, sum+i, newTight, digit); + } + + if (!tight) + dp[idx][sum][tight] = ret; + + return ret; +} + +int rangeDigitSum(int a, int b) +{ + memset(dp, -1, sizeof(dp)); + + vector digitA; + getDigits(a-1, digitA); + + long long ans1 = digitSum(digitA.size()-1, 0, 1, digitA); + + vector digitB; + getDigits(b, digitB); + + long long ans2 = digitSum(digitB.size()-1, 0, 1, digitB); + + return (ans2 - ans1); +} + +int main() +{ + long long a = 123, b = 1024; + cout << "digit sum for given range : " + << rangeDigitSum(a, b) << endl; + return 0; +} From 5e01e6caa833d7e0469820e74834d7808f257579 Mon Sep 17 00:00:00 2001 From: Vaibhav Jain Date: Wed, 30 Oct 2019 22:07:37 +0530 Subject: [PATCH 209/285] Added Algorithm for subarrays with product less than k using DP --- .../subarrays_with_product_less_than_k.cpp | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dynamic-programming/subarrays_with_product_less_than_k.cpp diff --git a/dynamic-programming/subarrays_with_product_less_than_k.cpp b/dynamic-programming/subarrays_with_product_less_than_k.cpp new file mode 100644 index 00000000..56c205fb --- /dev/null +++ b/dynamic-programming/subarrays_with_product_less_than_k.cpp @@ -0,0 +1,42 @@ +// CPP program to find number of subarrays having +// product less than k. +#include +using namespace std; + +// Function to count numbers of such subsequences +// having product less than k. +int productSubSeqCount(vector &arr, int k) +{ + int n = arr.size(); + int dp[k + 1][n + 1]; + memset(dp, 0, sizeof(dp)); + + for (int i = 1; i <= k; i++) { + for (int j = 1; j <= n; j++) { + + // number of subsequence using j-1 terms + dp[i][j] = dp[i][j - 1]; + + // if arr[j-1] > i it will surely make product greater + // thus it won't contribute then + if (arr[j - 1] <= i && arr[j - 1] > 0) + + // number of subsequence using 1 to j-1 terms + // and j-th term + dp[i][j] += dp[i/arr[j-1]][j-1] + 1; + } + } + return dp[k][n]; +} + +// Driver code +int main() +{ + vector A; + A.push_back(1); + A.push_back(2); + A.push_back(3); + A.push_back(4); + int k = 10; + cout << productSubSeqCount(A, k) << endl; +} From 0a56630ed2aeb3da12719ff36146f866ac1467e4 Mon Sep 17 00:00:00 2001 From: himanshu2119 <57231557+himanshu2119@users.noreply.github.com> Date: Thu, 31 Oct 2019 23:10:38 +0530 Subject: [PATCH 210/285] Adding Interpolation search --- searches/interpolation_search.cpp | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 searches/interpolation_search.cpp diff --git a/searches/interpolation_search.cpp b/searches/interpolation_search.cpp new file mode 100644 index 00000000..3ef40b8a --- /dev/null +++ b/searches/interpolation_search.cpp @@ -0,0 +1,61 @@ +// C++ program to implement interpolation search +#include +using namespace std; + +// If x is present in arr[0..n-1], then returns +// index of it, else returns -1. +int interpolationSearch(int arr[], int n, int x) +{ + // Find indexes of two corners + int lo = 0, hi = (n - 1); + + // Since array is sorted, an element present + // in array must be in range defined by corner + while (lo <= hi && x >= arr[lo] && x <= arr[hi]) + { + if (lo == hi) + { + if (arr[lo] == x) return lo; + return -1; + } + // Probing the position with keeping + // uniform distribution in mind. + int pos = lo + (((double)(hi - lo) / + (arr[hi] - arr[lo])) * (x - arr[lo])); + + // Condition of target found + if (arr[pos] == x) + return pos; + + // If x is larger, x is in upper part + if (arr[pos] < x) + lo = pos + 1; + + // If x is smaller, x is in the lower part + else + hi = pos - 1; + } + return -1; +} + +// Driver Code +int main() +{ + // Array of items on which search will + // be conducted. + int arr[] = {10, 12, 13, 16, 18, 19, 20, 21, + 22, 23, 24, 33, 35, 42, 47}; + int n = sizeof(arr)/sizeof(arr[0]); + + int x = 18; // Element to be searched + int index = interpolationSearch(arr, n, x); + + // If element was found + if (index != -1) + cout << "Element found at index " << index; + else + cout << "Element not found."; + return 0; +} + +// This code is contributed by Mukul Singh. From fb5c1c8b896e51261e548e52a9001b6882e34a62 Mon Sep 17 00:00:00 2001 From: Anandha Krishnan Aji <45736365+anandhakrishnanaji@users.noreply.github.com> Date: Fri, 1 May 2020 19:33:21 +0530 Subject: [PATCH 211/285] Added BinaryExponentiation, nth Fibonacci number , kth Permutation --- math/binaryexponentiation.cpp | 21 ++++++++++++++++ math/binfib.cpp | 46 +++++++++++++++++++++++++++++++++++ math/kthpermutation.cpp | 30 +++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 math/binaryexponentiation.cpp create mode 100644 math/binfib.cpp create mode 100644 math/kthpermutation.cpp diff --git a/math/binaryexponentiation.cpp b/math/binaryexponentiation.cpp new file mode 100644 index 00000000..cc898ccf --- /dev/null +++ b/math/binaryexponentiation.cpp @@ -0,0 +1,21 @@ +#include +long long long long int bin(long long long long int a, long long long long int b, long long long long int c); +using namespace std; +long long int main(void) +{ + long long long long int a, n; + long long long long int c = 1000000007, d; + scanf("%lld %lld", &a, &n); + d = bin(a, n, c); + prlong long intf("%lld", d); +} +long long long long int bin(long long long long int a, long long long long int b, long long long long int c) +{ + if (b == 0) + return 1; + long long long long int res = (long long long long int)pow(bin(a, b / 2, c), 2) % c; + if (b % 2) + return ((a % c) * res * res) % c; + else + return res * res; +} \ No newline at end of file diff --git a/math/binfib.cpp b/math/binfib.cpp new file mode 100644 index 00000000..14879996 --- /dev/null +++ b/math/binfib.cpp @@ -0,0 +1,46 @@ +#include +void bin(long long int arr[][2],long long int brr[][2], long long int n); +void mul(long long int arr1[][2],long long int arr2[][2],long long int brr[][2]); +using namespace std; +int main(void) +{ + long long int b; + long long int mat[2][2]={{0,1},{1,1}},brr[2][2]; + scanf("%lld", &b); + bin(mat,brr,b); + long long int res=brr[1][0]; + printf("%lld\n", res); +} + +void bin(long long int arr[][2],long long int brr[][2],long long int b){ + long long int id[2][2]={{0,1},{1,1}}; + if(b==0){ + brr[0][0]=1; + brr[0][1]=0; + brr[1][0]=0; + brr[1][1]=1; + return; + } + bin(arr,brr,b/2); + mul(brr,brr,brr); + if(b%2) mul(id,brr,brr); +} + +void mul(long long int arr1[][2],long long int arr2[][2],long long int brr[][2]){ + long long int sum=0; + long long int trr[2][2]; + for(long long int i=0;i<2;i++){ + for(long long int j=0;j<2;j++){ + sum=0; + for(long long int k=0;k<2;k++){ + sum+=(arr1[i][k]*arr2[k][j]); + } + trr[i][j]=sum; + } + } + for(long long int i=0;i<2;i++){ + for(long long int j=0;j<2;j++){ + brr[i][j]=trr[i][j]; + } + } +} \ No newline at end of file diff --git a/math/kthpermutation.cpp b/math/kthpermutation.cpp new file mode 100644 index 00000000..6063723a --- /dev/null +++ b/math/kthpermutation.cpp @@ -0,0 +1,30 @@ +#include +#include +void shift(int arr[],int p[]); +void bin(int arr[],int res[],int b); +using namespace std; +int main(void){ + char arr[5]={'a','b','c','d','e'},rres[5]; + int p[5]={4,3,2,1,0},res[5],b=4; + bin(p,res,b); + for(int i=0;i<5;i++) rres[i]=arr[res[i]]; + for(int i=0;i<5;i++) printf("%c ",rres[i]); + printf("\n"); +} + +void bin(int arr[],int res[],int b){ + if(b==0) { + for(int i=0;i<5;i++) res[i]=arr[i]; + sort(res,res+5); + return; + } + bin(arr,res,b/2); + shift(res,res); + if(b%2) shift(arr,res); +} + +void shift(int arr[],int p[]){ + int brr[5]; + for(int i=0;i<5;i++) brr[i]=arr[p[i]]; + for(int i=0;i<5;i++) p[i]=brr[i]; +} \ No newline at end of file From 95f4dde2cee8593538cba171933abc962b2caf65 Mon Sep 17 00:00:00 2001 From: Himanshu Airan <62210670+Himanshu-77@users.noreply.github.com> Date: Mon, 18 May 2020 17:53:52 +0530 Subject: [PATCH 212/285] Create kruskal.cpp implementation of Kruskal Algorithm to find minimum spanning tree of a graph --- graphs/kruskal.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 graphs/kruskal.cpp diff --git a/graphs/kruskal.cpp b/graphs/kruskal.cpp new file mode 100644 index 00000000..fa885b5a --- /dev/null +++ b/graphs/kruskal.cpp @@ -0,0 +1,81 @@ +// +// The following is C++ implementation of Kruskal's algorithm +// on a graph. + +// Kruskal's Algorithm is used to find minimum spanning tree +// of a graph . +// Here 'Disjoint Sets' method is used for cycle detection. +// Disjoint sets are sets whose intersection is empty set +// if they don't have any common element + +// The All ▲lgorithms Project +// +// https://allalgorithms.com/graphs/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Himanshu Airan +// Github: @Himanshu-77 +// + + +#include +using namespace std; + +const int MAX = 1e4 + 5; +int id[MAX] ; + + +int root(int x) +{ + while(id[x] != x) + { + id[x] = id[id[x]]; + x = id[x]; + } + return x; +} + +int main() +{ + int nodes, edges, x, y, weight; + int cost, minimumCost=0 ; + pair > Graph[MAX]; + + // initially all elements are in different sets + for(int i = 0;i < MAX;++i) + id[i] = i; + + + // input number of nodes and edges in graph + cin >> nodes >> edges; + for(int i = 0;i < edges;++i) + { + cin >> x >> y >> weight; + Graph[i] = make_pair(weight, make_pair(x, y)); + } + + // Sort the edges in the ascending order of weights + sort(Graph, Graph + edges); + + // find weight of minimum spanning tree + for(int i = 0;i < edges;++i) + { + // Selecting edges one by one in increasing order from the beginning + x = Graph[i].second.first; + y = Graph[i].second.second; + cost = Graph[i].first; + // Check if the selected edge is creating a cycle or not + if(root(x) != root(y)) + { + minimumCost += cost; + + // join sets of both elements + id[root(x)] = id[root(y)]; + } + } + + + cout << "Cost of minimum spanning tree is : " + << minimumCost << endl; + return 0; +} From 95b90633048687558cdfea02d7de571ab03a41ee Mon Sep 17 00:00:00 2001 From: Himanshu Airan <62210670+Himanshu-77@users.noreply.github.com> Date: Mon, 18 May 2020 17:57:12 +0530 Subject: [PATCH 213/285] Update readme.md added kruskal in graph section --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index ccd0f222..4f2b67ef 100644 --- a/readme.md +++ b/readme.md @@ -96,6 +96,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http - [Floyd warshall](graphs/floyd_warshall.cpp) - [Prims adjacency list](graphs/prims_adjacency_list.cpp) - [Toposort](graphs/toposort.cpp) + - [Kruskal](graphs/kruskal.cpp) ## Math From a2d47e037a0beb1d2f88a442d63a06ee8af851a6 Mon Sep 17 00:00:00 2001 From: Sourabh <44573182+suah0205@users.noreply.github.com> Date: Wed, 10 Jun 2020 10:59:04 +0530 Subject: [PATCH 214/285] Create host.py --- host.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 host.py diff --git a/host.py b/host.py new file mode 100644 index 00000000..41c7de5b --- /dev/null +++ b/host.py @@ -0,0 +1,11 @@ +import tensorflow as tf +import argparse +import sys + +def dist(): + cluster=tf.train.ClusterSpec({"ps": ["172.28.0.2:2222"],"worker": ["172.28.0.2:2233"]}) + server = tf.train.Server(cluster, job_name="ps", task_index=0) + server.join() + +if __name__ == "_main_": + dist() From 4ed2827216c426e189810163aa26fa6e5698449e Mon Sep 17 00:00:00 2001 From: Sourabh <44573182+suah0205@users.noreply.github.com> Date: Wed, 10 Jun 2020 11:02:03 +0530 Subject: [PATCH 215/285] Create w1.py --- w1.py | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 w1.py diff --git a/w1.py b/w1.py new file mode 100644 index 00000000..ff1e5d7f --- /dev/null +++ b/w1.py @@ -0,0 +1,83 @@ +import tensorflow as tf +import horovod.tensorflow as hvd + +def solve(): + hvd.init() + gpus = tf.config.experimental.list_physical_devices('GPU') + for gpu in gpus: + tf.config.experimental.set_memory_growth(gpu, True) + if gpus: + tf.config.experimental.set_visible_devices(gpus[hvd.local_rank()], 'GPU') + + (mnist_images, mnist_labels), _ = \ + tf.keras.datasets.mnist.load_data(path='mnist-%d.npz' % hvd.rank()) + + dataset = tf.data.Dataset.from_tensor_slices( + (tf.cast(mnist_images[..., tf.newaxis] / 255.0, tf.float32), + tf.cast(mnist_labels, tf.int64)) + ) + dataset = dataset.repeat().shuffle(10000).batch(128) + + mnist_model = tf.keras.Sequential([ + tf.keras.layers.Conv2D(32, [3, 3], activation='relu'), + tf.keras.layers.Conv2D(64, [3, 3], activation='relu'), + tf.keras.layers.MaxPooling2D(pool_size=(2, 2)), + tf.keras.layers.Dropout(0.25), + tf.keras.layers.Flatten(), + tf.keras.layers.Dense(128, activation='relu'), + tf.keras.layers.Dropout(0.5), + tf.keras.layers.Dense(10, activation='softmax') + ]) + + loss = tf.losses.SparseCategoricalCrossentropy() + + # Horovod: adjust learning rate based on number of GPUs. + opt = tf.optimizers.Adam(0.001 * hvd.size()) + + checkpoint_dir = './checkpoints' + checkpoint = tf.train.Checkpoint(model=mnist_model, optimizer=opt) + + +def training_step(images, labels, first_batch): + with tf.GradientTape() as tape: + probs = mnist_model(images, training=True) + loss_value = loss(labels, probs) + + # Horovod: add Horovod Distributed GradientTape. + tape = hvd.DistributedGradientTape(tape) + + grads = tape.gradient(loss_value, mnist_model.trainable_variables) + opt.apply_gradients(zip(grads, mnist_model.trainable_variables)) + + # Horovod: broadcast initial variable states from rank 0 to all other processes. + # This is necessary to ensure consistent initialization of all workers when + # training is started with random weights or restored from a checkpoint. + # + # Note: broadcast should be done after the first gradient step to ensure optimizer + # initialization. + if first_batch: + hvd.broadcast_variables(mnist_model.variables, root_rank=0) + hvd.broadcast_variables(opt.variables(), root_rank=0) + + return loss_value + +def mnist_train(clustr,ser): + + print("This is worker’s job!!") + with tf.device(tf.train.replica_device_setter(worker_device = "/job:worker/task:%d" % 0,cluster = clstr)): + solve() + hooks = [tf.train.StopAtStepHook(last_step = 10000)] + with tf.train.MonitoredTrainingSession(master = srv.target,is_chief = True,checkpoint_dir = "/tmp/log_dir",hooks = hooks): + for batch, (images, labels) in enumerate(dataset.take(10000 // hvd.size())): + loss_value = training_step(images, labels, batch == 0) + if batch % 10 == 0 and hvd.local_rank() == 0: + print('Step #%d\tLoss: %.6f' % (batch, loss_value)) + +def dist(): + cluster=tf.train.ClusterSpec({"ps": ["172.28.0.2:2222"],"worker": ["172.28.0.2:2233"]}) + server = tf.train.Server(cluster, job_name="worker", task_index=1) + mnist_train(cluster, server) + +if __name__ == "_main_": + dist() + From cecf59a18c8d9f9395264794b9b031fc9ee4fac2 Mon Sep 17 00:00:00 2001 From: Chetan Pandey Date: Sat, 26 Sep 2020 23:17:30 +0530 Subject: [PATCH 216/285] Binary Search for floating point numbers --- searches/binary_search_float.cpp | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 searches/binary_search_float.cpp diff --git a/searches/binary_search_float.cpp b/searches/binary_search_float.cpp new file mode 100644 index 00000000..dffe6a35 --- /dev/null +++ b/searches/binary_search_float.cpp @@ -0,0 +1,48 @@ +#include +#define eps 1e-3 +using namespace std; + + + +int binary_search_float(double a[],int lo,int hi,double key) +{ + double res=-1; + while(hi>=lo) + { + int m = lo + (hi-lo) / 2; + if(a[m]-key >= eps){ + hi = m-1; + }else if(abs(a[m]-key) <= eps){ + res =m; + break; + }else{ + lo = m+1; + } + } + return res; +} + + +int main(){ + int n; + double key; + cout << "Enter size of array: "; + cin >> n; + cout << "Enter array elements: "; + double a[n]; + + for (int i = 0; i < n; ++i) + { + cin>>a[i]; + } + cout << "Enter search key: "; + cin>>key; + + double res = binary_search(a, 0, n-1, key); + + if(res > -1) + cout<< key << " found at index " << res << endl; + else + cout << key << " not found" << endl; + return 0; +} \ No newline at end of file From 4bda8c29b6a1c249d8065df36a7591b77e7b2e8a Mon Sep 17 00:00:00 2001 From: Chetan Pandey Date: Sat, 26 Sep 2020 23:20:56 +0530 Subject: [PATCH 217/285] Added binary Search for floating point numbers --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index ccd0f222..6a7b369c 100644 --- a/readme.md +++ b/readme.md @@ -125,6 +125,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http ## Searches - [Binary search](searches/binary_search.cpp) + - [Binary search for floating point](searches/binary_search_float.cpp) - [Exponential search](searches/exponential_search.cpp) - [Jump search](searches/jump_search.cpp) - [Linear search](searches/linear_search.cpp) From aec31f14f096c6535313ad346052d97e80fc650c Mon Sep 17 00:00:00 2001 From: ayerhs7 <62745351+ayerhs7@users.noreply.github.com> Date: Thu, 1 Oct 2020 17:00:57 +0530 Subject: [PATCH 218/285] Create Kruskal's.cpp --- graphs/Kruskal's.cpp | 131 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 graphs/Kruskal's.cpp diff --git a/graphs/Kruskal's.cpp b/graphs/Kruskal's.cpp new file mode 100644 index 00000000..3ebb1d5d --- /dev/null +++ b/graphs/Kruskal's.cpp @@ -0,0 +1,131 @@ +// C++ program for Kruskal's algorithm to find Minimum +// Spanning Tree of a given connected, undirected and +// weighted graph +#include +using namespace std; + +// Creating shortcut for an integer pair + + +// Structure to represent a graph +struct Graph +{ + int V, E; + vector< pair> > edges; + Graph(int V, int E) + { + this->V = V; + this->E = E; + } + // Utility function to add an edge + void addEdge(int u, int w, int v) + { + edges.push_back({w, {u, v}}); + } + int kruskalMST(); +}; + +// To represent Disjoint Sets +struct DisjointSets +{ + int *parent, *rnk; + int n; + + // Constructor. + DisjointSets(int n) + { + // Allocate memory + this->n = n; + parent = new int[n+1]; + rnk = new int[n+1]; + for (int i = 0; i <= n; i++) + { + rnk[i] = 0; + parent[i] = i; + } + } + int find(int u) + { + if (u != parent[u]) + parent[u] = find(parent[u]); + return parent[u]; + } + + // Union by rank + void merge(int x, int y) + { + x = find(x), y = find(y); + + /* Make tree with smaller height + a subtree of the other tree */ + if (rnk[x] > rnk[y]) + parent[y] = x; + else // If rnk[x] <= rnk[y] + parent[x] = y; + + if (rnk[x] == rnk[y]) + rnk[y]++; + } +}; + +/* Functions returns weight of the MST*/ + +int Graph::kruskalMST() +{ + int mst_wt = 0; // Initialize result + + // Sort edges in increasing order on basis of cost + sort(edges.begin(), edges.end()); + + // Create disjoint sets + DisjointSets ds(V); + + // Iterate through all sorted edges + vector< pair> >::iterator it; + for (it=edges.begin(); it!=edges.end(); it++) + { + int u = it->second.first; + int v = it->second.second; + + int set_u = ds.find(u); + int set_v = ds.find(v); + + // Check if the selected edge is creating + // a cycle or not (Cycle is created if u + // and v belong to same set) + if (set_u != set_v) + { + cout << u << " - " << v << endl; + mst_wt += it->first; + ds.merge(set_u, set_v); + } + } + + return mst_wt; +} + +// Driver program to test above functions +int main() +{ + /* Let us create above shown weighted + and unidrected graph */ + int V = 9, E = 14; + Graph g(V, E); + // making above shown graph + g.addEdge(0, 5, 1); + g.addEdge(0, 10, 3); + g.addEdge(1, 2, 2); + g.addEdge(1, 10, 5); + g.addEdge(1, 5, 4); + g.addEdge(2, 1, 3); + g.addEdge(2, 5, 4); + g.addEdge(2, 3, 0); + g.addEdge(4, 2, 5); + + cout << "Edges of MST are \n"; + int mst_wt = g.kruskalMST(); + + cout << "\nWeight of MST is " << mst_wt; + + return 0; +} From 216d2b067dc973d9a0c8148788d4f595731076a8 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Fri, 2 Oct 2020 02:09:53 -0400 Subject: [PATCH 219/285] refactofing! --- .editorconfig | 19 - .github/contributing.md | 138 +---- .github/issue-template.md | 1 + .github/issue_template.md | 21 - .github/pull-request-template.md | 6 + .github/pull_request_template.md | 23 - .gitignore | 7 - .travis.yml | 14 - .../artificial-intelligence}/togasat.cpp | 0 .../backtracking}/crossword_puzzle.cpp | 0 .../hashmaps/pairs_with_difference_k.cpp | 0 .../largest_rectangle_area.cpp | 0 .../linkedlist/linkedlist_adt.cpp | 0 .../linkedlist/linkedlist_adt.hpp | 0 .../queue/circular_buffer.cpp | 0 .../data-structures}/queue/queue.cpp | 0 .../data-structures}/stack/stack.cpp | 0 .../dynamic-programming}/coin_change.cpp | 0 .../dynamic-programming}/edit_distance.cpp | 0 .../dynamic-programming}/fibonacci_number.cpp | 0 .../dynamic-programming}/knapsack.cpp | 0 .../dynamic-programming}/lcs.cpp | 0 .../dynamic-programming}/lis.cpp | 0 .../dynamic-programming}/longest_path.cpp | 0 .../matrix_chain_multiplication.cpp | 0 .../dynamic-programming}/rod_cutting.cpp | 0 .../dynamic-programming}/ways_to_cover.cpp | 0 .../graphs}/bellman_ford.cpp | 0 {graphs => algorithms/graphs}/bfs.cpp | 0 .../graphs}/count_diconnected_components.cpp | 0 {graphs => algorithms/graphs}/dfs.cpp | 0 {graphs => algorithms/graphs}/dijkstra.cpp | 0 .../graphs}/dijkstra_list.cc | 0 .../graphs}/floyd_warshall.cpp | 0 .../graphs}/prims_adjacency_list.cpp | 0 {graphs => algorithms/graphs}/toposort.cpp | 0 .../math}/all_factors_of_a_numbe_r.cpp | 0 .../math}/armstrong_number.cpp | 0 {math => algorithms/math}/bshuffll.cpp | 0 {math => algorithms/math}/chefres.cpp | 0 {math => algorithms/math}/collatz.cpp | 0 {math => algorithms/math}/euclids_gcd.cpp | 0 {math => algorithms/math}/eulers_totient.cpp | 0 {math => algorithms/math}/factorial.cpp | 0 {math => algorithms/math}/factorial_loop.cpp | 0 {math => algorithms/math}/gcd_of_array.cpp | 0 {math => algorithms/math}/hoax_no.cpp | 0 {math => algorithms/math}/kadence.cpp | 0 {math => algorithms/math}/lcm_of_array.cpp | 0 {math => algorithms/math}/lucky_numbers.cpp | 0 {math => algorithms/math}/magic_square.cpp | 0 .../math}/modular_exponentiation.cpp | 0 .../math}/nth_fibonacci_using_goldenratio.cpp | 0 .../math}/pascals_triangle.cpp | 0 .../math}/sieve_of_eratosthenes.cpp | 0 .../math}/slicker_algorithm.cpp | 0 {math => algorithms/math}/sphenic_n_o.cpp | 0 {math => algorithms/math}/t_ermo_conv.cpp | 0 {scripts => algorithms/scripts}/format.js | 0 .../scripts}/generate-readme.js | 0 {scripts => algorithms/scripts}/package.json | 0 {scripts => algorithms/scripts}/validate.js | 0 .../searches}/binary_search.cpp | 0 .../searches}/exponential_search.cpp | 0 .../searches}/jump_search.cpp | 0 .../searches}/linear_search.cpp | 0 .../searches}/ternary_search.cpp | 0 {sorting => algorithms/sorting}/bogo_sort.cpp | 0 .../sorting}/bubble_sort.cpp | 0 .../sorting}/counting_sort.cpp | 0 .../sorting}/gnome_sort.cpp | 0 {sorting => algorithms/sorting}/heap_sort.cpp | 0 .../sorting}/heap_sort_without_vectors.cpp | 0 .../sorting}/insertion_sort.cpp | 0 .../sorting}/merge_sort.cpp | 0 .../sorting}/quick_sort.cpp | 0 .../sorting}/radix_sort.cpp | 0 {sorting => algorithms/sorting}/rank_sort.cpp | 0 .../sorting}/selection_sort.cpp | 0 .../sorting}/shaker_sort.cpp | 0 .../sorting}/shell_sort.cpp | 0 .../sorting}/sort_vector.cpp | 0 .../sorting}/stooge_sort.cpp | 0 {sorting => algorithms/sorting}/tree_sort.cpp | 0 .../strings}/anagram_check.cpp | 0 .../strings}/lexicographic_ranking.cpp | 0 .../strings}/longest_palindrome_subset.cpp | 0 .../strings}/naive_search.cpp | 0 .../strings}/permutations_of_string.cpp | 0 .../strings}/print_duplicate_string.cpp | 0 .../strings}/rabin_carp.cpp | 0 .../strings}/rabin_karp.cpp | 0 .../strings}/remove_adjacent_duplicates.cpp | 0 .../strings}/remove_duplicates.cpp | 0 .../strings}/reverse_string.cpp | 0 .../strings}/z_algorithm.cpp | 0 license | 4 +- readme.md | 580 ++++++++++++------ src/.gitkeep | 0 99 files changed, 409 insertions(+), 404 deletions(-) delete mode 100644 .editorconfig create mode 100644 .github/issue-template.md delete mode 100644 .github/issue_template.md create mode 100644 .github/pull-request-template.md delete mode 100644 .github/pull_request_template.md delete mode 100644 .gitignore delete mode 100644 .travis.yml rename {artificial-intelligence => algorithms/artificial-intelligence}/togasat.cpp (100%) rename {backtracking => algorithms/backtracking}/crossword_puzzle.cpp (100%) rename {data-structures => algorithms/data-structures}/hashmaps/pairs_with_difference_k.cpp (100%) rename {data-structures => algorithms/data-structures}/largest_rectangle_area.cpp (100%) rename {data-structures => algorithms/data-structures}/linkedlist/linkedlist_adt.cpp (100%) rename {data-structures => algorithms/data-structures}/linkedlist/linkedlist_adt.hpp (100%) rename {data-structures => algorithms/data-structures}/queue/circular_buffer.cpp (100%) rename {data-structures => algorithms/data-structures}/queue/queue.cpp (100%) rename {data-structures => algorithms/data-structures}/stack/stack.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/coin_change.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/edit_distance.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/fibonacci_number.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/knapsack.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/lcs.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/lis.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/longest_path.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/matrix_chain_multiplication.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/rod_cutting.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/ways_to_cover.cpp (100%) rename {graphs => algorithms/graphs}/bellman_ford.cpp (100%) rename {graphs => algorithms/graphs}/bfs.cpp (100%) rename {graphs => algorithms/graphs}/count_diconnected_components.cpp (100%) rename {graphs => algorithms/graphs}/dfs.cpp (100%) rename {graphs => algorithms/graphs}/dijkstra.cpp (100%) rename {graphs => algorithms/graphs}/dijkstra_list.cc (100%) rename {graphs => algorithms/graphs}/floyd_warshall.cpp (100%) rename {graphs => algorithms/graphs}/prims_adjacency_list.cpp (100%) rename {graphs => algorithms/graphs}/toposort.cpp (100%) rename {math => algorithms/math}/all_factors_of_a_numbe_r.cpp (100%) rename {math => algorithms/math}/armstrong_number.cpp (100%) rename {math => algorithms/math}/bshuffll.cpp (100%) rename {math => algorithms/math}/chefres.cpp (100%) rename {math => algorithms/math}/collatz.cpp (100%) rename {math => algorithms/math}/euclids_gcd.cpp (100%) rename {math => algorithms/math}/eulers_totient.cpp (100%) rename {math => algorithms/math}/factorial.cpp (100%) rename {math => algorithms/math}/factorial_loop.cpp (100%) rename {math => algorithms/math}/gcd_of_array.cpp (100%) rename {math => algorithms/math}/hoax_no.cpp (100%) rename {math => algorithms/math}/kadence.cpp (100%) rename {math => algorithms/math}/lcm_of_array.cpp (100%) rename {math => algorithms/math}/lucky_numbers.cpp (100%) rename {math => algorithms/math}/magic_square.cpp (100%) rename {math => algorithms/math}/modular_exponentiation.cpp (100%) rename {math => algorithms/math}/nth_fibonacci_using_goldenratio.cpp (100%) rename {math => algorithms/math}/pascals_triangle.cpp (100%) rename {math => algorithms/math}/sieve_of_eratosthenes.cpp (100%) rename {math => algorithms/math}/slicker_algorithm.cpp (100%) rename {math => algorithms/math}/sphenic_n_o.cpp (100%) rename {math => algorithms/math}/t_ermo_conv.cpp (100%) rename {scripts => algorithms/scripts}/format.js (100%) rename {scripts => algorithms/scripts}/generate-readme.js (100%) rename {scripts => algorithms/scripts}/package.json (100%) rename {scripts => algorithms/scripts}/validate.js (100%) rename {searches => algorithms/searches}/binary_search.cpp (100%) rename {searches => algorithms/searches}/exponential_search.cpp (100%) rename {searches => algorithms/searches}/jump_search.cpp (100%) rename {searches => algorithms/searches}/linear_search.cpp (100%) rename {searches => algorithms/searches}/ternary_search.cpp (100%) rename {sorting => algorithms/sorting}/bogo_sort.cpp (100%) rename {sorting => algorithms/sorting}/bubble_sort.cpp (100%) rename {sorting => algorithms/sorting}/counting_sort.cpp (100%) rename {sorting => algorithms/sorting}/gnome_sort.cpp (100%) rename {sorting => algorithms/sorting}/heap_sort.cpp (100%) rename {sorting => algorithms/sorting}/heap_sort_without_vectors.cpp (100%) rename {sorting => algorithms/sorting}/insertion_sort.cpp (100%) rename {sorting => algorithms/sorting}/merge_sort.cpp (100%) rename {sorting => algorithms/sorting}/quick_sort.cpp (100%) rename {sorting => algorithms/sorting}/radix_sort.cpp (100%) rename {sorting => algorithms/sorting}/rank_sort.cpp (100%) rename {sorting => algorithms/sorting}/selection_sort.cpp (100%) rename {sorting => algorithms/sorting}/shaker_sort.cpp (100%) rename {sorting => algorithms/sorting}/shell_sort.cpp (100%) rename {sorting => algorithms/sorting}/sort_vector.cpp (100%) rename {sorting => algorithms/sorting}/stooge_sort.cpp (100%) rename {sorting => algorithms/sorting}/tree_sort.cpp (100%) rename {strings => algorithms/strings}/anagram_check.cpp (100%) rename {strings => algorithms/strings}/lexicographic_ranking.cpp (100%) rename {strings => algorithms/strings}/longest_palindrome_subset.cpp (100%) rename {strings => algorithms/strings}/naive_search.cpp (100%) rename {strings => algorithms/strings}/permutations_of_string.cpp (100%) rename {strings => algorithms/strings}/print_duplicate_string.cpp (100%) rename {strings => algorithms/strings}/rabin_carp.cpp (100%) rename {strings => algorithms/strings}/rabin_karp.cpp (100%) rename {strings => algorithms/strings}/remove_adjacent_duplicates.cpp (100%) rename {strings => algorithms/strings}/remove_duplicates.cpp (100%) rename {strings => algorithms/strings}/reverse_string.cpp (100%) rename {strings => algorithms/strings}/z_algorithm.cpp (100%) create mode 100644 src/.gitkeep diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 3e4ba08e..00000000 --- a/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -# EditorConfig -# https://EditorConfig.org -# -# Build with init-editorconfig -# https://github.com/abranhe/init-editorconfig - -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.yml] -indent_style = space -indent_size = 2 diff --git a/.github/contributing.md b/.github/contributing.md index e75d9db6..01f66006 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -1,139 +1,3 @@ ## Contributing -> Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to abide by its terms. - -## See - -- [General Rules](#general-rules) -- [All ▲lgorithms Structure](#all-lgorithms-structure) -- [Adding new algorithms](#adding-new-algorithms) -- [Style](#style) -- [Adding Documentation](#adding-documentation) -- [Run it online](#run-it-online) - -### General Rules - -- As much as possible, try to follow the existing format of markdown and code. - -### All ▲lgorithms Structure - -> We follow this structure - -- Directories and files are all in lower case letter. -- Directories are separated by a minus or hyphen (`-`) following `kebeab-case` style. In libraries this may change to follow the standards of the programming language -- Files are separated by an underscore (`_`) following the `snake_case` style. This could change to follow style standards on some languages like Java where we are using `CamelCase` style. - -``` -├── sorting -│ │── merge_sort.cpp -│ └── insertion_sort.cpp -├── searches -│ │── binary_search.cpp -│ └── linear_search.cpp -└── math - ├── third-algorithm.cpp - └── fourth_algorithm.cpp -``` - -### Adding new algorithms - -- Make your pull requests to be **specific** and **focused**. Instead of contributing "several algorithms" all at once contribute them all one by one separately (i.e. one pull request for "Binary Search", another one -for "Bubble Sort" and so on). -- Describe what you do in code using **comments**. - -### Style - -We are following the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), make sure you use it in your algorithms implementations. - -If you are lazy to read the Google C++ Style Guide, we already tough about you. You must use the [Tutorial Point Formatter](https://www.tutorialspoint.com/online_c_formatter.htm). **This is only to help you get started, you should double check it again**. See the below example: - -##### Important - -Use: - -```c++ -if() -{ -} -``` - -Instead of: - -```c++ -if() { -} -``` - -Each `.cpp` file should have the following header - -```cpp -// -// Binary search works for a sorted array. -// More documentation about the algorithm -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Carlos Abraham Hernandez -// Github: @abranhe -// -#include -``` - -If the algorithm is modified, this should be included there also. - -```cpp -// https://github.com/allalgorithms/cpp -// -// Contributed by: Carlos Abraham Hernandez -// Github: @abranhe -// -// Modified by: Your Name -// Github: @yourgithubusername -// -``` - -If the algorithm have been modified by multiple contributors, that should be included as follow. - -```cpp -// https://github.com/allalgorithms/cpp -// -// Contributed by: Carlos Abraham Hernandez -// Github: @abranhe -// -// Modifiers: -// Your Name, @yourgithubusername -// Your friend's name, @yourfriendongithub -// -... -``` - -C style should be on the [C repository](https://github.com/allalgorithms/c) so: - -```cpp -#include -``` - -Should not be included, use instead - -```cpp -#include -``` - -### Adding Documentation - -Please make sure if you add an algorithm, you also add the required documentation for it on [github.com/abranhe/algorithms](https://github.com/abranhe/algorithms), following the [template](https://github.com/abranhe/algorithms/blob/master/.github/category-template/algorithm-template/readme.md). - - -### Run it online - -On the documentation make sure you add a run it online [Repl.it](https://repl.it/). - -If you are modifying an algorithm make sure you add a benchmark using [Repl.it](https://repl.it/). - - -#### Lastly and not less important: - -Make sure you start ⭐️ and follow [@abranhe](https://github.com/abranhe) +> Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to abide by its terms. \ No newline at end of file diff --git a/.github/issue-template.md b/.github/issue-template.md new file mode 100644 index 00000000..99764fe7 --- /dev/null +++ b/.github/issue-template.md @@ -0,0 +1 @@ +I am creating an issue because... diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 9bfede26..00000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,21 +0,0 @@ - - -This issue is: - - - -- [ ] A new Algorithm -- [ ] An update to an existing algorithm. -- [ ] An error found -- [ ] A proposal -- [ ] A question -- [ ] Other (Describe below*) - -**Description:** - - diff --git a/.github/pull-request-template.md b/.github/pull-request-template.md new file mode 100644 index 00000000..3bc0935e --- /dev/null +++ b/.github/pull-request-template.md @@ -0,0 +1,6 @@ +I am creating a pull request for... + +- [ ] New algorithm +- [ ] Update to an algorithm +- [ ] Fix an error +- [ ] Other - *Describe below* \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index b85077b8..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,23 +0,0 @@ - - -This pull request is: - - - -- [ ] A new Algorithm -- [ ] An update to an existing algorithm. -- [ ] An error fix -- [ ] Other (Describe below*) - -This pull request fixes: - - - -**Changes:** - - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6253c156..00000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -DS_Store -*.o - -/scripts/node_modules -/scripts/yarn.lock -/scripts/package-lock.json -.vscode/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 611581ad..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - "9" - -before_script: - - npm version - - cd scripts/ - - npm install - -script: - - npm run validate - -notifications: - email: false diff --git a/artificial-intelligence/togasat.cpp b/algorithms/artificial-intelligence/togasat.cpp similarity index 100% rename from artificial-intelligence/togasat.cpp rename to algorithms/artificial-intelligence/togasat.cpp diff --git a/backtracking/crossword_puzzle.cpp b/algorithms/backtracking/crossword_puzzle.cpp similarity index 100% rename from backtracking/crossword_puzzle.cpp rename to algorithms/backtracking/crossword_puzzle.cpp diff --git a/data-structures/hashmaps/pairs_with_difference_k.cpp b/algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp similarity index 100% rename from data-structures/hashmaps/pairs_with_difference_k.cpp rename to algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp diff --git a/data-structures/largest_rectangle_area.cpp b/algorithms/data-structures/largest_rectangle_area.cpp similarity index 100% rename from data-structures/largest_rectangle_area.cpp rename to algorithms/data-structures/largest_rectangle_area.cpp diff --git a/data-structures/linkedlist/linkedlist_adt.cpp b/algorithms/data-structures/linkedlist/linkedlist_adt.cpp similarity index 100% rename from data-structures/linkedlist/linkedlist_adt.cpp rename to algorithms/data-structures/linkedlist/linkedlist_adt.cpp diff --git a/data-structures/linkedlist/linkedlist_adt.hpp b/algorithms/data-structures/linkedlist/linkedlist_adt.hpp similarity index 100% rename from data-structures/linkedlist/linkedlist_adt.hpp rename to algorithms/data-structures/linkedlist/linkedlist_adt.hpp diff --git a/data-structures/queue/circular_buffer.cpp b/algorithms/data-structures/queue/circular_buffer.cpp similarity index 100% rename from data-structures/queue/circular_buffer.cpp rename to algorithms/data-structures/queue/circular_buffer.cpp diff --git a/data-structures/queue/queue.cpp b/algorithms/data-structures/queue/queue.cpp similarity index 100% rename from data-structures/queue/queue.cpp rename to algorithms/data-structures/queue/queue.cpp diff --git a/data-structures/stack/stack.cpp b/algorithms/data-structures/stack/stack.cpp similarity index 100% rename from data-structures/stack/stack.cpp rename to algorithms/data-structures/stack/stack.cpp diff --git a/dynamic-programming/coin_change.cpp b/algorithms/dynamic-programming/coin_change.cpp similarity index 100% rename from dynamic-programming/coin_change.cpp rename to algorithms/dynamic-programming/coin_change.cpp diff --git a/dynamic-programming/edit_distance.cpp b/algorithms/dynamic-programming/edit_distance.cpp similarity index 100% rename from dynamic-programming/edit_distance.cpp rename to algorithms/dynamic-programming/edit_distance.cpp diff --git a/dynamic-programming/fibonacci_number.cpp b/algorithms/dynamic-programming/fibonacci_number.cpp similarity index 100% rename from dynamic-programming/fibonacci_number.cpp rename to algorithms/dynamic-programming/fibonacci_number.cpp diff --git a/dynamic-programming/knapsack.cpp b/algorithms/dynamic-programming/knapsack.cpp similarity index 100% rename from dynamic-programming/knapsack.cpp rename to algorithms/dynamic-programming/knapsack.cpp diff --git a/dynamic-programming/lcs.cpp b/algorithms/dynamic-programming/lcs.cpp similarity index 100% rename from dynamic-programming/lcs.cpp rename to algorithms/dynamic-programming/lcs.cpp diff --git a/dynamic-programming/lis.cpp b/algorithms/dynamic-programming/lis.cpp similarity index 100% rename from dynamic-programming/lis.cpp rename to algorithms/dynamic-programming/lis.cpp diff --git a/dynamic-programming/longest_path.cpp b/algorithms/dynamic-programming/longest_path.cpp similarity index 100% rename from dynamic-programming/longest_path.cpp rename to algorithms/dynamic-programming/longest_path.cpp diff --git a/dynamic-programming/matrix_chain_multiplication.cpp b/algorithms/dynamic-programming/matrix_chain_multiplication.cpp similarity index 100% rename from dynamic-programming/matrix_chain_multiplication.cpp rename to algorithms/dynamic-programming/matrix_chain_multiplication.cpp diff --git a/dynamic-programming/rod_cutting.cpp b/algorithms/dynamic-programming/rod_cutting.cpp similarity index 100% rename from dynamic-programming/rod_cutting.cpp rename to algorithms/dynamic-programming/rod_cutting.cpp diff --git a/dynamic-programming/ways_to_cover.cpp b/algorithms/dynamic-programming/ways_to_cover.cpp similarity index 100% rename from dynamic-programming/ways_to_cover.cpp rename to algorithms/dynamic-programming/ways_to_cover.cpp diff --git a/graphs/bellman_ford.cpp b/algorithms/graphs/bellman_ford.cpp similarity index 100% rename from graphs/bellman_ford.cpp rename to algorithms/graphs/bellman_ford.cpp diff --git a/graphs/bfs.cpp b/algorithms/graphs/bfs.cpp similarity index 100% rename from graphs/bfs.cpp rename to algorithms/graphs/bfs.cpp diff --git a/graphs/count_diconnected_components.cpp b/algorithms/graphs/count_diconnected_components.cpp similarity index 100% rename from graphs/count_diconnected_components.cpp rename to algorithms/graphs/count_diconnected_components.cpp diff --git a/graphs/dfs.cpp b/algorithms/graphs/dfs.cpp similarity index 100% rename from graphs/dfs.cpp rename to algorithms/graphs/dfs.cpp diff --git a/graphs/dijkstra.cpp b/algorithms/graphs/dijkstra.cpp similarity index 100% rename from graphs/dijkstra.cpp rename to algorithms/graphs/dijkstra.cpp diff --git a/graphs/dijkstra_list.cc b/algorithms/graphs/dijkstra_list.cc similarity index 100% rename from graphs/dijkstra_list.cc rename to algorithms/graphs/dijkstra_list.cc diff --git a/graphs/floyd_warshall.cpp b/algorithms/graphs/floyd_warshall.cpp similarity index 100% rename from graphs/floyd_warshall.cpp rename to algorithms/graphs/floyd_warshall.cpp diff --git a/graphs/prims_adjacency_list.cpp b/algorithms/graphs/prims_adjacency_list.cpp similarity index 100% rename from graphs/prims_adjacency_list.cpp rename to algorithms/graphs/prims_adjacency_list.cpp diff --git a/graphs/toposort.cpp b/algorithms/graphs/toposort.cpp similarity index 100% rename from graphs/toposort.cpp rename to algorithms/graphs/toposort.cpp diff --git a/math/all_factors_of_a_numbe_r.cpp b/algorithms/math/all_factors_of_a_numbe_r.cpp similarity index 100% rename from math/all_factors_of_a_numbe_r.cpp rename to algorithms/math/all_factors_of_a_numbe_r.cpp diff --git a/math/armstrong_number.cpp b/algorithms/math/armstrong_number.cpp similarity index 100% rename from math/armstrong_number.cpp rename to algorithms/math/armstrong_number.cpp diff --git a/math/bshuffll.cpp b/algorithms/math/bshuffll.cpp similarity index 100% rename from math/bshuffll.cpp rename to algorithms/math/bshuffll.cpp diff --git a/math/chefres.cpp b/algorithms/math/chefres.cpp similarity index 100% rename from math/chefres.cpp rename to algorithms/math/chefres.cpp diff --git a/math/collatz.cpp b/algorithms/math/collatz.cpp similarity index 100% rename from math/collatz.cpp rename to algorithms/math/collatz.cpp diff --git a/math/euclids_gcd.cpp b/algorithms/math/euclids_gcd.cpp similarity index 100% rename from math/euclids_gcd.cpp rename to algorithms/math/euclids_gcd.cpp diff --git a/math/eulers_totient.cpp b/algorithms/math/eulers_totient.cpp similarity index 100% rename from math/eulers_totient.cpp rename to algorithms/math/eulers_totient.cpp diff --git a/math/factorial.cpp b/algorithms/math/factorial.cpp similarity index 100% rename from math/factorial.cpp rename to algorithms/math/factorial.cpp diff --git a/math/factorial_loop.cpp b/algorithms/math/factorial_loop.cpp similarity index 100% rename from math/factorial_loop.cpp rename to algorithms/math/factorial_loop.cpp diff --git a/math/gcd_of_array.cpp b/algorithms/math/gcd_of_array.cpp similarity index 100% rename from math/gcd_of_array.cpp rename to algorithms/math/gcd_of_array.cpp diff --git a/math/hoax_no.cpp b/algorithms/math/hoax_no.cpp similarity index 100% rename from math/hoax_no.cpp rename to algorithms/math/hoax_no.cpp diff --git a/math/kadence.cpp b/algorithms/math/kadence.cpp similarity index 100% rename from math/kadence.cpp rename to algorithms/math/kadence.cpp diff --git a/math/lcm_of_array.cpp b/algorithms/math/lcm_of_array.cpp similarity index 100% rename from math/lcm_of_array.cpp rename to algorithms/math/lcm_of_array.cpp diff --git a/math/lucky_numbers.cpp b/algorithms/math/lucky_numbers.cpp similarity index 100% rename from math/lucky_numbers.cpp rename to algorithms/math/lucky_numbers.cpp diff --git a/math/magic_square.cpp b/algorithms/math/magic_square.cpp similarity index 100% rename from math/magic_square.cpp rename to algorithms/math/magic_square.cpp diff --git a/math/modular_exponentiation.cpp b/algorithms/math/modular_exponentiation.cpp similarity index 100% rename from math/modular_exponentiation.cpp rename to algorithms/math/modular_exponentiation.cpp diff --git a/math/nth_fibonacci_using_goldenratio.cpp b/algorithms/math/nth_fibonacci_using_goldenratio.cpp similarity index 100% rename from math/nth_fibonacci_using_goldenratio.cpp rename to algorithms/math/nth_fibonacci_using_goldenratio.cpp diff --git a/math/pascals_triangle.cpp b/algorithms/math/pascals_triangle.cpp similarity index 100% rename from math/pascals_triangle.cpp rename to algorithms/math/pascals_triangle.cpp diff --git a/math/sieve_of_eratosthenes.cpp b/algorithms/math/sieve_of_eratosthenes.cpp similarity index 100% rename from math/sieve_of_eratosthenes.cpp rename to algorithms/math/sieve_of_eratosthenes.cpp diff --git a/math/slicker_algorithm.cpp b/algorithms/math/slicker_algorithm.cpp similarity index 100% rename from math/slicker_algorithm.cpp rename to algorithms/math/slicker_algorithm.cpp diff --git a/math/sphenic_n_o.cpp b/algorithms/math/sphenic_n_o.cpp similarity index 100% rename from math/sphenic_n_o.cpp rename to algorithms/math/sphenic_n_o.cpp diff --git a/math/t_ermo_conv.cpp b/algorithms/math/t_ermo_conv.cpp similarity index 100% rename from math/t_ermo_conv.cpp rename to algorithms/math/t_ermo_conv.cpp diff --git a/scripts/format.js b/algorithms/scripts/format.js similarity index 100% rename from scripts/format.js rename to algorithms/scripts/format.js diff --git a/scripts/generate-readme.js b/algorithms/scripts/generate-readme.js similarity index 100% rename from scripts/generate-readme.js rename to algorithms/scripts/generate-readme.js diff --git a/scripts/package.json b/algorithms/scripts/package.json similarity index 100% rename from scripts/package.json rename to algorithms/scripts/package.json diff --git a/scripts/validate.js b/algorithms/scripts/validate.js similarity index 100% rename from scripts/validate.js rename to algorithms/scripts/validate.js diff --git a/searches/binary_search.cpp b/algorithms/searches/binary_search.cpp similarity index 100% rename from searches/binary_search.cpp rename to algorithms/searches/binary_search.cpp diff --git a/searches/exponential_search.cpp b/algorithms/searches/exponential_search.cpp similarity index 100% rename from searches/exponential_search.cpp rename to algorithms/searches/exponential_search.cpp diff --git a/searches/jump_search.cpp b/algorithms/searches/jump_search.cpp similarity index 100% rename from searches/jump_search.cpp rename to algorithms/searches/jump_search.cpp diff --git a/searches/linear_search.cpp b/algorithms/searches/linear_search.cpp similarity index 100% rename from searches/linear_search.cpp rename to algorithms/searches/linear_search.cpp diff --git a/searches/ternary_search.cpp b/algorithms/searches/ternary_search.cpp similarity index 100% rename from searches/ternary_search.cpp rename to algorithms/searches/ternary_search.cpp diff --git a/sorting/bogo_sort.cpp b/algorithms/sorting/bogo_sort.cpp similarity index 100% rename from sorting/bogo_sort.cpp rename to algorithms/sorting/bogo_sort.cpp diff --git a/sorting/bubble_sort.cpp b/algorithms/sorting/bubble_sort.cpp similarity index 100% rename from sorting/bubble_sort.cpp rename to algorithms/sorting/bubble_sort.cpp diff --git a/sorting/counting_sort.cpp b/algorithms/sorting/counting_sort.cpp similarity index 100% rename from sorting/counting_sort.cpp rename to algorithms/sorting/counting_sort.cpp diff --git a/sorting/gnome_sort.cpp b/algorithms/sorting/gnome_sort.cpp similarity index 100% rename from sorting/gnome_sort.cpp rename to algorithms/sorting/gnome_sort.cpp diff --git a/sorting/heap_sort.cpp b/algorithms/sorting/heap_sort.cpp similarity index 100% rename from sorting/heap_sort.cpp rename to algorithms/sorting/heap_sort.cpp diff --git a/sorting/heap_sort_without_vectors.cpp b/algorithms/sorting/heap_sort_without_vectors.cpp similarity index 100% rename from sorting/heap_sort_without_vectors.cpp rename to algorithms/sorting/heap_sort_without_vectors.cpp diff --git a/sorting/insertion_sort.cpp b/algorithms/sorting/insertion_sort.cpp similarity index 100% rename from sorting/insertion_sort.cpp rename to algorithms/sorting/insertion_sort.cpp diff --git a/sorting/merge_sort.cpp b/algorithms/sorting/merge_sort.cpp similarity index 100% rename from sorting/merge_sort.cpp rename to algorithms/sorting/merge_sort.cpp diff --git a/sorting/quick_sort.cpp b/algorithms/sorting/quick_sort.cpp similarity index 100% rename from sorting/quick_sort.cpp rename to algorithms/sorting/quick_sort.cpp diff --git a/sorting/radix_sort.cpp b/algorithms/sorting/radix_sort.cpp similarity index 100% rename from sorting/radix_sort.cpp rename to algorithms/sorting/radix_sort.cpp diff --git a/sorting/rank_sort.cpp b/algorithms/sorting/rank_sort.cpp similarity index 100% rename from sorting/rank_sort.cpp rename to algorithms/sorting/rank_sort.cpp diff --git a/sorting/selection_sort.cpp b/algorithms/sorting/selection_sort.cpp similarity index 100% rename from sorting/selection_sort.cpp rename to algorithms/sorting/selection_sort.cpp diff --git a/sorting/shaker_sort.cpp b/algorithms/sorting/shaker_sort.cpp similarity index 100% rename from sorting/shaker_sort.cpp rename to algorithms/sorting/shaker_sort.cpp diff --git a/sorting/shell_sort.cpp b/algorithms/sorting/shell_sort.cpp similarity index 100% rename from sorting/shell_sort.cpp rename to algorithms/sorting/shell_sort.cpp diff --git a/sorting/sort_vector.cpp b/algorithms/sorting/sort_vector.cpp similarity index 100% rename from sorting/sort_vector.cpp rename to algorithms/sorting/sort_vector.cpp diff --git a/sorting/stooge_sort.cpp b/algorithms/sorting/stooge_sort.cpp similarity index 100% rename from sorting/stooge_sort.cpp rename to algorithms/sorting/stooge_sort.cpp diff --git a/sorting/tree_sort.cpp b/algorithms/sorting/tree_sort.cpp similarity index 100% rename from sorting/tree_sort.cpp rename to algorithms/sorting/tree_sort.cpp diff --git a/strings/anagram_check.cpp b/algorithms/strings/anagram_check.cpp similarity index 100% rename from strings/anagram_check.cpp rename to algorithms/strings/anagram_check.cpp diff --git a/strings/lexicographic_ranking.cpp b/algorithms/strings/lexicographic_ranking.cpp similarity index 100% rename from strings/lexicographic_ranking.cpp rename to algorithms/strings/lexicographic_ranking.cpp diff --git a/strings/longest_palindrome_subset.cpp b/algorithms/strings/longest_palindrome_subset.cpp similarity index 100% rename from strings/longest_palindrome_subset.cpp rename to algorithms/strings/longest_palindrome_subset.cpp diff --git a/strings/naive_search.cpp b/algorithms/strings/naive_search.cpp similarity index 100% rename from strings/naive_search.cpp rename to algorithms/strings/naive_search.cpp diff --git a/strings/permutations_of_string.cpp b/algorithms/strings/permutations_of_string.cpp similarity index 100% rename from strings/permutations_of_string.cpp rename to algorithms/strings/permutations_of_string.cpp diff --git a/strings/print_duplicate_string.cpp b/algorithms/strings/print_duplicate_string.cpp similarity index 100% rename from strings/print_duplicate_string.cpp rename to algorithms/strings/print_duplicate_string.cpp diff --git a/strings/rabin_carp.cpp b/algorithms/strings/rabin_carp.cpp similarity index 100% rename from strings/rabin_carp.cpp rename to algorithms/strings/rabin_carp.cpp diff --git a/strings/rabin_karp.cpp b/algorithms/strings/rabin_karp.cpp similarity index 100% rename from strings/rabin_karp.cpp rename to algorithms/strings/rabin_karp.cpp diff --git a/strings/remove_adjacent_duplicates.cpp b/algorithms/strings/remove_adjacent_duplicates.cpp similarity index 100% rename from strings/remove_adjacent_duplicates.cpp rename to algorithms/strings/remove_adjacent_duplicates.cpp diff --git a/strings/remove_duplicates.cpp b/algorithms/strings/remove_duplicates.cpp similarity index 100% rename from strings/remove_duplicates.cpp rename to algorithms/strings/remove_duplicates.cpp diff --git a/strings/reverse_string.cpp b/algorithms/strings/reverse_string.cpp similarity index 100% rename from strings/reverse_string.cpp rename to algorithms/strings/reverse_string.cpp diff --git a/strings/z_algorithm.cpp b/algorithms/strings/z_algorithm.cpp similarity index 100% rename from strings/z_algorithm.cpp rename to algorithms/strings/z_algorithm.cpp diff --git a/license b/license index d7c82849..559a12bf 100644 --- a/license +++ b/license @@ -1,7 +1,7 @@ MIT License Copyright (c) 2018 All Algorithms and its contributors (allalgorithms.com) -Copyright (c) 2018 Abraham Hernandez (abranhe.com) +Copyright (c) 2018 Carlos Abraham (abranhe.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/readme.md b/readme.md index ccd0f222..dd64172d 100644 --- a/readme.md +++ b/readme.md @@ -1,198 +1,416 @@ +We are accepting all pull requests. [Read More](https://github.com/AllAlgorithms/algorithms/issues/40) + +
+
+
+
+
+ Algorithms Logo +
+
+
+
+
+
+ +

+ What is an algorithm?    + Contributing    + Stickers & T-Shirts +

+ + +

+ + Twitter +    + + Instagram +    + + Github +    +

- -
-
-
-
-
- -
-
-
-
-

- +

+ Huge collection of All ▲lgorithms implemented in multiple languages +


-
-

All ▲lgorithms implemented in C++

- - + + + - - -
-
-allalgorithms.com +
- - -## Contents - -You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) - - - [Artificial intelligence](#artificial-intelligence) - - [Backtracking](#backtracking) - - [Bit manipulation](#bit-manipulation) - - [Cellular automaton](#cellular-automaton) - - [Computational geometry](#computational-geometry) - - [Cryptography](#cryptography) - - [Data structures](#data-structures) - - [Divide and conquer](#divide-and-conquer) - - [Dynamic programming](#dynamic-programming) - - [Gaming theory](#gaming-theory) - - [Graphs](#graphs) - - [Greedy algorithms](#greedy-algorithms) - - [Math](#math) - - [Networking](#networking) - - [Numerical analysis](#numerical-analysis) - - [Online challenges](#online-challenges) - - [Randomized algorithms](#randomized-algorithms) - - [Serches](#serches) - - [Selections](#selections) - - [Sorting](#sorting) - - [Strings](#strings) - - [No category](#no-category) - -## Artificial intelligence - - - [Togasat](artificial-intelligence/togasat.cpp) - -## Backtracking - - - [Crossword puzzle](backtracking/crossword_puzzle.cpp) - -## Data structures - - - [Pairs with difference k](data-structures/hashmaps/pairs_with_difference_k.cpp) - - [Largest rectangle area](data-structures/largest_rectangle_area.cpp) - - [Linkedlist adt](data-structures/linkedlist/linkedlist_adt.cpp) - - [Circular buffer](data-structures/queue/circular_buffer.cpp) - - [Queue](data-structures/queue/queue.cpp) - - [Stack](data-structures/stack/stack.cpp) - -## Dynamic programming - - - [Coin change](dynamic-programming/coin_change.cpp) - - [Edit distance](dynamic-programming/edit_distance.cpp) - - [Fibonacci number](dynamic-programming/fibonacci_number.cpp) - - [Knapsack](dynamic-programming/knapsack.cpp) - - [Lcs](dynamic-programming/lcs.cpp) - - [Lis](dynamic-programming/lis.cpp) - - [Longest path](dynamic-programming/longest_path.cpp) - - [Matrix chain multiplication](dynamic-programming/matrix_chain_multiplication.cpp) - - [Rod cutting](dynamic-programming/rod_cutting.cpp) - - [Ways to cover](dynamic-programming/ways_to_cover.cpp) - -## Graphs - - - [Bellman ford](graphs/bellman_ford.cpp) - - [Bfs](graphs/bfs.cpp) - - [Count diconnected components](graphs/count_diconnected_components.cpp) - - [Dfs](graphs/dfs.cpp) - - [Dijkstra](graphs/dijkstra.cpp) - - [Floyd warshall](graphs/floyd_warshall.cpp) - - [Prims adjacency list](graphs/prims_adjacency_list.cpp) - - [Toposort](graphs/toposort.cpp) - -## Math - - - [All factors of a numbe r](math/all_factors_of_a_numbe_r.cpp) - - [Armstrong number](math/armstrong_number.cpp) - - [Bshuffll](math/bshuffll.cpp) - - [Chefres](math/chefres.cpp) - - [Collatz](math/collatz.cpp) - - [Euclids gcd](math/euclids_gcd.cpp) - - [Eulers totient](math/eulers_totient.cpp) - - [Factorial loop](math/factorial_loop.cpp) - - [Factorial](math/factorial.cpp) - - [Gcd of array](math/gcd_of_array.cpp) - - [Hoax no](math/hoax_no.cpp) - - [Kadence](math/kadence.cpp) - - [Lcm of array](math/lcm_of_array.cpp) - - [Lucky numbers](math/lucky_numbers.cpp) - - [Magic square](math/magic_square.cpp) - - [Modular exponentiation](math/modular_exponentiation.cpp) - - [Nth fibonacci using goldenratio](math/nth_fibonacci_using_goldenratio.cpp) - - [Pascals triangle](math/pascals_triangle.cpp) - - [Sieve of eratosthenes](math/sieve_of_eratosthenes.cpp) - - [Slicker algorithm](math/slicker_algorithm.cpp) - - [Sphenic n o](math/sphenic_n_o.cpp) - - [T ermo conv](math/t_ermo_conv.cpp) - -## Searches - - - [Binary search](searches/binary_search.cpp) - - [Exponential search](searches/exponential_search.cpp) - - [Jump search](searches/jump_search.cpp) - - [Linear search](searches/linear_search.cpp) - - [Ternary search](searches/ternary_search.cpp) - -## Sorting - - - [Bogo sort](sorting/bogo_sort.cpp) - - [Bubble sort](sorting/bubble_sort.cpp) - - [Counting sort](sorting/counting_sort.cpp) - - [Gnome sort](sorting/gnome_sort.cpp) - - [Heap sort without vectors](sorting/heap_sort_without_vectors.cpp) - - [Heap sort](sorting/heap_sort.cpp) - - [Insertion sort](sorting/insertion_sort.cpp) - - [Merge sort](sorting/merge_sort.cpp) - - [Quick sort](sorting/quick_sort.cpp) - - [Radix sort](sorting/radix_sort.cpp) - - [Rank sort](sorting/rank_sort.cpp) - - [Selection sort](sorting/selection_sort.cpp) - - [Shaker sort](sorting/shaker_sort.cpp) - - [Shell sort](sorting/shell_sort.cpp) - - [Sort vector](sorting/sort_vector.cpp) - - [Stooge sort](sorting/stooge_sort.cpp) - - [Tree sort](sorting/tree_sort.cpp) - -## Strings - - - [Anagram check](strings/anagram_check.cpp) - - [Lexicographic ranking](strings/lexicographic_ranking.cpp) - - [Longest palindrome subset](strings/longest_palindrome_subset.cpp) - - [Naive search](strings/naive_search.cpp) - - [Permutations of string](strings/permutations_of_string.cpp) - - [Print duplicate string](strings/print_duplicate_string.cpp) - - [Rabin carp](strings/rabin_carp.cpp) - - [Rabin karp](strings/rabin_karp.cpp) - - [Remove adjacent duplicates](strings/remove_adjacent_duplicates.cpp) - - [Remove duplicates](strings/remove_duplicates.cpp) - - [Reverse string](strings/reverse_string.cpp) - - [Z algorithm](strings/z_algorithm.cpp) - - - -## Maintainers - -|[![1][1-avatar]][1]|[![2][2-avatar]][2]| -| :-: | :-: | -| [Carlos Abraham][1] | [Christian Bender][2] | +## See + +- [What is an algorithm](#what-is-an-algorithm) +- [Contributing](https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md) +- [Code of Conduct](https://github.com/AllAlgorithms/algorithms/blob/master/.github/code-of-conduct.md) +- [Stickers and T-Shirts](https://www.redbubble.com/people/abranhe/works/34285088) +- [Twitter](https://twitter.com/AllAlgorithms) +- [Instagram](https://instagram.com/AllAlgorithms) +- [Algorithms Categories](#categories) +- [Maintainers](#maintainers) +- [License](#license) + + +## What is an algorithm? + +Informally, an algorithm is any well-defined computational procedure that takes +some value, or set of values, as input and produces some value, or set of values, as +output. An algorithm is thus a sequence of computational steps that transform the +input into the output. + +An algorithm should have three important characteristics to be considered valid: + +- **It should be finite**: If your algorithm never ends trying to solve the problem +it was designed to solve then it is useless +- **It should have well defined instructions**: Each step of the algorithm has to +be precisely defined; the instructions should be unambiguously specified for each case. +- **It should be effective**: The algorithm should solve the problem it was designed +to solve. And it should be possible to demonstrate that the algorithm converges with +just a paper and pencil. + +## Categories + +> Structure of The All ▲lgoritms project + +- [Artificial Intelligence](#artificial-intelligence) +- [Backtracking](#backtracking) +- [Bit Manipulation](#bit-manipulation) +- [Cellular Automaton](#cellular-automaton) +- [Ciphers](#ciphers) +- [Computational Geometry](#computational-geometry) +- [Cryptography](#cryptography) +- [Data Structures](#data-structures) +- [Divide and conquer](#divide-and-conquer) +- [Dynamic Programming](#dynamic-programming) +- [Gaming Theory](#gaming-theory) +- [Graphs](#graphs) +- [Greedy Algorithms](#greedy-algorithms) +- [Math](#math) +- [Networking](#networking) +- [Numerical Analysis](#numerical-analysis) +- [Operating system](#operating-system) +- [Randomized Algorithms](#randomized-algorithms) +- [Searches](#searches) +- [Selections Algorithms](#selections-algorithms) +- [Sorting](#sorting) +- [Strings](#strings) +- [Online Challenges](#online-challenges) +- [Others](#others) + +## [Artificial Intelligence](artificial-intelligence) + +- [Density-based spatial clustering of applications with noise (DBSCAN Clustering)](https://allalgorithms.com/docs/dbscan) +- [Interactive Self-Organizing Data Analysis Technique yAy! (ISODATA Clustering)](https://allalgorithms.com/docs/isodata) +- [Linear Regression](https://allalgorithms.com/docs/linear-regression) +- [Logistic Regression](https://allalgorithms.com/docs/logistic-regression) +- [Neutral Style Transfer](https://allalgorithms.com/docs/neutral-style-transfer) +- [SATisfiable (SAT)](https://allalgorithms.com/docs/sat) +- [Travelling salesman problem (TSP)](https://allalgorithms.com/docs/tsp) +- [A* (A Star)](https://allalgorithms.com/docs/a-star) +- [Artificial Neutral Network](https://allalgorithms.com/docs/artificial-neutral-network) +- [Convolutional Neutral Network](https://allalgorithms.com/docs/convolutional-neutral-network) +- [Decision Tree](https://allalgorithms.com/docs/decision-tree) +- [Factorization Machines](https://allalgorithms.com/docs/factorization-machines) +- [Gaussian Mixture Model](https://allalgorithms.com/docs/gaussian-mixtrue-model) +- [Gradient Boosting Trees](https://allalgorithms.com/docs/gradient-boostring-trees) +- [Hierachical Clustering](https://allalgorithms.com/docs/hierachical-clustering) +- [Image Processing](https://allalgorithms.com/docs/image-processing) +- [K Nearest Neighbors](https://allalgorithms.com/docs/k-nearest-neighbors) +- [K Means](https://allalgorithms.com/docs/k-means) +- [Minimax](https://allalgorithms.com/docs/minimax) +- [Native Bayes](https://allalgorithms.com/docs/native-bayes) +- [Nearest Sequence Memory](https://allalgorithms.com/docs/nearest-sequence-memory) +- [Neutral Network](https://allalgorithms.com/docs/neutral-network) +- [Perceptron](https://allalgorithms.com/docs/perceptron) +- [Principal Component Analysis](https://allalgorithms.com/docs/principal-component-analysis) +- [Q Learing](https://allalgorithms.com/docs/q-learning) +- [Random Forests](https://allalgorithms.com/docs/random-forest) +- [Restricted Boltzman Machine](https://allalgorithms.com/docs/restricted-boltzman-machine) + +## [Backtracking](backtracking) + +- [Algorithm X](backtracking/algorithm-x) +- [Crossword Puzzle](backtracking/crossword-Puzzle) +- [Knight Tour](backtracking/knight-tour) +- [M Coloring Problem](backtracking/m-coloring-problem) +- [N Queen](backtracking/n-queen) +- [Number of ways in Maze](backtracking/number-of-ways-in-maze) +- [Partitions of set](backtracking/partitions-of-set) +- [Permutation of Strings](backtracking/permutation-of-strings) +- [Powerset](backtracking/powerset) +- [Rat in maze](backtracking/rat-in-maze) +- [Subset Sum](backtracking/subset-sum) +- [Sudoku Solve](backtracking/sudoku-solve) + +## [Bit Manipulation](bit-manipulation) + +- [Addition using bits](bit-manipulation/adding-using-bits) +- [Bit divisor](bit-manipulation/bit-divisor) +- [Byte swapper](bit-manipulation/byte-swapper) +- [Convert numbers to binary](bit-manipulation/convert-numbers-to-binary) +- [Count set bits](bit-manipulation/count-set-bits) +- [Flip bits](bit-manipulation/flip-bits) +- [Hamming distance](bit-manipulation/hamming-distace) +- [Invert bit](bit-manipulation/invert-bit) +- [Lonely integer](bit-manipulation/lonely-integer) +- [Magic Number](bit-manipulation/magic-number) +- [Maximum XOR Value](bit-manipulation/maximun-xor-value) +- [Power of 2](bit-manipulation/power-of-2) +- [Subset Generation](bit-manipulation/subset-generation) +- [Sum binary numbers](bit-manipulation/sum-binary-numbers) +- [Sum equals XOR](bit-manipulation/sum-equals-xor) +- [Thrice unique number](bit-manipulation/thrice-unique-number) +- [Twice unique number](bit-manipulation/twice-unique-number) +- [XOR Swap](bit-manipulation/xor-swap) + +## [Cellular Automaton](cellular-automaton) + +- [Brians Brain](cellular-automaton/brians-brain) +- [Conways Game of life](cellular-automaton/conways-game-of-life) +- [Elementary Cellular Automata](cellular-automaton/elementary-cellular-automata) +- [Generic Algorithm](cellular-automaton/generic-algorithm) +- [Langtons Ant](cellular-automaton/langtons-ant) +- [Nobili Cellular Automata](cellular-automaton/nobili-cellular-automata) +- [Von Neoumann Cellular Automata](cellular-automaton/von-neoumann-cellular-automata) + +## [Computational Geometry](computational-geometry) + +- [2D Line intersection](computational-geometry/) +- [2D Separating Axis test](computational-geometry/) +- [Area of polygon](computational-geometry/) +- [Area of triangle](computational-geometry/) +- [Axis aligned bounding box collision](computational-geometry/) +- [Bresenham Line](computational-geometry/) +- [Chans Algorithm](computational-geometry/) +- [Cohen Sutherland Lineclip](computational-geometry/) +- [Distance between points](computational-geometry/) +- [Graham Scan](computational-geometry/) +- [Halfplane intersection](computational-geometry/) +- [Jarvis March](computational-geometry/) +- [Quickull](computational-geometry/) +- [Sphere tetrahedron intersection](computational-geometry/) +- [Sutherland Hodgeman clipping](computational-geometry/) + +## [Cryptography](cryptography) + +- [Affine Cipher](cryptography/) +- [Atbash Cipher](cryptography/) +- [Autokey Cipher](cryptography/) +- [Baconian Cipher](cryptography/) +- [Caesar Cipher](cryptography/) +- [Colummnar Cipher](cryptography/) +- [Vigenere Cipher](cryptography/) + +## [Data Structures](data-structures) + +- [Bag](data-structures/bag/) +- [Hashes](data-structures/hashes/) +- [Linked List](data-structures/linked-list/) +- [List](data-structures/list/) +- [Queue](data-structures/queue/) +- [Stack](data-structures/stack/) +- [Tree](data-structures/tree/) + +## [Divide and conquer](divide-and-conquer) + +- [Strassen Matrix Manipulation](divide-and-conquer/) +- [Closest Pair of Point](divide-and-conquer/) +- [Inversion Count](divide-and-conquer/) +- [Karatsuba Multiplication](divide-and-conquer/) +- [Maximum Contiguous subsequence sum](divide-and-conquer/) +- [Merge Sort using divide and conquer](divide-and-conquer/) +- [Quick Sort using divide and conquer](divide-and-conquer/) +- [Tournament Method to find min max](divide-and-conquer/) +- [Warnock Algorithm](divide-and-conquer/) +- [X Power Y](divide-and-conquer/) + +## [Dynamic Programming](dynamic-programming) + +- [Array Median](dynamic-programming) +- [Optima Binary Search Tree](dynamic-programming) +- [Binomial Coefficient](dynamic-programming) + +## [Gaming Theory](gaming-theory) + +- [Nim Next Best Move Game](gaming-theory/) +- [Nim Win Loss Game](gaming-theory/) +- [Grundy Numbers Kayle Game](gaming-theory/) + +## [Graphs](graphs) + +- [Bipartite Check](graphs/) +- [Adjacency Lists graphs representation](graphs/) +- [A* (A Star)](https://allalgorithms.com/docs/a-star) + +## [Greedy Algorithms](greedy-algorithms) + +- [Activity Selection](greedy-algorithms) +- [Dijkstra Shortest Path](greedy-algorithms) +- [Egyptian Fraction](greedy-algorithms) + +## [Math](math) + +- [2 Sum](math/) +- [Add Polynomials](math/) +- [Amicable Numbers](math/) +- [Armstrong Numbers](math/) +- [Automorphic Numbers](math/) +- [Average Stream Numbers](math/) +- [Babylonian Method](math/) +- [Binomial Coefficient](math/) +- [Catalan Number](math/) +- [Check is Square](math/) +- [Convolution](math/) +- [Coprime Numbers](math/) +- [Count Digits](math/) +- [Count Trailing Zeroes](math/) +- [Decoding of String](math/) +- [Delannoy Number](math/) +- [Derangements](math/) +- [DFA Division](math/) +- [Diophantine](math/) +- [Divided Differences](math/) +- [Euler Totient](math/) +- [Exponentiation Power](math/) +- [Factorial](math/factorial) +- [Fast Fourier transform](math/) +- [Fast inverse (sqrt) Square Root](math/) + +## [Networking](networking) + +- [Packet Sniffer](networking/) +- [Determine Endianess](networking/) +- [Validate IP](networking/) + +## [Numerical Analysis](numerical-analysis) + +- [Integral](numerical-analysis/integral) +- [Monte Carlo](numerical-analysis/monte-carlo) +- [Runge Kutt](numerical-analysis/runge-kutt) + +## [Operating system](operating-system) + +- [Currency](operating-system/) +- [Deadlocks](operating-system/) +- [Memory Management](operating-system/) +- [Scheduling](operating-system/) +- [Shell](operating-system/) + +## [Randomized Algorithms](randomized-algorithms) + +- [Birthday Paradox](randomized-algorithms) +- [Karger Minimum Cut Algorithm](randomized-algorithms) +- [Kth Smallest Element Algorithm](randomized-algorithms) +- [Random from Stream](randomized-algorithms) +- [Random Node Linked list](randomized-algorithms) +- [Randomized Quicksort](randomized-algorithms) +- [Reservoir Sampling](randomized-algorithms) +- [Shuffle an Array](randomized-algorithms) + +## [Searches](searches) + +- [Binary Search](searches) +- [Exponential Search](searches) +- [Fibonacci Search](searches) +- [Fuzzy Search](searches) +- [Interpolation Search](searches) +- [Jump Search](searches) +- [Linear Search](searches) +- [Ternay Search](searches) + +## [Selections Algorithms](selections-algorithms) + +- [Median of Medians](selections-algorithms) +- [Quick Select](selections-algorithms) + +## [Sorting](sorting) + +- [Bead Sort](sorting/) +- [Bogo Sort](sorting/) +- [Bubble Sort](sorting/) +- [Bucket Sort](sorting/) +- [Circle Sort](sorting/) +- [Comb Sort](sorting/) +- [Counting Sort](sorting/) +- [Cycle Sort](sorting/) +- [Flash Sort](sorting/) +- [Gnome Sort](sorting/) +- [Heap Sort](sorting/) +- [Insertion Sort](sorting/) +- [Intro Sort](sorting/) +- [Median Sort](sorting/) +- [Merge Sort](sorting/) +- [Pipeonhole Sort](sorting/) +- [Quick Sort](sorting/) +- [Radix Sort](sorting/) +- [Selection Sort](sorting/) +- [Shaker Sort](sorting/) +- [Shell Sort](sorting/) +- [Sleep Sort](sorting/) +- [Stooge Sort](sorting/) +- [Topological Sort](sorting/) +- [Tree Sort](sorting/) + +## [Strings](strings) + +- [Aho Corasick Algorithm](strings) +- [Anagram Search](strings) +- [Arithmetic on large numbers](strings) +- [Boyer Moore Algorithm](strings) +- [Finite Automata](strings) +- [Kasai Algorithm](strings) +- [Kmp Algorithm](strings) +- [Levenshteing Distance](strings) +- [Lipogram Checker](strings) + +## [Online Challenges](online-challenges) + +- [Coderbyte](online-challenges/coderbyte) +- [Code Chef](online-challenges/code-chef) +- [Code Eval](online-challenges/code-eval) +- [Hackerearth](online-challenges/hackerearth) +- [Hackerrank](online-challenges/hackerrank) +- [LeetCode](online-challenges/leetcode) +- [Project Euler](online-challenges/project-euler) +- [Rosalind](online-challenges/rosalind) +- [SPOJ](online-challenges/spoj) +- [Top Coder](online-challenges/top-coder)` + +## [Others](others) + +- [Average](others/) +- [Biggest of n numbers](others/) +- [Biggest Suffix](others/) +- [Fifteen Puzzle](others/) +- [Jaccard Similarity](others/) +- [Jose Phus Problem](others/) +- [Lapindrom Checker](others/) +- [Leap Year](others/) +- [Magic Square](others/) +- [Majority Element](others/) +- [Minimum subarray size with degree](others/) +- [No operator addition](others/) +- [Paint fill](others/) +- [Split list](others/) +- [Tokenizer](others/) +- [Unique number](others/) ## License -This work is released under [MIT License][MIT] +This work is released under MIT License. -[![MIT IMG][MIT-logo]][MIT] - -To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. +To the extent possible under law, [Abraham Hernandez (@abranhe)](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work.

-
- -[MIT]: https://github.com/abranhe/algorithms/blob/master/license -[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png - - -[1]: https://github.com/abranhe -[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50 -[2]: https://github.com/christianbender -[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50 +
\ No newline at end of file diff --git a/src/.gitkeep b/src/.gitkeep new file mode 100644 index 00000000..e69de29b From def32b693a3175a90b7758863068a44fce7870bf Mon Sep 17 00:00:00 2001 From: megamayoy Date: Thu, 4 Oct 2018 15:09:07 +0200 Subject: [PATCH 220/285] add circularlylinked list implementation --- .../CircularlySinglyLinkedList.cpp | 286 ++++++++++++++++++ .../CircularlySinglyLinkedList.h | 62 ++++ 2 files changed, 348 insertions(+) create mode 100644 data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp create mode 100644 data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h diff --git a/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp b/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp new file mode 100644 index 00000000..1a650c2d --- /dev/null +++ b/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp @@ -0,0 +1,286 @@ + +#include"CircularlySinglyLinkedList.h" + + + +template +void CircularlySinglyLinkedList :: Add_to_empty_list(T val) +{ + Node* new_node = new Node(val); + + Tail = new_node; + Tail->next = new_node; + +Size_++; +} + + +template +void CircularlySinglyLinkedList ::Push_back( T val) +{ + if(Tail == NULL) + { + Add_to_empty_list(val); + + } + else + { + Node* new_node = new Node(val); + new_node->next = Tail->next; + Tail->next = new_node; + Tail= new_node; + Size_++; + } +} + +template +void CircularlySinglyLinkedList :: Clear() +{ + + if(Size_ == 0 ) + { + cout<<" all cleared linked list is empty"<<'\n'; + } + else + { + Node* tmp1 = Tail->next; + Node* tmp2 = tmp1; + + while(tmp1 != Tail) + { + tmp1 = tmp1->next; + //free the memory of the node to delete it + delete tmp2; + tmp2=tmp1; + } + // after the loop we make Tail point to NULL because it points + //to a deleted location in the memory (dangling pointer) + delete Tail; + tmp1 = NULL; + tmp2 = NULL; + Tail = NULL; + Size_ = 0; + } + +} +template + +void CircularlySinglyLinkedList :: Display() +{ + if(Size_ == 0) + { + cout<<"List is empty"<<'\n'; + return; + } + Node* tmp = Tail->next; //Head + + do + { + cout<data<<" "; + tmp = tmp->next; + + + } + while(tmp != Tail->next); + + + + cout<<'\n'; +} +template +void CircularlySinglyLinkedList :: Pop_back() +{ + if( Size_ == 0) + { + cout<<"Can't pop back. list is empty"<<'\n'; + return; + + } + + if(Size_ == 1) + { + delete Tail; + Tail = NULL; + + + } + else + { + Node* tmp = Tail->next; + + + while(tmp->next != Tail) + { + tmp = tmp->next; + } + + tmp->next = Tail->next; + delete Tail; + Tail = tmp; + } + +Size_--; +} + + +template +void CircularlySinglyLinkedList :: Push_front(T val) +{ + if(Tail == NULL) + { + Add_to_empty_list(val); + + } + else + { + Node* new_node = new Node(val); + new_node->next = Tail->next; + Tail->next = new_node; + Size_++; + } + +} + +template +void CircularlySinglyLinkedList :: Pop_front() +{ + + if(Size_ == 0) + { + cout<<"Can't pop front. List is empty "<<'\n'; + return; + } + + + if( Size_ == 1) + { + delete Tail; + Tail = NULL; + + + } + else + { + + Node* tmp = Tail->next; + Tail->next = Tail->next->next; + delete tmp; + + } + +Size_--; + +} + +template +void CircularlySinglyLinkedList :: Insert_at(T val, int position,string afterOrbefore_flag) +{ + + + if(Size_ == 0) + { + cout<<"no existing nodes.Linked list is empty. "; + return; + } + + if(position >Size_ || position < 0) + { + cout<<"invalid position choose a position between 1 and size "<<'\n'; + cout<<"size is: "<* tmp; + if(afterOrbefore_flag == "before") + { + + if(position == 1) + { + Push_front(val); + return; + + } + else + { + tmp=Tail->next; + for(int i = 1 ; i next); + + } + + + } + else if(afterOrbefore_flag == "after") + { + + if(position == Size_) + { + Push_back(val); + return; + + } + else + { + tmp=Tail->next; + for( int i = 1 ; i next); + + } + + } + + Node* new_node = new Node(val); + new_node->next = tmp->next; + tmp->next = new_node; + Size_++; + +} +template + +void CircularlySinglyLinkedList :: Delete_at(int position) +{ + if(Size_ == 0) + { + cout<<"no existing nodes.Linked list is empty. "; + return; + } + + if(position >Size_ || position < 0) + { + cout<<"invalid position choose a position between 1 and size "<<'\n'; + cout<<"size is: "<* tmp = Tail->next; + + for(int i = 1 ; i < position-1; i++,tmp = tmp->next); + + Node* node = tmp->next; + + tmp->next = node->next; + + delete node; + + + Size_--; + + } + + +} diff --git a/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h b/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h new file mode 100644 index 00000000..fcc4fdbe --- /dev/null +++ b/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h @@ -0,0 +1,62 @@ +#include + +using namespace std; + + +template +class Node +{ + public: + T data; + + Node* next; + + + Node() + { + next = NULL; + } + + Node(T val) + { + data = val; + next = NULL; + } + + + + +}; + +template +class CircularlySinglyLinkedList +{ + public: + + Node* Tail; + int Size_; + + CircularlySinglyLinkedList() + { + Size_ = 0; + Tail = NULL; + + } + void Push_front(T val); + void Pop_front(); + void Push_back(T val); + void Pop_back(); + void Display(); + void Clear(); + void Insert_at(T val,int position,string afterOrbefore_flag); // has generalized code for add before node and add after node + void Delete_at(int position); + + void Add_to_empty_list(T val); + + ~CircularlySinglyLinkedList() + { + Clear(); + } + + +}; From 064f6da66cc4a7c852702791c8109ec7fc95446b Mon Sep 17 00:00:00 2001 From: Tushar Gautam <31215069+Tushark21@users.noreply.github.com> Date: Thu, 4 Oct 2018 20:35:08 +0530 Subject: [PATCH 221/285] Doubly Linked List in C++ added. --- data-structures/Doubly_Linked_List.cpp | 93 ++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 data-structures/Doubly_Linked_List.cpp diff --git a/data-structures/Doubly_Linked_List.cpp b/data-structures/Doubly_Linked_List.cpp new file mode 100644 index 00000000..782c1b2c --- /dev/null +++ b/data-structures/Doubly_Linked_List.cpp @@ -0,0 +1,93 @@ +#include +#include + +using namespace std; +int main() +{ +struct node{ + int info; + node *left,*right; +}*ptr,*start,*last,*save; + +int c=1,i=0,data,item; +start=last=NULL; + +while(c<4 && c>0){ + cout<<"1.Insert\n2.Deletion\n3.Link List\n"; + cin>>c; + + switch(c){ + case 1: + cout<<"Enter Data\n"; + cin>>data; + + ptr=new node; + ptr->info=data; + ptr->left=last; + ptr->right=NULL; + + if(start==NULL){ + start=last=ptr; + } + + else{ + last->right=ptr; + last=ptr; + } + break; + + case 2: + if(start==NULL){ + cout<<"Underflow\n"; + } + + else{ + cout<<"Enter Item to be Deleted\n"; + cin>>item; + ptr=start; + + while(ptr!=NULL){ + if(ptr->info==item){ + i++; + if(ptr==start){ + start->left=NULL; + start=start->right; + } + + else{ + ptr->left->right=ptr->right; + ptr->right->left=ptr->left; + } + delete ptr; + cout<<"Item Deleted\n"; + } + ptr=ptr->right; + } + + if(i==0){ + cout<<"Item Does not exist\n"; + } + i=0; + } + break; + + case 3: + + ptr=start; + + while(ptr!=NULL){ + cout<info<<"->"; + ptr=ptr->right; + } + cout<<"\n"; + break; + + default: + cout<<"Wrong Choice\nExiting...\n"; + } + +} + +getch(); +return 0; +} \ No newline at end of file From 58a4af60f76416b7192ab9633b06cacda0956038 Mon Sep 17 00:00:00 2001 From: Tushar Gautam <31215069+Tushark21@users.noreply.github.com> Date: Thu, 4 Oct 2018 20:39:13 +0530 Subject: [PATCH 222/285] Circular Linked List in C++ Added. --- data-structures/Circular_Linked_List.cpp | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 data-structures/Circular_Linked_List.cpp diff --git a/data-structures/Circular_Linked_List.cpp b/data-structures/Circular_Linked_List.cpp new file mode 100644 index 00000000..0e363d18 --- /dev/null +++ b/data-structures/Circular_Linked_List.cpp @@ -0,0 +1,57 @@ +#include +#include + +using namespace std; + +int main() +{ + +struct node{ + int info; + node *next; +}*ptr,*head,*start; + +int c=1,data; + +ptr=new node; +ptr->next=NULL; + +start=head=ptr; + +while(c<3 && c>0){ + cout<<"1.Insert\n2.Link List\n"; + cin>>c; + + switch(c){ + case 1: + cout<<"Enter Data\n"; + cin>>data; + + ptr=new node; + ptr->next=start; + ptr->info=data; + + head->next=ptr; + head=ptr; + + break; + + case 2: + ptr=start->next; + + while(ptr!=start && ptr!=NULL){ + cout<info<<"->"; + ptr=ptr->next; + } + cout<<"\n"; + break; + + default: + cout<<"Wrong Choice\nExiting...\n"; + } + +} + +getch(); +return 0; +} \ No newline at end of file From 646f0b21a800a62dcf32b2bf5d52038e04476095 Mon Sep 17 00:00:00 2001 From: soumyaa01 Date: Thu, 4 Oct 2018 21:01:26 +0530 Subject: [PATCH 223/285] Added Topological Sort, Kosaraju, kruskal, tsp Added Topological Sort (matrix and adjacency list representation), Kosaraju's algorithm, Kruskal's algorithm, Travelling Salesman Problem --- graphs/kosaraju.cpp | 83 +++++++++++++++++++++++ graphs/kruskal.cpp | 96 +++++++++++++++++++++++++++ graphs/topological sort.(matrix).cpp | 61 +++++++++++++++++ graphs/topological sort.cpp | 48 ++++++++++++++ graphs/tsp.o | Bin 0 -> 3858 bytes 5 files changed, 288 insertions(+) create mode 100644 graphs/kosaraju.cpp create mode 100644 graphs/kruskal.cpp create mode 100644 graphs/topological sort.(matrix).cpp create mode 100644 graphs/topological sort.cpp create mode 100644 graphs/tsp.o diff --git a/graphs/kosaraju.cpp b/graphs/kosaraju.cpp new file mode 100644 index 00000000..62c7f5cf --- /dev/null +++ b/graphs/kosaraju.cpp @@ -0,0 +1,83 @@ +#include +using namespace std; +void print(vector < list > adjlist,int i,bool vis[]) +{ //print strongly connected components + vis[i]=true; + cout< "; + list::iterator it; + for(it=adjlist[i].begin();it!=adjlist[i].end();it++) + { + if(!vis[*it]) + print(adjlist,*it,vis); + } + cout< fillstack(vector < list > adjlist,int i, stack order,bool vis[]) +{ + vis[i]=true; + list::iterator it; + for(it=adjlist[i].begin();it!=adjlist[i].end();it++) + { + if(vis[*it]==false) + fillstack(adjlist,*it,order,vis); + } + order.push(i); + //cout< > adjlist, int v) +{ int count=0; + bool vis[v]; + int i; + //mark all nodes as unvisited + for(i=0;i<=v;i++) + vis[i]=false; + stack order; + list::iterator it; + for(i=1;i<=v;i++) + { + if(vis[i]==false) + //fill stack in order of finish times using DFS + order = fillstack(adjlist,i,order,vis); + } + /*while(!order.empty()) + { + cout<>v>>e; + vector < list > adjlist(v+1); + for(i=0;i>v1>>v2; + adjlist[v1].push_back(v2); + adjlist[v2].push_back(v1); //for undirected graph + } + + int ans=kosaraju(adjlist,v); + cout< +using namespace std; +class graph +{ + int v,adj[100][100]; +public: + void read() + { + int i,j,e,v1,v2,c; + + cout<<"vertex,edges"<>v>>e; + for(i=0;i>v1>>v2>>c; + adj[v1][v2]=adj[v2][v1]=c; + } + return; + } + int find(int v,int p[]) + { + while(p[v]!=v) + v=p[v]; + return v; + } + void unionij(int i,int j,int p[]) + { + if(i"< +using namespace std; +class graph +{ + int v,adj[100][100],st[100],top; +public: + void read() + { + int i,j; + + cout<<"vertex"<>v; + for(i=0;i>adj[i][j]; + // adj[j][i]=adj[i][j]; + } + } + } + void topo(int u,int vis[]) + { + vis[u]=1; + int i; + for(i=0;i=0) + { + cout< +using namespace std; +void sortit(vector > adjlist,int i, stack sorted,int vis[]) +{ + vis[i]= 1; + list :: iterator it; + + for(it= adjlist[i].begin();it!=adjlist[i].end();it++) + { + if(vis[*it]==0) + { + sortit(adjlist,*it,sorted,vis); + } + + } + cout< > adjlist,int v) +{ + int i,vis[v]; + for(i=1;i<=v;i++) + vis[i]=0; + stack sorted; + for(i=1;i<=v;i++) + { + if(vis[i]==0) + sortit(adjlist,i,sorted,vis); + } + while(!sorted.empty()) + { + cout<< sorted.top(); + sorted.pop(); + } +} +int main() +{ + int v,e,v1,v2; + cin>>v>>e; + vector > adjlist(v+1); + for(int i=1;i<=v;i++) + { + cin>>v1>>v2; + adjlist[v1].push_back(v2); + } + topsort(adjlist,v); +} diff --git a/graphs/tsp.o b/graphs/tsp.o new file mode 100644 index 0000000000000000000000000000000000000000..881927c7b0478883889aa2745aabebedc374c3c0 GIT binary patch literal 3858 zcma)8TWl0n7(T-;>k3tfZU94+603qrFLWzaB2?{Y8roXAEJRE_Os7jbu-&aYvsg&b zLfPnKT~i;tJQ(4D7^4rq_yD|EsAg$`u_iod;)986#B@peun!nE)bBrM_Fhs>GXMPN zoA1A#GiRn-SdG`G@dg~lzROL0zN>>93dkDNb-TRm$&)HtMBS{ZLCwSzTJ zHx8O+`7?L<#L*|fYw}k<*nnx+Rf*NFMci0r;CfKbRPhkEqiK7k!|ULk2k-oS(&zoS zk-sMY4hcAN0r&B$Bn59rO9k&5W+N*ZyW{wyo8Ub!J6RyNL-C_`o#-(QaxHi*Efs<3 zaoFiG@o0$t=~gsW)TYmPW)>FT&Ij$k59|-@z0m$8V>ign)*sV} zthTsFdOES-XsJXFS}J(MUVCX3yx4ti`;a%4xDM2IHwa51Qi-}jK$puV>BMhfQD_HF zcQ&}|$i2IPq6n&^JB-P!JEdme_+pU&C>hK+?tKjH_(+6LUyv zeq(BMLo)G)tU@Nbh~Z>kUR_ccq(TdCy!jR%NNM>Qv~Du%EybOc$cD+2UM0Ti)X6$( zVtieRfJ{}iK{zjvDO2L%8FlE!MMQU=x$T~OQq89)I=`Td8JnFs7K-7GW81dv+QkCV zcuWuNX0Jp|tKKl{i6K&Iw|g?=mH?+YOSd?wW>$81!G$6KU&>syBY?0xb!F{S$fR@1OO}i30>Kj$c&ECs=Ir#D>G;`2 zHCKk_BswuWGc`3OYVz4V*|d7=AH0*uPTun5?%xj~lEG}U$7^4u46ml@WQH_L_T-hT zN%!f*v^A7ev&mpyCX+-miRpOXvW7d=+zT!RjgRHP+VS=u_iHqH9d7w zWNodd=To$zNj0Zj!OV7Mw`Q-nnXET3ne}54Mf<#^_R$8Bm|gw?i0Izx-qQ}CW2W#5 zI0?l2oz+G7Y7_GPxkxRTxm!PTqMs?B3uKx3{KF!roXlw#YNc0oAW!9pwcBF%pgp;y z*vHi|oef%goyD5txLASQ*%_3)9`~)deC%<^Cvkb$Hpopvdl8Zt9<~<}`wYDOkWUCr zhs3c9>;xp8;y!j7@=;tKWF;-F(l!H4M$1BzG5&-05H26vjQW~{)&y;f(7K^*gocWsH4ALCh{d4M zx5dYfLz9)i3vIi=9)Oh5==77hJOWL|t%oKvr9R30UVtWR+YL?DHd(|zC}Lz+hs(!y zLQ2ma&>97{2U5ljK$FoT&?JvONRqd%h*5Qd+rp)|zi!t`4QaQIHZ}DYE;u( z@oLwiZ9_W#aLCKBuJh2i9vZW_r48a(;QU~~>Tc)Uh#Co3354V(BN z?~*(7E)DbR(YPgh*Q(G>AjCGuwN16c#Bkvf96*$s;g!hMr4buw6 zs^DNGR(inok)x({l#iOyyFU~e3U}!NtEELB(PG?+X@+HX>8jcftaVT`Q5@D5yJWO$ zAK%x^)xdLH+J?=pd$ZH`!K#h-?a|4wHxLb*YTv8 Date: Thu, 4 Oct 2018 13:55:37 -0400 Subject: [PATCH 224/285] added function get the nth place fibonacci number --- math/fibonacci.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 math/fibonacci.cpp diff --git a/math/fibonacci.cpp b/math/fibonacci.cpp new file mode 100644 index 00000000..e90cdb5d --- /dev/null +++ b/math/fibonacci.cpp @@ -0,0 +1,26 @@ +#include //to get the input and print the output +#include + +using std::cin; +using std::cout; + +int64_t getFibonnaci(unsigned int input){ + if (input <= 1){ + return input; + } + + return getFibonnaci(input-1) + getFibonnaci(input-2); +} + + +int main(){ + int userInput; + + cout << "Enter a number : \n"; + cin >> userInput; + + cout << "The fibonacci number for the sepcified position is: "; + cout << getFibonnaci(userInput); + + return 0; +} \ No newline at end of file From 810b933178242431982d21430690633fdd53744c Mon Sep 17 00:00:00 2001 From: anupamdas104 Date: Thu, 4 Oct 2018 14:03:33 -0400 Subject: [PATCH 225/285] added docmuentation for the fibonacci function --- math/fibonacci.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/math/fibonacci.cpp b/math/fibonacci.cpp index e90cdb5d..f512abcd 100644 --- a/math/fibonacci.cpp +++ b/math/fibonacci.cpp @@ -4,11 +4,16 @@ using std::cin; using std::cout; +//returns fibonacci number for specified position int64_t getFibonnaci(unsigned int input){ + //base case if (input <= 1){ return input; } + //recursively calls getFibonnaci function to get the previous fibonacci numbers until base case is reached + //all the previous fibonacci numbers are then added + //and returns the fibonacci number for current position return getFibonnaci(input-1) + getFibonnaci(input-2); } @@ -16,6 +21,7 @@ int64_t getFibonnaci(unsigned int input){ int main(){ int userInput; + //gets user Input cout << "Enter a number : \n"; cin >> userInput; From 605ca7f4226a6df27905eb548cfbdfa773146d5f Mon Sep 17 00:00:00 2001 From: saraansh1999 <32328811+saraansh1999@users.noreply.github.com> Date: Thu, 4 Oct 2018 23:44:14 +0530 Subject: [PATCH 226/285] Create topological_sort.cpp --- graphs/topological_sort.cpp | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 graphs/topological_sort.cpp diff --git a/graphs/topological_sort.cpp b/graphs/topological_sort.cpp new file mode 100644 index 00000000..9038e90b --- /dev/null +++ b/graphs/topological_sort.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include +using namespace std; +stack pile; +vector adj[1000]; +void dfs(int cur,int vis[]) +{ + int i=0; + for(i=0;i>n>>e; + for(i=0;i>u>>v; + adj[u].push_back(v); + } + for(i=1;i<=n;i++) + { + if(vis[i]==0) + dfs(i,vis); + } + while(!pile.empty()) + { + cout< Date: Fri, 5 Oct 2018 01:11:29 +0530 Subject: [PATCH 227/285] Added binary search tree code in c++ --- data-structures/binary_search_tree.cpp | 142 +++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 data-structures/binary_search_tree.cpp diff --git a/data-structures/binary_search_tree.cpp b/data-structures/binary_search_tree.cpp new file mode 100644 index 00000000..9609c66a --- /dev/null +++ b/data-structures/binary_search_tree.cpp @@ -0,0 +1,142 @@ +#include +#include +#include +using namespace std; +struct tree +{ + int value; + tree *left; + tree *right; +}*root=NULL; +void inserte() +{ + int v,insert_left=0,insert_right=0; + cout<<"Enter Value To Insert: "; + cin>>v; + tree *newnode=(tree*)malloc(sizeof(tree)); + newnode->value=v; + newnode->left=NULL; + newnode->right=NULL; + if(root==NULL) + root=newnode; + else + { + tree *temp=root; + while(1) + { + if(insert_left==1||insert_right==1) + break; + if(vvalue) + { + if(temp->left!=NULL) + temp=temp->left; + else + insert_left=1; + } + else + if(v>temp->value) + { + if(temp->right!=NULL) + temp=temp->right; + else + insert_right=1; + } + } + if(insert_left==1) + temp->left=newnode; + else + if(insert_right==1) + temp->right=newnode; + } +} +void preorder() +{ + tree *temp=root; + stack s; + repeat: + while(1) + { + if(temp->right!=NULL) + s.push(temp->right); + if(temp->left!=NULL) + { + cout<value<<" "; + temp=temp->left; + } + else + if(temp->left==NULL) + { + cout<value<<" "; + break; + } + } + while(!s.empty()) + { + temp=s.top(); + s.pop(); + goto repeat; + } +} +void inorder() +{ + tree *temp=root; + stack s; + repeat: + while(1) + { + s.push(temp); + if(temp->left!=NULL) + temp=temp->left; + else + break; + } + while(1) + { + repeat1: + temp=s.top(); + cout<value<<" "; + s.pop(); + if(temp->right==NULL) + goto repeat1; + else + if(temp->right!=NULL) + { + temp=temp->right; + goto repeat; + } + else + if(s.empty()) + break; + } +} + +int main() +{ + int ch; + while(1) + { + cout<>ch; + if(ch==1) + inserte(); + else + if(ch==2) + { + preorder(); + cout< Date: Thu, 4 Oct 2018 21:17:14 -0300 Subject: [PATCH 228/285] add a prime number check in C++ --- math/Prime_number_check | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 math/Prime_number_check diff --git a/math/Prime_number_check b/math/Prime_number_check new file mode 100644 index 00000000..8aeea522 --- /dev/null +++ b/math/Prime_number_check @@ -0,0 +1,32 @@ +#include +using namespace std; + +int checkPrimeNumber(int); + +int main() +{ + int n; + + cout << "Enter a positive integer: "; + cin >> n; + + if(checkPrimeNumber(n) == 0) + cout << n << " is a prime number."; + else + cout << n << " is not a prime number."; + return 0; +} +int checkPrimeNumber(int n) +{ + bool flag = false; + + for(int i = 2; i <= n/2; ++i) + { + if(n%i == 0) + { + flag = true; + break; + } + } + return flag; +} \ No newline at end of file From d50211017e06ea12b33594d2f15316e046e045c5 Mon Sep 17 00:00:00 2001 From: Anshu Patel Date: Tue, 2 Oct 2018 22:30:53 +0530 Subject: [PATCH 229/285] Splay Tree Added --- SplayTree.cpp | 249 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 SplayTree.cpp diff --git a/SplayTree.cpp b/SplayTree.cpp new file mode 100644 index 00000000..30116bd5 --- /dev/null +++ b/SplayTree.cpp @@ -0,0 +1,249 @@ +#include +#include +#include +using namespace std; + +struct splay +{ + int key; + splay* lchild; + splay* rchild; +}; + +class SplayTree +{ + public: + SplayTree() + { + } + + // RR(Y rotates to the right) + splay* RR_Rotate(splay* k2) + { + splay* k1 = k2->lchild; + k2->lchild = k1->rchild; + k1->rchild = k2; + return k1; + } + + // LL(Y rotates to the left) + splay* LL_Rotate(splay* k2) + { + splay* k1 = k2->rchild; + k2->rchild = k1->lchild; + k1->lchild = k2; + return k1; + } + + // An implementation of top-down splay tree + splay* Splay(int key, splay* root) + { + if (!root) + return NULL; + splay header; + /* header.rchild points to L tree; + header.lchild points to R Tree */ + header.lchild = header.rchild = NULL; + splay* LeftTreeMax = &header; + splay* RightTreeMin = &header; + while (1) + { + if (key < root->key) + { + if (!root->lchild) + break; + if (key < root->lchild->key) + { + root = RR_Rotate(root); + // only zig-zig mode need to rotate once, + if (!root->lchild) + break; + } + /* Link to R Tree */ + RightTreeMin->lchild = root; + RightTreeMin = RightTreeMin->lchild; + root = root->lchild; + RightTreeMin->lchild = NULL; + } + else if (key > root->key) + { + if (!root->rchild) + break; + if (key > root->rchild->key) + { + root = LL_Rotate(root); + // only zag-zag mode need to rotate once, + if (!root->rchild) + break; + } + /* Link to L Tree */ + LeftTreeMax->rchild = root; + LeftTreeMax = LeftTreeMax->rchild; + root = root->rchild; + LeftTreeMax->rchild = NULL; + } + else + break; + } + /* assemble L Tree, Middle Tree and R tree */ + LeftTreeMax->rchild = root->lchild; + RightTreeMin->lchild = root->rchild; + root->lchild = header.rchild; + root->rchild = header.lchild; + return root; + } + + splay* New_Node(int key) + { + splay* p_node = new splay; + if (!p_node) + { + fprintf(stderr, "Out of memory!\n"); + exit(1); + } + p_node->key = key; + p_node->lchild = p_node->rchild = NULL; + return p_node; + } + + splay* Insert(int key, splay* root) + { + static splay* p_node = NULL; + if (!p_node) + p_node = New_Node(key); + else + p_node->key = key; + if (!root) + { + root = p_node; + p_node = NULL; + return root; + } + root = Splay(key, root); + /* This is BST that, all keys <= root->key is in root->lchild, all keys > + root->key is in root->rchild. */ + if (key < root->key) + { + p_node->lchild = root->lchild; + p_node->rchild = root; + root->lchild = NULL; + root = p_node; + } + else if (key > root->key) + { + p_node->rchild = root->rchild; + p_node->lchild = root; + root->rchild = NULL; + root = p_node; + } + else + return root; + p_node = NULL; + return root; + } + + splay* Delete(int key, splay* root) + { + splay* temp; + if (!root) + return NULL; + root = Splay(key, root); + if (key != root->key) + return root; + else + { + if (!root->lchild) + { + temp = root; + root = root->rchild; + } + else + { + temp = root; + /*Note: Since key == root->key, + so after Splay(key, root->lchild), + the tree we get will have no right child tree.*/ + root = Splay(key, root->lchild); + root->rchild = temp->rchild; + } + free(temp); + return root; + } + } + + splay* Search(int key, splay* root) + { + return Splay(key, root); + } + + void InOrder(splay* root) + { + if (root) + { + InOrder(root->lchild); + cout<< "key: " <key; + if(root->lchild) + cout<< " | left child: "<< root->lchild->key; + if(root->rchild) + cout << " | right child: " << root->rchild->key; + cout<< "\n"; + InOrder(root->rchild); + } + } +}; + +int main() +{ + SplayTree st; + int vector[10] = {9,8,7,6,5,4,3,2,1,0}; + splay *root; + root = NULL; + const int length = 10; + int i; + for(i = 0; i < length; i++) + root = st.Insert(vector[i], root); + cout<<"\nInOrder: \n"; + st.InOrder(root); + int input, choice; + while(1) + { + cout<<"\nSplay Tree Operations\n"; + cout<<"1. Insert "<>choice; + switch(choice) + { + case 1: + cout<<"Enter value to be inserted: "; + cin>>input; + root = st.Insert(input, root); + cout<<"\nAfter Insert: "<>input; + root = st.Delete(input, root); + cout<<"\nAfter Delete: "<>input; + root = st.Search(input, root); + cout<<"\nAfter Search "< Date: Fri, 5 Oct 2018 22:35:49 +0900 Subject: [PATCH 230/285] Aho-Corasick algorithm has been added #6 --- strings/Aho-Corasick.cpp | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 strings/Aho-Corasick.cpp diff --git a/strings/Aho-Corasick.cpp b/strings/Aho-Corasick.cpp new file mode 100644 index 00000000..29cb116f --- /dev/null +++ b/strings/Aho-Corasick.cpp @@ -0,0 +1,79 @@ +#include +#include +#include +using namespace std; +#define root 0 +const int N = 100001, K = 256; + +int sz; +struct tree { + int nx[K], suff; + bool flag; +} t[N]; +int q[N], endq, stq; +short tmp; +int n, i, j, tmp_pos, x; +string s; +int main() +{ + freopen("console2.in", "r", stdin); + freopen("console2.out", "w", stdout); + ios_base :: sync_with_stdio(0); + cin >> n; + getline (cin, s); + for (i = 1; i <= n; ++i) { + getline (cin, s); + tmp_pos = 0; + for (j = 0; j < (int)s.size(); ++j) { + tmp = int(s[j]) - 32; + if (t[tmp_pos].nx[tmp] == 0) + t[tmp_pos].nx[tmp] = ++sz; + tmp_pos = t[tmp_pos].nx[tmp]; + } + t[tmp_pos].flag = 1; + } + q[endq++] = 0; + t[0].suff = 0; + while (stq != endq) { + x = q[stq++]; + if (x != 0) { + for (i = 0; i < K; ++i) { + if (t[x].nx[i] == 0) { + t[x].nx[i] = t[t[x].suff].nx[i]; + } else { + t[t[x].nx[i]].suff = t[t[x].suff].nx[i]; + q[endq++] = t[x].nx[i]; + if(t[t[t[x].nx[i]].suff].flag == 1) + t[t[x].nx[i]].flag = 1; + } + } + } else { + for (i = 0; i < K; ++i) { + if (t[x].nx[i] == 0) { + t[x].nx[i] = 0; + } else { + t[t[x].nx[i]].suff = 0; + q[endq++] = t[x].nx[i]; + if (t[t[t[x].nx[i]].suff].flag == 1) + t[t[x].nx[i]].flag = 1; + } + } + } + } + while (getline (cin, s)) { + tmp_pos = 0; + bool flag = 0; + for (i = 0; i < (int)s.size(); ++i) { + tmp = int(s[i]) - 32; + tmp_pos = t[tmp_pos].nx[tmp]; + if (t[tmp_pos].flag) { + flag = 1; + break; + } + } + if (flag) + cout << s << "\n"; + } + return 0; + +} From 269dc7e0b2ac8239ab19feadff9754530f95f6c6 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Sat, 3 Oct 2020 01:54:38 -0400 Subject: [PATCH 231/285] Revert "added trivial hashing" --- data-structures/Trivial Hashing | 52 --------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 data-structures/Trivial Hashing diff --git a/data-structures/Trivial Hashing b/data-structures/Trivial Hashing deleted file mode 100644 index 530abaa8..00000000 --- a/data-structures/Trivial Hashing +++ /dev/null @@ -1,52 +0,0 @@ -// CPP program to implement direct index mapping -// with negative values allowed. -#include -using namespace std; -#define MAX 1000 - -// Since array is global, it is initialized as 0. -bool has[MAX + 1][2]; - -// searching if X is Present in the given array -// or not. -bool search(int X) -{ - if (X >= 0) { - if (has[X][0] == 1) - return true; - else - return false; - } - - // if X is negative take the absolute - // value of X. - X = abs(X); - if (has[X][1] == 1) - return true; - - return false; -} - -void insert(int a[], int n) -{ - for (int i = 0; i < n; i++) { - if (a[i] >= 0) - has[a[i]][0] = 1; - else - has[abs(a[i])][1] = 1; - } -} - -// Driver code -int main() -{ - int a[] = { -1, 9, -5, -8, -5, -2 }; - int n = sizeof(a)/sizeof(a[0]); - insert(a, n); - int X = -5; - if (search(X) == true) - cout << "Present"; - else - cout << "Not Present"; - return 0; -} From 7f0e33ba0538784a7d76b3d87df6ae7f050fe953 Mon Sep 17 00:00:00 2001 From: ashwani-ops <55297146+ashwani-ops@users.noreply.github.com> Date: Tue, 1 Oct 2019 19:16:56 +0530 Subject: [PATCH 232/285] Create eveodd.cpp --- math/evenorodd/eveodd.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 math/evenorodd/eveodd.cpp diff --git a/math/evenorodd/eveodd.cpp b/math/evenorodd/eveodd.cpp new file mode 100644 index 00000000..75513e2b --- /dev/null +++ b/math/evenorodd/eveodd.cpp @@ -0,0 +1,12 @@ +#include +#include +using namespace std; +int main(){ +int n; +cout<<"Enter a number: "<>n; +if(n%2==0) +cout<<"number is even"< Date: Tue, 1 Oct 2019 19:23:55 +0530 Subject: [PATCH 233/285] Create prime.cpp --- math/prime.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 math/prime.cpp diff --git a/math/prime.cpp b/math/prime.cpp new file mode 100644 index 00000000..02f55b28 --- /dev/null +++ b/math/prime.cpp @@ -0,0 +1,14 @@ +#include +using namespace std; +int main() +{int n,flag; +cin>>n; +//to check whether a number is prime or not +for(int i=2;i0) + cout<<"number is not prime"< Date: Tue, 1 Oct 2019 19:29:56 +0530 Subject: [PATCH 234/285] Create squareroot --- math/squareroot | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 math/squareroot diff --git a/math/squareroot b/math/squareroot new file mode 100644 index 00000000..850da332 --- /dev/null +++ b/math/squareroot @@ -0,0 +1,16 @@ +#include +#include +using namespace std; +int main() +{ + int t,n; + cin>>t; + while(t>0) + { + cin>>n; + int root; + root=sqrt(n); + cout< Date: Tue, 1 Oct 2019 13:55:42 -0300 Subject: [PATCH 235/285] Added Bucket Sort --- sorting/bucket_sort.cpp | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sorting/bucket_sort.cpp diff --git a/sorting/bucket_sort.cpp b/sorting/bucket_sort.cpp new file mode 100644 index 00000000..7643770d --- /dev/null +++ b/sorting/bucket_sort.cpp @@ -0,0 +1,72 @@ +// +// C++ implementation of bucket sort. +// +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Simon Faillace Mullen +// Github: @macmullen +// +#include +#include +#include +#include + +// A utility function to print an array of size n. +// Implemented by Carlos Abraham Hernandez in bubble_sort.cpp +void print_array(int arr[], int n) +{ + for (size_t i = 0; i < n; i++) + { + std::cout << arr[i] << " "; + } + std::cout << std::endl; +} + +// Given an array "arr" of size "n", this function sorts its numbers +// using the algorithm of Bucket Sort. +void bucket_sort(int arr[], size_t n, int number_of_buckets) +{ + // Find the maximum element of the array + int* max = std::max_element(arr, arr+n); + // Calculate the divider value dividing the maximum element and number of buckets. + int divider = std::ceil(float(*max + 1) / float(number_of_buckets) ); + // Create the buckets array. + std::vector> buckets; + buckets.resize(number_of_buckets); + + // Place every number into a corresponding bucket. + for (size_t i = 0; i < n; i++) + { + int j = floor(arr[i] / divider); + buckets[j].push_back(arr[i]); + } + + // Sort every bucket. + int index = 0; + for (size_t i = 0; i < number_of_buckets; i++) + { + sort(buckets[i].begin(), buckets[i].end()); + // Place the sorted numbers into the original array. + for(int number : buckets[i]) + { + arr[index] = number; + index++; + } + } +} + +int main() +{ + int arr[] = {22, 45, 12, 8, 10, 6, 72, 81, 33, 18, 50, 14}; + int n = sizeof(arr)/sizeof(arr[0]); + std::cout << "Unsorted array: "; + print_array(arr, n); + bucket_sort(arr, n, 10); + std::cout << "Sorted array: "; + print_array(arr, n); + return 0; +} \ No newline at end of file From a04c9fef37734e7fbc6aeb19f31c81091681db17 Mon Sep 17 00:00:00 2001 From: shantamv <39529151+shantamv@users.noreply.github.com> Date: Sat, 5 Oct 2019 02:09:13 +0530 Subject: [PATCH 236/285] Find Maximum size subset with given sum. This is an extended version of subset sum problem. Here we need to find size of maximum size subset whose sum is equal to given sum. --- .../Maximum size subset with given sum | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 dynamic-programming/Maximum size subset with given sum diff --git a/dynamic-programming/Maximum size subset with given sum b/dynamic-programming/Maximum size subset with given sum new file mode 100644 index 00000000..63dda853 --- /dev/null +++ b/dynamic-programming/Maximum size subset with given sum @@ -0,0 +1,48 @@ +#include +using namespace std; + + int isSubsetSum(int set[], int n, int sum) + { + bool subset[sum + 1][n + 1]; + int count[sum + 1][n + 1]; + + for (int i = 0; i <= n; i++) + { + subset[0][i] = true; + count[0][i] = 0; + } + + for (int i = 1; i <= sum; i++) + { + subset[i][0] = false; + count[i][0] = -1; + } + + for (int i = 1; i <= sum; i++) + { + for (int j = 1; j <= n; j++) + { + subset[i][j] = subset[i][j - 1]; + count[i][j] = count[i][j - 1]; + if (i >= set[j - 1]) + { + subset[i][j] = subset[i][j] || + subset[i - set[j - 1]][j - 1]; + + if (subset[i][j]) + count[i][j] = max(count[i][j - 1], + count[i - set[j - 1]][j - 1] + 1); + } + } + } + + return count[sum][n]; + } + +int main() +{ + int set[] = { 2, 3, 5, 10 }; + int sum = 20; + int n = 4; + cout<< isSubsetSum(set, n, sum); +} From ee5da2c08d6e77d1ecadc95dd9274deabfc74d36 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Lakkireddy <34263262+Harshavardhan153@users.noreply.github.com> Date: Sat, 5 Oct 2019 11:48:26 +0530 Subject: [PATCH 237/285] Create MAC-Address.cpp command to run : g++ MAC-Address.cpp && ./a.out --- Networks/MAC-Address.cpp | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Networks/MAC-Address.cpp diff --git a/Networks/MAC-Address.cpp b/Networks/MAC-Address.cpp new file mode 100644 index 00000000..c051ffc0 --- /dev/null +++ b/Networks/MAC-Address.cpp @@ -0,0 +1,55 @@ +//Run in UNIX systems to get MAC Address of your system.... +//Harsha Vardhan +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + + + + +void getMacAddress(char *uc_Mac) +{ + int fd; + + struct ifreq ifr; + const char* iface = "enp2s0"; + char* mac; + + fd = socket(AF_INET, SOCK_DGRAM, 0); + + ifr.ifr_addr.sa_family = AF_INET; + strncpy((char *)ifr.ifr_name , (const char *)iface , IFNAMSIZ-1); + + ioctl(fd, SIOCGIFHWADDR, &ifr); + + close(fd); + + mac = (char *)ifr.ifr_hwaddr.sa_data; + + //display mac address + sprintf((char *)uc_Mac,(const char *)"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" , mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + +} + +int main() +{ + char mac[32]={0}; + + getMacAddress(mac); + + cout< Date: Fri, 4 Oct 2019 19:11:19 +0530 Subject: [PATCH 238/285] Create gold_mine.cpp It is solution to gold mine problem that has been asked in many company interviews. --- dynamic-programming/gold_mine.cpp | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 dynamic-programming/gold_mine.cpp diff --git a/dynamic-programming/gold_mine.cpp b/dynamic-programming/gold_mine.cpp new file mode 100644 index 00000000..59f7c2d8 --- /dev/null +++ b/dynamic-programming/gold_mine.cpp @@ -0,0 +1,61 @@ +// C++ program to solve Gold Mine problem +#include +using namespace std; + +const int MAX = 100; + +// Returns maximum amount of gold that can be collected +// when journey started from first column and moves +// allowed are right, right-up and right-down +int getMaxGold(int gold[][MAX], int m, int n) +{ + // Create a table for storing intermediate results + // and initialize all cells to 0. The first row of + // goldMineTable gives the maximum gold that the miner + // can collect when starts that row + int goldTable[m][n]; + memset(goldTable, 0, sizeof(goldTable)); + + for (int col=n-1; col>=0; col--) + { + for (int row=0; row) + int right = (col==n-1)? 0: goldTable[row][col+1]; + + // Gold collected on going to the cell to right up (/) + int right_up = (row==0 || col==n-1)? 0: + goldTable[row-1][col+1]; + + // Gold collected on going to the cell to right down (\) + int right_down = (row==m-1 || col==n-1)? 0: + goldTable[row+1][col+1]; + + // Max gold collected from taking either of the + // above 3 paths + goldTable[row][col] = gold[row][col] + + max(right, max(right_up, right_down)); + + } + } + + // The max amount of gold collected will be the max + // value in first column of all rows + int res = goldTable[0][0]; + for (int i=1; i Date: Sat, 3 Oct 2020 13:58:14 +0530 Subject: [PATCH 239/285] Added Optimised Bubble Sort --- sorting/bubble_sort.cpp | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sorting/bubble_sort.cpp diff --git a/sorting/bubble_sort.cpp b/sorting/bubble_sort.cpp new file mode 100644 index 00000000..ed22d402 --- /dev/null +++ b/sorting/bubble_sort.cpp @@ -0,0 +1,54 @@ +// C++ implementation of Bubble Sort(Optimised Solution). +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Abhishek Jaiswal +// Github: @Abhishek-iiit +// +#include +#include + +using namespace std; + +void bubbleSort(int arr[], int n) +{ + int i, j; + bool changed; + for (i = 0; i < n-1; i++) + { + changed = false; + for (j = 0; j < n-i-1; j++) + { + if (arr[j] > arr[j+1]) + { + swap(arr[j],arr[j+1]); + changed = true; + } + } + if (changed == false) + break; + } +} + +int main() +{ + int n; + cout<<"Input the total size :"<>n; + int arr[n]; + cout<<"Input the number one-by-one :"<>arr[i]; + } + bubbleSort(arr,n); + cout<<"Sorted array:"< Date: Sat, 3 Oct 2020 14:36:58 +0530 Subject: [PATCH 240/285] added Merge Sort --- sorting/merge_sort.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sorting/merge_sort.cpp diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp new file mode 100644 index 00000000..11ca95ba --- /dev/null +++ b/sorting/merge_sort.cpp @@ -0,0 +1,80 @@ +// C++ implementation of Bubble Sort(Optimised Solution). +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Abhishek Jaiswal +// Github: @abhishek-iiit +// +#include +#include + +using namespace std; + +void merge(int *array, int l, int m, int r) { + int i, j, k, nl, nr; + //size of left and right sub-arrays + + nl = m-l+1; nr = r-m; + int larr[nl], rarr[nr]; + + //fill left and right sub-arrays + for(i = 0; i>n; + int arr[n]; + cout<<"Input the number one-by-one :"<>arr[i]; + } + mergeSort(arr,0,n-1); + cout<<"Sorted array:"< Date: Sat, 3 Oct 2020 14:56:40 +0530 Subject: [PATCH 241/285] Delete merge_sort.cpp --- sorting/merge_sort.cpp | 80 ------------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 sorting/merge_sort.cpp diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp deleted file mode 100644 index 11ca95ba..00000000 --- a/sorting/merge_sort.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// C++ implementation of Bubble Sort(Optimised Solution). -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Abhishek Jaiswal -// Github: @abhishek-iiit -// -#include -#include - -using namespace std; - -void merge(int *array, int l, int m, int r) { - int i, j, k, nl, nr; - //size of left and right sub-arrays - - nl = m-l+1; nr = r-m; - int larr[nl], rarr[nr]; - - //fill left and right sub-arrays - for(i = 0; i>n; - int arr[n]; - cout<<"Input the number one-by-one :"<>arr[i]; - } - mergeSort(arr,0,n-1); - cout<<"Sorted array:"< Date: Sat, 3 Oct 2020 15:08:34 +0530 Subject: [PATCH 242/285] added optimised merge sort --- sorting/merge_sort.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sorting/merge_sort.cpp diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp new file mode 100644 index 00000000..11ca95ba --- /dev/null +++ b/sorting/merge_sort.cpp @@ -0,0 +1,80 @@ +// C++ implementation of Bubble Sort(Optimised Solution). +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Abhishek Jaiswal +// Github: @abhishek-iiit +// +#include +#include + +using namespace std; + +void merge(int *array, int l, int m, int r) { + int i, j, k, nl, nr; + //size of left and right sub-arrays + + nl = m-l+1; nr = r-m; + int larr[nl], rarr[nr]; + + //fill left and right sub-arrays + for(i = 0; i>n; + int arr[n]; + cout<<"Input the number one-by-one :"<>arr[i]; + } + mergeSort(arr,0,n-1); + cout<<"Sorted array:"< Date: Sat, 3 Oct 2020 15:18:14 +0530 Subject: [PATCH 243/285] Coin_flip --- algorithms/math/coin_flip.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 algorithms/math/coin_flip.cpp diff --git a/algorithms/math/coin_flip.cpp b/algorithms/math/coin_flip.cpp new file mode 100644 index 00000000..323ea440 --- /dev/null +++ b/algorithms/math/coin_flip.cpp @@ -0,0 +1,29 @@ +/*In this game the player will use N coins numbered from 1 to N, and all the coins will be facing in "Same direction" +(Either Head or Tail),which will be decided by the player before starting of the game. +The player needs to play N rounds.In the k-th round the player will flip the face of the all coins whose number is less + than or equal to k. That is, the face of coin i will be reversed, from Head to Tail, or, from Tail to Head, for i ≤ k. +Elephant needs to guess the total number of coins showing a particular face after playing N rounds. Elephant really becomes +quite fond of this game COIN FLIP, so Elephant plays G times.*/ + +#include +using namespace std; + +int main() { + int t; + cin >> t; + while(t--) { + int g; + cin >> g; + while(g--) { + int i, n, q; + cin >> i >> n >> q; + if(n % 2 == 0 || i == q) { + cout << n / 2 << endl; + } + else { + cout << (n / 2 + 1) << endl; + } + } + } + return 0; +} From c7a54eb961f6bc30eb900c4dca67735b0834965f Mon Sep 17 00:00:00 2001 From: Abhishek Jaiswal <69477761+abhishek-iiit@users.noreply.github.com> Date: Sat, 3 Oct 2020 15:51:54 +0530 Subject: [PATCH 244/285] Delete coin_flip.cpp --- algorithms/math/coin_flip.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 algorithms/math/coin_flip.cpp diff --git a/algorithms/math/coin_flip.cpp b/algorithms/math/coin_flip.cpp deleted file mode 100644 index 323ea440..00000000 --- a/algorithms/math/coin_flip.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*In this game the player will use N coins numbered from 1 to N, and all the coins will be facing in "Same direction" -(Either Head or Tail),which will be decided by the player before starting of the game. -The player needs to play N rounds.In the k-th round the player will flip the face of the all coins whose number is less - than or equal to k. That is, the face of coin i will be reversed, from Head to Tail, or, from Tail to Head, for i ≤ k. -Elephant needs to guess the total number of coins showing a particular face after playing N rounds. Elephant really becomes -quite fond of this game COIN FLIP, so Elephant plays G times.*/ - -#include -using namespace std; - -int main() { - int t; - cin >> t; - while(t--) { - int g; - cin >> g; - while(g--) { - int i, n, q; - cin >> i >> n >> q; - if(n % 2 == 0 || i == q) { - cout << n / 2 << endl; - } - else { - cout << (n / 2 + 1) << endl; - } - } - } - return 0; -} From 77020b8bbc06cba22290cb2ec968d5928e8e8364 Mon Sep 17 00:00:00 2001 From: Abhishek Jaiswal <69477761+abhishek-iiit@users.noreply.github.com> Date: Sat, 3 Oct 2020 15:51:58 +0530 Subject: [PATCH 245/285] Delete coin_flip.cpp --- algorithms/math/coin_flip.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 algorithms/math/coin_flip.cpp diff --git a/algorithms/math/coin_flip.cpp b/algorithms/math/coin_flip.cpp deleted file mode 100644 index 323ea440..00000000 --- a/algorithms/math/coin_flip.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*In this game the player will use N coins numbered from 1 to N, and all the coins will be facing in "Same direction" -(Either Head or Tail),which will be decided by the player before starting of the game. -The player needs to play N rounds.In the k-th round the player will flip the face of the all coins whose number is less - than or equal to k. That is, the face of coin i will be reversed, from Head to Tail, or, from Tail to Head, for i ≤ k. -Elephant needs to guess the total number of coins showing a particular face after playing N rounds. Elephant really becomes -quite fond of this game COIN FLIP, so Elephant plays G times.*/ - -#include -using namespace std; - -int main() { - int t; - cin >> t; - while(t--) { - int g; - cin >> g; - while(g--) { - int i, n, q; - cin >> i >> n >> q; - if(n % 2 == 0 || i == q) { - cout << n / 2 << endl; - } - else { - cout << (n / 2 + 1) << endl; - } - } - } - return 0; -} From d1b597bbe6ae016c978b4b986a969be75bc3db65 Mon Sep 17 00:00:00 2001 From: Abhishek Jaiswal <69477761+abhishek-iiit@users.noreply.github.com> Date: Sat, 3 Oct 2020 15:54:25 +0530 Subject: [PATCH 246/285] Delete merge_sort.cpp --- sorting/merge_sort.cpp | 80 ------------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 sorting/merge_sort.cpp diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp deleted file mode 100644 index 11ca95ba..00000000 --- a/sorting/merge_sort.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// C++ implementation of Bubble Sort(Optimised Solution). -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Abhishek Jaiswal -// Github: @abhishek-iiit -// -#include -#include - -using namespace std; - -void merge(int *array, int l, int m, int r) { - int i, j, k, nl, nr; - //size of left and right sub-arrays - - nl = m-l+1; nr = r-m; - int larr[nl], rarr[nr]; - - //fill left and right sub-arrays - for(i = 0; i>n; - int arr[n]; - cout<<"Input the number one-by-one :"<>arr[i]; - } - mergeSort(arr,0,n-1); - cout<<"Sorted array:"< Date: Sat, 3 Oct 2020 20:51:12 +0530 Subject: [PATCH 247/285] Add files via upload A good problem to practice recursion, string manipulations too. --- backtracking/All_Codes_Recursion.cpp | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 backtracking/All_Codes_Recursion.cpp diff --git a/backtracking/All_Codes_Recursion.cpp b/backtracking/All_Codes_Recursion.cpp new file mode 100644 index 00000000..726efea0 --- /dev/null +++ b/backtracking/All_Codes_Recursion.cpp @@ -0,0 +1,89 @@ +/* + +Problem Statement + +Assume that the value of a = 1, b = 2, c = 3, ... , z = 26. +You are given a numeric string S. +Write a program to return the list of all possible codes that can be generated from the given string. + +For Example - +Input: +1123 + +Output: +aabc +kbc +alc +aaw +kw + +Being a recursive solution, this won't work for large inputs. But we can use DP to make it work for Large results. + +*/ + + +#include +#include +using namespace std; + +int getString(string str) { + int res = 99999; + if(str.size() == 1) { + int num = str[0] - '0'; + //c = 'a' + (num-1); + return num-1; + } + else if(str.size() > 1) { + int num = ((str[0] - '0')*10) + (str[1] - '0'); + if(num > 26) { + return res; + } + else { + //c = 'a' + (num-1); + return num-1; + } + + } + + return res; + +} + +int helper(string input, string curString, string modString, string output[10000]) { + static int i; + int cs = getString(curString); + if(input.empty() && cs < 27) { + modString +=('a' + cs); + output[i++] = modString; + return i; + } + + if(cs < 27) { + modString +=('a' + cs); + } + + int count = helper(input.substr(1),input.substr(0,1),modString,output); + if(input.length() > 1) { + int check = getString(input.substr(0,2)); + if(check < 27) { + count = helper(input.substr(2),input.substr(0,2),modString,output); + } + } + return count; + } + + +int getCodes(string input, string output[10000]) { + return helper(input,"","",output); +} + +int main(){ + string input; + cin >> input; + + string output[10000]; + int count = getCodes(input, output); + for(int i = 0; i < count && i < 10000; i++) + cout << output[i] << endl; + return 0; +} From 73ba459c30ba93f4e115e49267ea79c19c5e66fa Mon Sep 17 00:00:00 2001 From: Rikhat Date: Sat, 3 Oct 2020 22:15:06 +0600 Subject: [PATCH 248/285] Some minor C++ style code changes --- .../DoublyLinkedList/doubly_linked_list.cpp | 301 +++++++++--------- .../DoublyLinkedList/doubly_linked_list.h | 88 +++-- 2 files changed, 193 insertions(+), 196 deletions(-) diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.cpp b/data-structures/DoublyLinkedList/doubly_linked_list.cpp index 8402dce5..2808971c 100644 --- a/data-structures/DoublyLinkedList/doubly_linked_list.cpp +++ b/data-structures/DoublyLinkedList/doubly_linked_list.cpp @@ -1,25 +1,27 @@ #include"doubly_linked_list.h" +using namespace std; + template void DoublyLinkedList :: Push_back(T val) { - Node* new_node = new Node(val); + auto* new_node = new Node(move(val)); - if(Tail != NULL) //or if(Size != 0) - { - Tail->next = new_node; - new_node->prev = Tail; - Tail = new_node; + if(Tail != nullptr) //or if(Size != 0) + { + Tail->next = new_node; + new_node->prev = Tail; + Tail = new_node; - } - else - { - Tail = new_node; - Head = new_node; - } + } + else + { + Tail = new_node; + Head = new_node; + } - Size_++; + Size_++; } @@ -27,30 +29,29 @@ template void DoublyLinkedList :: Pop_back() { //if list is empty - if(Tail == NULL) //or Head == NULL - { - cout<<"Can't pop back the DLS is empty"<<'\n'; - return; - } + if(Tail == nullptr) //or Head == NULL + { + throw runtime_error("Can't pop back the DLS is empty"); + } - if(Tail == Head) // if there's only one element in the DLS - { - delete Tail; - Tail = NULL; - Head = NULL; + if(Tail == Head) // if there's only one element in the DLS + { + delete Tail; + Tail = nullptr; + Head = nullptr; - } - else - { - Node* previous_node = Tail->prev; + } + else + { + Node* previous_node = Tail->prev; - delete Tail; + delete Tail; - Tail = previous_node; - Tail->next = NULL; - } + Tail = previous_node; + Tail->next = nullptr; + } - Size_--; + Size_--; } @@ -58,47 +59,46 @@ template void DoublyLinkedList :: Push_front(T val) { - Node* new_node = new Node(val); + auto* new_node = new Node(move(val)); - new_node->next = Head; - if(Head != NULL) - { - Head->prev = new_node; + new_node->next = Head; + if(Head != nullptr) + { + Head->prev = new_node; - } - Head = new_node; - if(Tail == NULL) - { - Tail = Head; - } + } + Head = new_node; + if(Tail == nullptr) + { + Tail = Head; + } - Size_++; + Size_++; } template void DoublyLinkedList :: Pop_front() { - if(Head == NULL) //if dls is empty can't pop - { - cout<<"Can't pop front the DLS is empty"<<'\n'; - return; - } - - Node* next_node = Head->next; - delete Head; - Head = next_node; - - if(Head == NULL) //if we popped the last element - { - Tail = NULL; - } - else - { - Head->prev = NULL; - } - -Size_--; + if(Head == nullptr) //if dls is empty can't pop + { + throw runtime_error("Can't pop front the DLS is empty"); + } + + Node* next_node = Head->next; + delete Head; + Head = next_node; + + if(Head == nullptr) //if we popped the last element + { + Tail = nullptr; + } + else + { + Head->prev = nullptr; + } + + Size_--; } @@ -106,22 +106,22 @@ template void DoublyLinkedList :: Add_before(Node* node, T val) { - Node* new_node = new Node(val); - new_node->next = node; - new_node->prev = node->prev; - node->prev = new_node; + auto* new_node = new Node(move(val)); + new_node->next = node; + new_node->prev = node->prev; + node->prev = new_node; - if(new_node->prev != NULL) - { - new_node->prev->next = new_node; - } + if(new_node->prev != nullptr) + { + new_node->prev->next = new_node; + } - if(Head == node) - { - Head = new_node; + if(Head == node) + { + Head = new_node; - } - Size_++; + } + Size_++; } @@ -130,44 +130,44 @@ template void DoublyLinkedList :: Add_after(Node* node,T val) { - Node* new_node = new Node(val); - new_node->prev = node; - new_node->next = node->next; - node->next = new_node; + auto* new_node = new Node(move(val)); + new_node->prev = node; + new_node->next = node->next; + node->next = new_node; - if(new_node->next != NULL) - { - new_node->next->prev = new_node; + if(new_node->next != nullptr) + { + new_node->next->prev = new_node; - } + } - if(Tail == node) - { - Tail = new_node; - } + if(Tail == node) + { + Tail = new_node; + } -Size_++; + Size_++; } template -void DoublyLinkedList :: Display() +void DoublyLinkedList :: Display() const { - if(Size_ == 0) - { - cout<<"Linked List is empty"; - } - else - { - for(Node* tmp_ptr = Head;tmp_ptr!= NULL; tmp_ptr= tmp_ptr->next) + if(Size_ == 0) + { + cout<<"Linked List is empty"; + } + else + { + for(Node* tmp_ptr = Head;tmp_ptr!= nullptr; tmp_ptr= tmp_ptr->next) { - cout<data<<" "; + cout<data<<" "; } - } -cout<<'\n'; + } + cout<<'\n'; } @@ -179,91 +179,90 @@ void DoublyLinkedList :: Clear() Node* tmp = Head; if(Size_ == 0 ) { - cout<<" all cleared linked list is empty"<<'\n'; - return; + throw runtime_error(" all cleared linked list is empty"); } - while(Head != NULL) + while(Head != nullptr) { - Head = Head->next; - delete tmp; - tmp = Head; + Head = Head->next; + delete tmp; + tmp = Head; } - cout<<" all cleared linked list is empty"<<'\n'; -Tail = NULL; -Size_ = 0; + cout<<" all cleared linked list is empty"<<'\n'; + Tail = nullptr; + Size_ = 0; } template void DoublyLinkedList :: Insert_at(T val ,int position) { - if(position >Size_ || position <= 0) + if(position >Size_ || position <= 0) { - cout<<"invalid position choose a position between 1 and size "<<'\n'; - cout<<"size is: "<* tmp = Head; - //get a pointer of that position that position - for(int i =1 ; i<=position-1 ; i++,tmp = tmp->next); - Add_before(tmp,val); - } + else + { + Node* tmp = Head; + //get a pointer of that position that position + for(int i =1 ; i<=position-1 ; i++,tmp = tmp->next); + Add_before(tmp,val); + } - } +} template void DoublyLinkedList :: Delete_at(int position) { - if(Size_ ==0) - { - cout<<"Can't delete DLS is empty "<<'\n'; - return; - } + if(Size_ ==0) + { + cout<<"Can't delete DLS is empty "<<'\n'; + return; + } - if(position >Size_ || position < 0) + if(position >Size_ || position < 0) { - cout<<"invalid position choose a position between 1 and size "<<'\n'; - cout<<"size is: "<* tmp = Head; + //general deletion of nodes in DLS + Node* tmp = Head; - for(int i = 1; i <= position-1; i++,tmp = tmp->next); + for(int i = 1; i <= position-1; i++,tmp = tmp->next); - if(tmp->next != NULL) - { - tmp->next->prev = tmp->prev; - } + if(tmp->next != nullptr) + { + tmp->next->prev = tmp->prev; + } - if(tmp->prev != NULL) - { - tmp->prev->next = tmp->next; + if(tmp->prev != nullptr) + { + tmp->prev->next = tmp->next; - } + } - if(Head == tmp) - { - Head = tmp->next; + if(Head == tmp) + { + Head = tmp->next; - } + } - if(Tail == tmp) - { - Tail = Tail->prev; - } + if(Tail == tmp) + { + Tail = Tail->prev; + } -delete tmp; -Size_--; + delete tmp; + Size_--; } diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.h b/data-structures/DoublyLinkedList/doubly_linked_list.h index 4acf21fb..cf6976f6 100644 --- a/data-structures/DoublyLinkedList/doubly_linked_list.h +++ b/data-structures/DoublyLinkedList/doubly_linked_list.h @@ -1,68 +1,66 @@ +#pragma once #include -using namespace std; - template - class Node{ - //each node has a next pointer and a previous pinter - public: - T data; - Node* next; - Node* prev; + //each node has a next pointer and a previous pinter +public: + T data; + Node* next; + Node* prev; - Node() - { - next = NULL; - prev = NULL; + Node() + { + next = nullptr; + prev = nullptr; - } + } - Node( T value) - { - data = value; - next = NULL; - prev = NULL; - } + explicit Node(T&& value) : + data(std::move(value)), + next(nullptr), + prev(nullptr) + { + } }; template - class DoublyLinkedList{ - public: - Node* Head; - Node* Tail; - int Size_; +private: + Node* Head; + Node* Tail; + int Size_; - DoublyLinkedList() - { - Head = NULL; - Tail = NULL; - Size_ = 0; +public: + DoublyLinkedList(): + Head(nullptr), + Tail(nullptr), + Size_(0) + { } - void Push_back(T val); //append - void Pop_back(); - void Push_front(T val); //prepend - void Pop_front(); - void Display(); - void Clear(); - void Insert_at(T val,int position); - void Delete_at(int position); - void Add_before(Node* node, T val); - void Add_after(Node* node,T val); - - ~DoublyLinkedList() - { - cout<<"destructor is called"<<'\n'; - Clear(); - } + void Push_back(T val); //append + void Pop_back(); + void Push_front(T val); //prepend + void Pop_front(); + void Display() const; + void Clear(); + void Insert_at(T val, int position); + void Delete_at(int position); + void Add_before(Node* node, T val); + void Add_after(Node* node,T val); + + ~DoublyLinkedList() + { + std::cout<<"destructor is called"<<'\n'; + Clear(); + } }; From 639954b48de622817cc0e796f08dab6824f789d2 Mon Sep 17 00:00:00 2001 From: Abhishek-iiit Date: Sun, 4 Oct 2020 07:53:39 +0530 Subject: [PATCH 249/285] added Selection Sort --- sorting/selection_sort.cpp | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sorting/selection_sort.cpp diff --git a/sorting/selection_sort.cpp b/sorting/selection_sort.cpp new file mode 100644 index 00000000..72de9232 --- /dev/null +++ b/sorting/selection_sort.cpp @@ -0,0 +1,45 @@ +// C++ implementation of Bubble Sort(Optimised Solution). +// +// The All ▲lgorithms Project +// +// https://allalgorithms.com/ +// https://github.com/allalgorithms/cpp +// +// Contributed by: Abhishek Jaiswal +// Github: @Abhishek-iiit +// +#include +#include + +using namespace std; + +void selectionSort(int *array, int size) { + int i, j, imin; + for(i = 0; i>n; + int arr[n]; + cout<<"Input the number one-by-one :"<>arr[i]; + } + selectionSort(arr,n); + cout<<"Sorted array:"< Date: Sun, 4 Oct 2020 07:55:18 +0530 Subject: [PATCH 250/285] Delete selection_sort.cpp --- sorting/selection_sort.cpp | 45 -------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 sorting/selection_sort.cpp diff --git a/sorting/selection_sort.cpp b/sorting/selection_sort.cpp deleted file mode 100644 index 72de9232..00000000 --- a/sorting/selection_sort.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// C++ implementation of Bubble Sort(Optimised Solution). -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Abhishek Jaiswal -// Github: @Abhishek-iiit -// -#include -#include - -using namespace std; - -void selectionSort(int *array, int size) { - int i, j, imin; - for(i = 0; i>n; - int arr[n]; - cout<<"Input the number one-by-one :"<>arr[i]; - } - selectionSort(arr,n); - cout<<"Sorted array:"< Date: Sun, 4 Oct 2020 02:05:11 -0400 Subject: [PATCH 251/285] cleanup --- .DS_Store | Bin 6148 -> 6148 bytes .../Networks}/MAC-Address.cpp | 0 PALIN.CPP => algorithms/PALIN.CPP | 0 SplayTree.cpp => algorithms/SplayTree.cpp | 0 .../SublistSearch.cpp | 0 .../TicTac(maxmin).cpp | 0 .../backtracking}/All_Codes_Recursion.cpp | 0 .../backtracking}/N-Queen Problem.cpp | 0 .../backtracking}/sudoku_solver.cc | 0 .../data-structures}/BinarySearchTree.cpp | 0 .../data-structures}/Circular_Linked_List.cpp | 0 .../CircularlySinglyLinkedList.cpp | 0 .../CircularlySinglyLinkedList.h | 0 .../data-structures}/Deque/deque.c | 0 .../DoublyLinkedList/doubly_linked_list.cpp | 0 .../DoublyLinkedList/doubly_linked_list.h | 0 .../data-structures}/Doubly_Linked_List.cpp | 0 .../data-structures}/Find the Unique Element | 0 .../data-structures}/Trie.cpp | 0 .../data-structures}/avl-tree/AVL.cpp | 0 .../data-structures}/avl-tree/AVL.h | 0 .../data-structures}/binary_search_tree.cpp | 0 .../longest-continious-subset-to-zero | 0 .../hashmaps/pairs_with_difference_k.cpp | 46 ----- .../linkedlist/linkedLists.cpp | 0 .../linkedlist/linkedlist_adt.cpp | 193 ------------------ .../linkedlist/linkedlist_adt.hpp | 44 ---- .../red-black-tree/RedBlack.cpp | 0 .../red-black-tree/RedBlack.h | 0 .../data-structures}/segment_tree/a.out | Bin .../segment_tree/min_in_range.cpp | 0 .../segment_tree/sum_in_range.cpp | 0 algorithms/data-structures/stack/stack.cpp | 80 -------- .../stack/stacks_using_array.cpp | 0 .../inorder_traversal_without_recurrsion.cpp | 0 .../data-structures}/vector.cpp | 0 {dsu => algorithms/dsu}/naive_dsu.cpp | 0 .../dsu}/path_compression_in_dsu.cpp | 0 .../dsu}/union_by_rank_in_dsu.cpp | 0 .../dsu}/union_by_size_in_dsu.cpp | 0 .../dynamic-programming}/Floyd_Warshall.cpp | 0 .../dynamic-programming}/Sine_Series.CPP | 0 .../dynamic-programming}/WordBreakProblem.cpp | 0 .../dynamic-programming}/binomial_dp.cpp | 0 .../dynamic-programming}/digit_dp.cpp | 0 .../dynamic-programming}/gold_mine.cpp | 0 .../largest_divisible_pairs_subset.cpp | 0 .../largest_sum_contiguous_subarray.cpp | 0 algorithms/dynamic-programming/lis.cpp | 79 ++++--- .../longest_increasing_subsequence.cpp | 0 .../dynamic-programming}/maxRectangle.cpp | 0 .../maximum-size-subset-with-given-sum.cpp | 0 .../dynamic-programming}/pretty_printing.c | 0 .../subarrays_with_product_less_than_k.cpp | 0 dynamic.cpp => algorithms/dynamic.cpp | 0 .../factorial_sum.cpp | 0 .../floyd_warshall.cpp | 0 .../graphs/Kosaraju_ALgorithm.cpp | 0 {graphs => algorithms/graphs}/Kruskal's.cpp | 0 .../graphs/MST_using_Kruskals.cpp | 0 algorithms/graphs/bfs.cpp | 146 ++++++------- .../graphs}/count_triangle.cpp | 0 .../graphs}/cpp-graph_class.cpp | 0 algorithms/graphs/dfs.cpp | 114 +++++------ .../graphs}/find_articulation_points.cpp | 0 {graphs => algorithms/graphs}/grith.cpp | 0 {graphs => algorithms/graphs}/hamiltonion.cpp | 0 {graphs => algorithms/graphs}/kosaraju.cpp | 0 {graphs => algorithms/graphs}/kruskal.cpp | 0 .../graphs}/kruskals_017.cpp | 0 .../graphs/suffix_tree_ukkonen.cpp | 0 .../graphs}/topological sort.(matrix).cpp | 0 .../graphs}/topological sort.cpp | 0 .../graphs}/topological_sort.cpp | 0 {greedy => algorithms/greedy}/statusCheck.cpp | 1 + .../image-processing}/RGBtoGrey.cpp | 0 {math => algorithms/math}/AverageCalc.cpp | 0 .../math}/BITOBYT_OCT_LONG.cpp | 0 .../math}/Binomial Function.cpp | 0 .../math}/CHSERVE_OCT_LONG.cpp | 0 {math => algorithms/math}/Gauss Jordan.cpp | 0 .../math/Prime_number_check.cpp | 0 .../math}/binaryexponentiation.cpp | 0 {math => algorithms/math}/binfib.cpp | 0 .../math}/catalan_number_dynamic.cpp | 0 .../math}/catalan_number_recursive.cpp | 0 .../evenorodd => algorithms/math}/eveodd.cpp | 0 algorithms/math/factorial_loop.cpp | 21 +- {math => algorithms/math}/fibonacci.cpp | 0 {math => algorithms/math}/fibonacci_loop.cpp | 0 {math => algorithms/math}/kthpermutation.cpp | 0 {math => algorithms/math}/prime.cpp | 0 {math => algorithms/math}/prime_or_not.cpp | 0 .../math/squareroot.cpp | 0 .../matrix_linear.cpp | 1 + .../scheduling-algorithms}/sjf.cpp | 0 algorithms/scripts/format.js | 55 ----- algorithms/scripts/generate-readme.js | 152 -------------- algorithms/scripts/package.json | 18 -- algorithms/scripts/validate.js | 44 ---- .../searches}/FibonacciSearch.cpp | 0 .../searches}/binary_search_float.cpp | 0 .../searches}/interpolationSEARCH.cpp | 0 .../searches}/interpolation_search.cpp | 0 algorithms/searches/kth_largest.cpp | 40 ++++ .../trie_data_structure_String_search.cpp | 0 .../sorting}/3_way_quicksort.c | 0 .../sorting}/BucketSort.cpp | 0 {sorting => algorithms/sorting}/CombSort.cpp | 0 {sorting => algorithms/sorting}/CycleSort.cpp | 0 .../sorting}/PigeonholeSort.cpp | 0 algorithms/sorting/bubble_sort.cpp | 88 ++++---- .../sorting}/bucket_sort.cpp | 0 .../sorting}/cyclic_sort.cpp | 0 algorithms/sorting/insertion_sort.cpp | 106 +++++----- .../strings}/Aho-Corasick.cpp | 0 .../strings}/kmp_pattern_matching.cpp | 0 ...lexicographically_kth_ smallest_suffix.cpp | 0 .../strings}/palindrome_check.cpp | 0 .../strings}/pangram_check.cpp | 0 dynamic-programming/lis.cpp | 39 ---- graphs/BFS.cpp | 68 ------ graphs/DFS algo | 65 ------ graphs/Kosaraju.cpp | 69 ------- graphs/Kruskal.cpp | 125 ------------ graphs/tsp.o | Bin 3858 -> 0 bytes greedy/readme_statusCheckG.txt | 16 -- greedy/sampleInputs.txt | 28 --- host.py | 11 - math/ExtraLongFactorial.txt | 16 -- math/factorial_loop.cpp | 15 -- palindrome/palindrome_number.cpp | 39 ---- searches/k-th largest element in the array | 32 --- sorting/Insertion_Sort.cpp | 47 ----- sorting/bubble_sort.cpp | 54 ----- w1.py | 83 -------- 136 files changed, 296 insertions(+), 1639 deletions(-) rename {Networks => algorithms/Networks}/MAC-Address.cpp (100%) rename PALIN.CPP => algorithms/PALIN.CPP (100%) rename SplayTree.cpp => algorithms/SplayTree.cpp (100%) rename SublistSearch.cpp => algorithms/SublistSearch.cpp (100%) rename {artificial-intelligence => algorithms/artificial-intelligence}/TicTac(maxmin).cpp (100%) rename {backtracking => algorithms/backtracking}/All_Codes_Recursion.cpp (100%) rename {backtracking => algorithms/backtracking}/N-Queen Problem.cpp (100%) rename {backtracking => algorithms/backtracking}/sudoku_solver.cc (100%) rename {data-structures => algorithms/data-structures}/BinarySearchTree.cpp (100%) rename {data-structures => algorithms/data-structures}/Circular_Linked_List.cpp (100%) rename {data-structures => algorithms/data-structures}/CircularlyLinkedList/CircularlySinglyLinkedList.cpp (100%) rename {data-structures => algorithms/data-structures}/CircularlyLinkedList/CircularlySinglyLinkedList.h (100%) rename {data-structures => algorithms/data-structures}/Deque/deque.c (100%) rename {data-structures => algorithms/data-structures}/DoublyLinkedList/doubly_linked_list.cpp (100%) rename {data-structures => algorithms/data-structures}/DoublyLinkedList/doubly_linked_list.h (100%) rename {data-structures => algorithms/data-structures}/Doubly_Linked_List.cpp (100%) rename {data-structures => algorithms/data-structures}/Find the Unique Element (100%) rename {data-structures => algorithms/data-structures}/Trie.cpp (100%) rename {data-structures => algorithms/data-structures}/avl-tree/AVL.cpp (100%) rename {data-structures => algorithms/data-structures}/avl-tree/AVL.h (100%) rename {data-structures => algorithms/data-structures}/binary_search_tree.cpp (100%) rename {data-structures => algorithms/data-structures}/hashmaps/longest-continious-subset-to-zero (100%) delete mode 100644 algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp rename {data-structures => algorithms/data-structures}/linkedlist/linkedLists.cpp (100%) delete mode 100644 algorithms/data-structures/linkedlist/linkedlist_adt.cpp delete mode 100644 algorithms/data-structures/linkedlist/linkedlist_adt.hpp rename {data-structures => algorithms/data-structures}/red-black-tree/RedBlack.cpp (100%) rename {data-structures => algorithms/data-structures}/red-black-tree/RedBlack.h (100%) rename {data-structures => algorithms/data-structures}/segment_tree/a.out (100%) rename {data-structures => algorithms/data-structures}/segment_tree/min_in_range.cpp (100%) rename {data-structures => algorithms/data-structures}/segment_tree/sum_in_range.cpp (100%) delete mode 100644 algorithms/data-structures/stack/stack.cpp rename {data-structures => algorithms/data-structures}/stack/stacks_using_array.cpp (100%) rename {data-structures => algorithms/data-structures}/tree/inorder_traversal_without_recurrsion.cpp (100%) rename {data-structures => algorithms/data-structures}/vector.cpp (100%) rename {dsu => algorithms/dsu}/naive_dsu.cpp (100%) rename {dsu => algorithms/dsu}/path_compression_in_dsu.cpp (100%) rename {dsu => algorithms/dsu}/union_by_rank_in_dsu.cpp (100%) rename {dsu => algorithms/dsu}/union_by_size_in_dsu.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/Floyd_Warshall.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/Sine_Series.CPP (100%) rename {dynamic-programming => algorithms/dynamic-programming}/WordBreakProblem.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/binomial_dp.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/digit_dp.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/gold_mine.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/largest_divisible_pairs_subset.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/largest_sum_contiguous_subarray.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/longest_increasing_subsequence.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/maxRectangle.cpp (100%) rename dynamic-programming/Maximum size subset with given sum => algorithms/dynamic-programming/maximum-size-subset-with-given-sum.cpp (100%) rename {dynamic-programming => algorithms/dynamic-programming}/pretty_printing.c (100%) rename {dynamic-programming => algorithms/dynamic-programming}/subarrays_with_product_less_than_k.cpp (100%) rename dynamic.cpp => algorithms/dynamic.cpp (100%) rename The sum of all factorials of n! => algorithms/factorial_sum.cpp (100%) rename floyd_warshall.cpp => algorithms/floyd_warshall.cpp (100%) rename graphs/KosarajuALgorithm/Kosaraju_ALgorithm => algorithms/graphs/Kosaraju_ALgorithm.cpp (100%) rename {graphs => algorithms/graphs}/Kruskal's.cpp (100%) rename graphs/MST using Kruskals Algorithm => algorithms/graphs/MST_using_Kruskals.cpp (100%) rename {graphs => algorithms/graphs}/count_triangle.cpp (100%) rename {graphs => algorithms/graphs}/cpp-graph_class.cpp (100%) rename {graphs => algorithms/graphs}/find_articulation_points.cpp (100%) rename {graphs => algorithms/graphs}/grith.cpp (100%) rename {graphs => algorithms/graphs}/hamiltonion.cpp (100%) rename {graphs => algorithms/graphs}/kosaraju.cpp (100%) rename {graphs => algorithms/graphs}/kruskal.cpp (100%) rename {graphs => algorithms/graphs}/kruskals_017.cpp (100%) rename graphs/suffix tree ukkonen algorithm => algorithms/graphs/suffix_tree_ukkonen.cpp (100%) rename {graphs => algorithms/graphs}/topological sort.(matrix).cpp (100%) rename {graphs => algorithms/graphs}/topological sort.cpp (100%) rename {graphs => algorithms/graphs}/topological_sort.cpp (100%) rename {greedy => algorithms/greedy}/statusCheck.cpp (98%) rename {image-processing => algorithms/image-processing}/RGBtoGrey.cpp (100%) rename {math => algorithms/math}/AverageCalc.cpp (100%) rename {math => algorithms/math}/BITOBYT_OCT_LONG.cpp (100%) rename {math => algorithms/math}/Binomial Function.cpp (100%) rename {math => algorithms/math}/CHSERVE_OCT_LONG.cpp (100%) rename {math => algorithms/math}/Gauss Jordan.cpp (100%) rename math/Prime_number_check => algorithms/math/Prime_number_check.cpp (100%) rename {math => algorithms/math}/binaryexponentiation.cpp (100%) rename {math => algorithms/math}/binfib.cpp (100%) rename {math => algorithms/math}/catalan_number_dynamic.cpp (100%) rename {math => algorithms/math}/catalan_number_recursive.cpp (100%) rename {math/evenorodd => algorithms/math}/eveodd.cpp (100%) rename {math => algorithms/math}/fibonacci.cpp (100%) rename {math => algorithms/math}/fibonacci_loop.cpp (100%) rename {math => algorithms/math}/kthpermutation.cpp (100%) rename {math => algorithms/math}/prime.cpp (100%) rename {math => algorithms/math}/prime_or_not.cpp (100%) rename math/squareroot => algorithms/math/squareroot.cpp (100%) rename represent linear equation in form of matrix => algorithms/matrix_linear.cpp (94%) rename {scheduling-algorithms => algorithms/scheduling-algorithms}/sjf.cpp (100%) delete mode 100644 algorithms/scripts/format.js delete mode 100644 algorithms/scripts/generate-readme.js delete mode 100644 algorithms/scripts/package.json delete mode 100644 algorithms/scripts/validate.js rename {searches => algorithms/searches}/FibonacciSearch.cpp (100%) rename {searches => algorithms/searches}/binary_search_float.cpp (100%) rename {searches => algorithms/searches}/interpolationSEARCH.cpp (100%) rename {searches => algorithms/searches}/interpolation_search.cpp (100%) create mode 100644 algorithms/searches/kth_largest.cpp rename searches/trie_data_structure_String_search => algorithms/searches/trie_data_structure_String_search.cpp (100%) rename {sorting => algorithms/sorting}/3_way_quicksort.c (100%) rename {sorting => algorithms/sorting}/BucketSort.cpp (100%) rename {sorting => algorithms/sorting}/CombSort.cpp (100%) rename {sorting => algorithms/sorting}/CycleSort.cpp (100%) rename {sorting => algorithms/sorting}/PigeonholeSort.cpp (100%) rename {sorting => algorithms/sorting}/bucket_sort.cpp (100%) rename {sorting => algorithms/sorting}/cyclic_sort.cpp (100%) rename {strings => algorithms/strings}/Aho-Corasick.cpp (100%) rename {strings => algorithms/strings}/kmp_pattern_matching.cpp (100%) rename {strings => algorithms/strings}/lexicographically_kth_ smallest_suffix.cpp (100%) rename {strings => algorithms/strings}/palindrome_check.cpp (100%) rename {strings => algorithms/strings}/pangram_check.cpp (100%) delete mode 100644 dynamic-programming/lis.cpp delete mode 100644 graphs/BFS.cpp delete mode 100644 graphs/DFS algo delete mode 100644 graphs/Kosaraju.cpp delete mode 100644 graphs/Kruskal.cpp delete mode 100644 graphs/tsp.o delete mode 100644 greedy/readme_statusCheckG.txt delete mode 100644 greedy/sampleInputs.txt delete mode 100644 host.py delete mode 100644 math/ExtraLongFactorial.txt delete mode 100644 math/factorial_loop.cpp delete mode 100644 palindrome/palindrome_number.cpp delete mode 100644 searches/k-th largest element in the array delete mode 100644 sorting/Insertion_Sort.cpp delete mode 100644 sorting/bubble_sort.cpp delete mode 100644 w1.py diff --git a/.DS_Store b/.DS_Store index e2c62656d5c7ec830b911a08f9e48d3094c3ef59..851d09b68395ab1520820e49f4e677c87f9f90ed 100644 GIT binary patch delta 94 zcmZoMXfc=|#>B`mu~2NHo}wr-0|Nsi1A_nqgC9dMgR5swesWUI#KPr_%#*LNc5fEr o5M4PcE-P?}|Pgvc6Z0NpPW6951J literal 6148 zcmeHK&2G~`5S~p#;{;G6QK>!pg2W+3>5nQZgcQ=`5D5^%2o8W+I}VAZ)Q)VYQ3*l0 z@D9Km@F<)(@*q3_e6zct*a;jFf*oo1ThD&8wm;AAdWlFh$Nnx+m53}9#$pB43gdn* zOIFaHD?lN~*r9|{ifK&UCAM)G1&jiJn*uy{H^?U!^VX%s`I}-E$JC>wGmN_4F!I3U zW#TrBD#j?3knf^Mgivi4vi2OQ6Dw?*c(zmH_FG{DC?R(qCx(SV(WKYZ<37k z(|z(r!yrlP^)I5ZR=l)cvaE_#xmtPQ45EpXy6HG+y74om(8vh#(oeb`9+Lwy9p_FQ z4x_LSKlhdB9(CxL+Vp@NYG*YUZ^2mnaz%U_{_cYu?`w`%rbig@F16@B@Ft@CY(&A$ zMOfGedKf!KJ`9#~sPH+*FM%I{ovzFk&bW6A8OLniWn^CEvxPXb7TLHowo(C|e%9rc zy~b%2Fbe$73h?@1qcAo!&K1g~1C=}i0E=)-Lz{mRIL6l4&^T9!9+*&}Kou(V5kshO z_-)N=Xq+ol;Ux6oL+CpTeL@lP?ik;ebP^4PrZx%~1+ogPsmm(w|LtF&|Fc2n$|ztI z_@@*Q#g@}*;+6E?y7Y3q*V-tjC~VA|E0iIq^mZ&8ycKVwNJF2^4PZm#Tp>I#^CKW- LFqKi@k1FsTRXNa! diff --git a/Networks/MAC-Address.cpp b/algorithms/Networks/MAC-Address.cpp similarity index 100% rename from Networks/MAC-Address.cpp rename to algorithms/Networks/MAC-Address.cpp diff --git a/PALIN.CPP b/algorithms/PALIN.CPP similarity index 100% rename from PALIN.CPP rename to algorithms/PALIN.CPP diff --git a/SplayTree.cpp b/algorithms/SplayTree.cpp similarity index 100% rename from SplayTree.cpp rename to algorithms/SplayTree.cpp diff --git a/SublistSearch.cpp b/algorithms/SublistSearch.cpp similarity index 100% rename from SublistSearch.cpp rename to algorithms/SublistSearch.cpp diff --git a/artificial-intelligence/TicTac(maxmin).cpp b/algorithms/artificial-intelligence/TicTac(maxmin).cpp similarity index 100% rename from artificial-intelligence/TicTac(maxmin).cpp rename to algorithms/artificial-intelligence/TicTac(maxmin).cpp diff --git a/backtracking/All_Codes_Recursion.cpp b/algorithms/backtracking/All_Codes_Recursion.cpp similarity index 100% rename from backtracking/All_Codes_Recursion.cpp rename to algorithms/backtracking/All_Codes_Recursion.cpp diff --git a/backtracking/N-Queen Problem.cpp b/algorithms/backtracking/N-Queen Problem.cpp similarity index 100% rename from backtracking/N-Queen Problem.cpp rename to algorithms/backtracking/N-Queen Problem.cpp diff --git a/backtracking/sudoku_solver.cc b/algorithms/backtracking/sudoku_solver.cc similarity index 100% rename from backtracking/sudoku_solver.cc rename to algorithms/backtracking/sudoku_solver.cc diff --git a/data-structures/BinarySearchTree.cpp b/algorithms/data-structures/BinarySearchTree.cpp similarity index 100% rename from data-structures/BinarySearchTree.cpp rename to algorithms/data-structures/BinarySearchTree.cpp diff --git a/data-structures/Circular_Linked_List.cpp b/algorithms/data-structures/Circular_Linked_List.cpp similarity index 100% rename from data-structures/Circular_Linked_List.cpp rename to algorithms/data-structures/Circular_Linked_List.cpp diff --git a/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp b/algorithms/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp similarity index 100% rename from data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp rename to algorithms/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.cpp diff --git a/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h b/algorithms/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h similarity index 100% rename from data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h rename to algorithms/data-structures/CircularlyLinkedList/CircularlySinglyLinkedList.h diff --git a/data-structures/Deque/deque.c b/algorithms/data-structures/Deque/deque.c similarity index 100% rename from data-structures/Deque/deque.c rename to algorithms/data-structures/Deque/deque.c diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.cpp b/algorithms/data-structures/DoublyLinkedList/doubly_linked_list.cpp similarity index 100% rename from data-structures/DoublyLinkedList/doubly_linked_list.cpp rename to algorithms/data-structures/DoublyLinkedList/doubly_linked_list.cpp diff --git a/data-structures/DoublyLinkedList/doubly_linked_list.h b/algorithms/data-structures/DoublyLinkedList/doubly_linked_list.h similarity index 100% rename from data-structures/DoublyLinkedList/doubly_linked_list.h rename to algorithms/data-structures/DoublyLinkedList/doubly_linked_list.h diff --git a/data-structures/Doubly_Linked_List.cpp b/algorithms/data-structures/Doubly_Linked_List.cpp similarity index 100% rename from data-structures/Doubly_Linked_List.cpp rename to algorithms/data-structures/Doubly_Linked_List.cpp diff --git a/data-structures/Find the Unique Element b/algorithms/data-structures/Find the Unique Element similarity index 100% rename from data-structures/Find the Unique Element rename to algorithms/data-structures/Find the Unique Element diff --git a/data-structures/Trie.cpp b/algorithms/data-structures/Trie.cpp similarity index 100% rename from data-structures/Trie.cpp rename to algorithms/data-structures/Trie.cpp diff --git a/data-structures/avl-tree/AVL.cpp b/algorithms/data-structures/avl-tree/AVL.cpp similarity index 100% rename from data-structures/avl-tree/AVL.cpp rename to algorithms/data-structures/avl-tree/AVL.cpp diff --git a/data-structures/avl-tree/AVL.h b/algorithms/data-structures/avl-tree/AVL.h similarity index 100% rename from data-structures/avl-tree/AVL.h rename to algorithms/data-structures/avl-tree/AVL.h diff --git a/data-structures/binary_search_tree.cpp b/algorithms/data-structures/binary_search_tree.cpp similarity index 100% rename from data-structures/binary_search_tree.cpp rename to algorithms/data-structures/binary_search_tree.cpp diff --git a/data-structures/hashmaps/longest-continious-subset-to-zero b/algorithms/data-structures/hashmaps/longest-continious-subset-to-zero similarity index 100% rename from data-structures/hashmaps/longest-continious-subset-to-zero rename to algorithms/data-structures/hashmaps/longest-continious-subset-to-zero diff --git a/algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp b/algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp deleted file mode 100644 index ebdcedfa..00000000 --- a/algorithms/data-structures/hashmaps/pairs_with_difference_k.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * You are given with an array of integers and an integer K. - * Write a program to find and print all pairs which have difference K. - * - * Sample Input 1 : - * 4 - * 5 1 2 4 - * 3 - * Sample Output 1 : - * 2 5 - * 1 4 - * */ - -#include -using namespace std; - -void printPairs(int *input, int n, int k) -{ - - int hash[10000]; - for (int i = 0; i < n; i++) - { - for (int j = i + 1; j < n; j++) - { - if ((input[i] - input[j]) == k) - cout << input[j] << " " << input[i] << endl; - else if ((input[j] - input[i]) == k) - cout << input[i] << " " << input[j] << endl; - } - } -} - -int main() -{ - int n; - cin >> n; - int *input = new int[n]; - for (int i = 0; i < n; i++) - { - cin >> input[i]; - } - int k; - cin >> k; - printPairs(input, n, k); -} diff --git a/data-structures/linkedlist/linkedLists.cpp b/algorithms/data-structures/linkedlist/linkedLists.cpp similarity index 100% rename from data-structures/linkedlist/linkedLists.cpp rename to algorithms/data-structures/linkedlist/linkedLists.cpp diff --git a/algorithms/data-structures/linkedlist/linkedlist_adt.cpp b/algorithms/data-structures/linkedlist/linkedlist_adt.cpp deleted file mode 100644 index 09a10f67..00000000 --- a/algorithms/data-structures/linkedlist/linkedlist_adt.cpp +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include "linkedlist_adt.h" -using namespace std; - -/* - Constructor for Node class -*/ -Node::Node(int value) -{ - this->data = value; - this->next = NULL; -} - -/* - Constructor for LinkedList Class -*/ -LinkedList::LinkedList() -{ - this->length = 0; - this->head = NULL; -} - -/* - Destructor for LinkedList class -*/ -LinkedList::~LinkedList() -{ - Node *next_node=NULL; - for (Node *node_ptr=this->head; node_ptr != NULL; node_ptr=next_node) { - next_node = node_ptr->next; - delete node_ptr; - } -} - -/* - Returns curret size of linkedList -*/ -int LinkedList::size() const -{ - return(this->length); -} - -bool LinkedList::empty() const -{ - return(this->length == 0); -} - -/* - Prints content of Linked List -*/ -void LinkedList::print() const -{ - Node *curr = head; - while (curr != NULL) { - cout << curr->data << endl; - curr = curr->next; - } -} - -int& LinkedList::at(int index) -{ - if(index < 0 || index >= this->length) { - throw out_of_range("index out of bounds"); } - Node *node_ptr; - for (node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { - if (index == 0) { - break; - } - index--; - } - return node_ptr->data; -} - -/* - Find the node with given value -*/ -Node* LinkedList::find(int value) const { - Node *node_ptr; - for (node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { - if (value == node_ptr->data) - return node_ptr; - } - return NULL; -} - -bool LinkedList::contains(int value) const{ - Node* node_ptr = find(value); - return node_ptr != NULL; -} - -/* - Add a node at last in list -*/ -void LinkedList::append(int value) { - Node *new_node = NULL; - if (this->head == NULL) { - new_node = new Node(value); - this->head = new_node; - } - else { - Node *last_node = NULL; - for (Node *node_ptr=this->head; node_ptr != NULL; node_ptr=node_ptr->next) { - last_node = node_ptr; - } - new_node = new Node(value); - last_node->next = new_node; - } - this->length++; -} - -/* - Add a node in list from head -*/ -void LinkedList::prepend(int value) { - Node *first_node = new Node(value);; - first_node->next = this->head; - this->head = first_node; - this->length++; -} - -/* - Remove target node from linked list -*/ -void LinkedList::remove(Node* target_node_ptr) { - Node* prev_ptr=NULL; - Node *node_ptr; - for (node_ptr = this->head; node_ptr != NULL && node_ptr != target_node_ptr; node_ptr = node_ptr->next) { - prev_ptr = node_ptr; - } - if (node_ptr == NULL) { - throw target_node_ptr; - } - else if (prev_ptr == NULL) { - this->head = target_node_ptr->next; - delete target_node_ptr; - } - else { - prev_ptr->next = target_node_ptr->next; - delete target_node_ptr; - Node *prev_ptr = this->head; - } -} - -/* - Erase node at index from List -*/ -void LinkedList::erase(int index){ - if (index < 0 || index >= this->length) - throw out_of_range ("index out of bounds"); - Node *prev_ptr = NULL; - Node *node_ptr; - for (node_ptr = this->head; node_ptr != NULL; node_ptr = node_ptr->next) { - if (index == 0) - break; - index--; - prev_ptr = node_ptr; - } - if (prev_ptr == NULL) { - this->head = node_ptr->next; - delete node_ptr; - } - else { - prev_ptr->next = node_ptr->next; - delete node_ptr; - } -} -/* -int main() -{ - LinkedList* list = new LinkedList(); - cout << "Empty = " << boolalpha << list->empty() << endl; - for(int i=0; i < 6; i++) { - list->append(i); - cout << "List size = " << list->size() << endl; - list->print(); - } - for(int j=11; j > 6; j--) { - list->prepend(j); - cout << "List size = " << list->size() << endl; - list->print(); - } - cout << "Empty = " << boolalpha << list->empty() << endl; - cout << "list->at(5) = " << list->at(5) << endl; - cout << "list->at(1) = " << list->at(1) << endl; - cout << "contains(55) = " << list->contains(55) << endl; - cout << "contains(4) = " << list->contains(4) << endl; - list->erase(0); - list->print(); - list->erase(5); - list->print(); -} -*/ \ No newline at end of file diff --git a/algorithms/data-structures/linkedlist/linkedlist_adt.hpp b/algorithms/data-structures/linkedlist/linkedlist_adt.hpp deleted file mode 100644 index 0295664a..00000000 --- a/algorithms/data-structures/linkedlist/linkedlist_adt.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - @Gaurav YadavCS-11 Asn 2, linkedlist_adt.h - Purpose: Implements Linkedlist class - - @author Gaurav Yadav - @email gauravyug@gmai.com - @version 1.1 - @date 13-Oct-18 -*/ - -#ifndef ADT_LINKEDLIST_H_ -#define ADT_LINKEDLIST_H_ - -/* - Linked List Node -*/ -class Node -{ - public: - int data; - Node* next; - public: - Node(int value); -}; - -class LinkedList -{ - private: - Node* head; - int length; - public: - LinkedList(); - ~LinkedList(); - int size() const; - bool empty() const; - void print() const; - int& at(int index); - Node* find(int value) const; - bool contains(int value) const; - void append(int value); - void prepend(int value); - void remove(Node* node_ptr); void erase(int index); -}; -#endif \ No newline at end of file diff --git a/data-structures/red-black-tree/RedBlack.cpp b/algorithms/data-structures/red-black-tree/RedBlack.cpp similarity index 100% rename from data-structures/red-black-tree/RedBlack.cpp rename to algorithms/data-structures/red-black-tree/RedBlack.cpp diff --git a/data-structures/red-black-tree/RedBlack.h b/algorithms/data-structures/red-black-tree/RedBlack.h similarity index 100% rename from data-structures/red-black-tree/RedBlack.h rename to algorithms/data-structures/red-black-tree/RedBlack.h diff --git a/data-structures/segment_tree/a.out b/algorithms/data-structures/segment_tree/a.out similarity index 100% rename from data-structures/segment_tree/a.out rename to algorithms/data-structures/segment_tree/a.out diff --git a/data-structures/segment_tree/min_in_range.cpp b/algorithms/data-structures/segment_tree/min_in_range.cpp similarity index 100% rename from data-structures/segment_tree/min_in_range.cpp rename to algorithms/data-structures/segment_tree/min_in_range.cpp diff --git a/data-structures/segment_tree/sum_in_range.cpp b/algorithms/data-structures/segment_tree/sum_in_range.cpp similarity index 100% rename from data-structures/segment_tree/sum_in_range.cpp rename to algorithms/data-structures/segment_tree/sum_in_range.cpp diff --git a/algorithms/data-structures/stack/stack.cpp b/algorithms/data-structures/stack/stack.cpp deleted file mode 100644 index 878a4526..00000000 --- a/algorithms/data-structures/stack/stack.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// A Stack is an abstract data type that serves as a collection -// of elements, with two principal operations are push & pop -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/data-scructures/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: ANUJ MODI -// Github: @descifrado -// -#include -#define max 50 -struct stack -{ - int ch[max]; - int top; -}; -typedef struct stack Stack; -void push(Stack *s, int x) -{ - if(s->top==max-1) - printf("ERROR: Stack Overflow\n"); - else - s->ch[++s->top]=x; -} -int pop(Stack *s) -{ - if(s->top==-1) - { - printf("ERROR: Stack Underflow\n"); - } - else - return (s->ch[s->top--]); -} -int main() -{ - printf("Stack Has Been Initiated...\n"); - Stack s; - s.top=-1; - int c; - while(1) - { - printf("\nEnter 1 to push an element\nEnter 2 to pop an element\nEnter 3 to display all the content of stack\nEnter 0 to exit\n"); - scanf("%d",&c); - switch(c) - { - case 0: return 0; - case 1: - { - printf("Enter element to be pushed\n"); - int x; - scanf("%d",&x); - push(&s,x); - printf("Element successfully pushed\n"); - break; - } - case 2: - { - printf("Poped Element Is %d\n",pop(&s)); - break; - } - case 3: - { - printf("Stack has the following content in order LIFO\n"); - int i; - for(i=s.top;i>=0;i--) - { - printf("%d ",s.ch[i]); - } - break; - } - default: - { - printf("Wrong Choice\n"); - } - } - } -} diff --git a/data-structures/stack/stacks_using_array.cpp b/algorithms/data-structures/stack/stacks_using_array.cpp similarity index 100% rename from data-structures/stack/stacks_using_array.cpp rename to algorithms/data-structures/stack/stacks_using_array.cpp diff --git a/data-structures/tree/inorder_traversal_without_recurrsion.cpp b/algorithms/data-structures/tree/inorder_traversal_without_recurrsion.cpp similarity index 100% rename from data-structures/tree/inorder_traversal_without_recurrsion.cpp rename to algorithms/data-structures/tree/inorder_traversal_without_recurrsion.cpp diff --git a/data-structures/vector.cpp b/algorithms/data-structures/vector.cpp similarity index 100% rename from data-structures/vector.cpp rename to algorithms/data-structures/vector.cpp diff --git a/dsu/naive_dsu.cpp b/algorithms/dsu/naive_dsu.cpp similarity index 100% rename from dsu/naive_dsu.cpp rename to algorithms/dsu/naive_dsu.cpp diff --git a/dsu/path_compression_in_dsu.cpp b/algorithms/dsu/path_compression_in_dsu.cpp similarity index 100% rename from dsu/path_compression_in_dsu.cpp rename to algorithms/dsu/path_compression_in_dsu.cpp diff --git a/dsu/union_by_rank_in_dsu.cpp b/algorithms/dsu/union_by_rank_in_dsu.cpp similarity index 100% rename from dsu/union_by_rank_in_dsu.cpp rename to algorithms/dsu/union_by_rank_in_dsu.cpp diff --git a/dsu/union_by_size_in_dsu.cpp b/algorithms/dsu/union_by_size_in_dsu.cpp similarity index 100% rename from dsu/union_by_size_in_dsu.cpp rename to algorithms/dsu/union_by_size_in_dsu.cpp diff --git a/dynamic-programming/Floyd_Warshall.cpp b/algorithms/dynamic-programming/Floyd_Warshall.cpp similarity index 100% rename from dynamic-programming/Floyd_Warshall.cpp rename to algorithms/dynamic-programming/Floyd_Warshall.cpp diff --git a/dynamic-programming/Sine_Series.CPP b/algorithms/dynamic-programming/Sine_Series.CPP similarity index 100% rename from dynamic-programming/Sine_Series.CPP rename to algorithms/dynamic-programming/Sine_Series.CPP diff --git a/dynamic-programming/WordBreakProblem.cpp b/algorithms/dynamic-programming/WordBreakProblem.cpp similarity index 100% rename from dynamic-programming/WordBreakProblem.cpp rename to algorithms/dynamic-programming/WordBreakProblem.cpp diff --git a/dynamic-programming/binomial_dp.cpp b/algorithms/dynamic-programming/binomial_dp.cpp similarity index 100% rename from dynamic-programming/binomial_dp.cpp rename to algorithms/dynamic-programming/binomial_dp.cpp diff --git a/dynamic-programming/digit_dp.cpp b/algorithms/dynamic-programming/digit_dp.cpp similarity index 100% rename from dynamic-programming/digit_dp.cpp rename to algorithms/dynamic-programming/digit_dp.cpp diff --git a/dynamic-programming/gold_mine.cpp b/algorithms/dynamic-programming/gold_mine.cpp similarity index 100% rename from dynamic-programming/gold_mine.cpp rename to algorithms/dynamic-programming/gold_mine.cpp diff --git a/dynamic-programming/largest_divisible_pairs_subset.cpp b/algorithms/dynamic-programming/largest_divisible_pairs_subset.cpp similarity index 100% rename from dynamic-programming/largest_divisible_pairs_subset.cpp rename to algorithms/dynamic-programming/largest_divisible_pairs_subset.cpp diff --git a/dynamic-programming/largest_sum_contiguous_subarray.cpp b/algorithms/dynamic-programming/largest_sum_contiguous_subarray.cpp similarity index 100% rename from dynamic-programming/largest_sum_contiguous_subarray.cpp rename to algorithms/dynamic-programming/largest_sum_contiguous_subarray.cpp diff --git a/algorithms/dynamic-programming/lis.cpp b/algorithms/dynamic-programming/lis.cpp index 879925b3..0ff515f5 100644 --- a/algorithms/dynamic-programming/lis.cpp +++ b/algorithms/dynamic-programming/lis.cpp @@ -1,42 +1,39 @@ -#include -#include -#include +#include +#include + +/* lis() returns the length of the longest increasing + subsequence in arr[] of size n */ +int lis( int arr[], int n ) +{ + int *lis, i, j, max = 0; + lis = (int*) malloc ( sizeof( int ) * n ); + + /* Initialize LIS values for all indexes */ + for (i = 0; i < n; i++ ) + lis[i] = 1; + + /* Compute optimized LIS values in bottom up manner */ + for (i = 1; i < n; i++ ) + for (j = 0; j < i; j++ ) + if ( arr[i] > arr[j] && lis[i] < lis[j] + 1) + lis[i] = lis[j] + 1; + + /* Pick maximum of all LIS values */ + for (i = 0; i < n; i++ ) + if (max < lis[i]) + max = lis[i]; + + /* Free memory to avoid memory leak */ + free(lis); + + return max; +} -const int INF = 2e9 + 10; - -void printArray(std :: vector arr){ - std :: cout << '['; - const int n = arr.size(); - for(int i = 0; i != n; ++ i){ - if(i) std :: cout << ", "; - std :: cout << arr[i]; - } - std :: cout << ']'; -} - -int LIS(std :: vector arr){ - const int n = arr.size() + 1; - int dp[n]; - dp[0] = -INF; - for(int i = 1; i < n; ++ i){ - dp[i] = INF; - } - int pos = 0; - for(int i = 0; i != n - 1; ++ i){ - int cur = std :: upper_bound(dp, dp + n, arr[i]) - dp; - if(dp[cur] > arr[i]) dp[cur] = arr[i]; - } - for(int i = 0; i != n; ++ i){ - if(dp[i] == INF) break; - pos = i; - } - return pos; -} - -int main(){ - std :: vector array = {3, 4, 5, 2, 6, 7}; - std :: cout << "The Longest Increasing sequence of "; - printArray(array); - std :: cout << " is " << LIS(array); - return 0; -} +int main() +{ + /* Driver program to find Longest Increasing Subsequence */ + int arr[] = { 10, 22, 9, 33, 21, 50, 41, 60 }; + int n = sizeof(arr)/sizeof(arr[0]); + printf("Length of lis is %d", lis( arr, n ) ); + return 0; +} diff --git a/dynamic-programming/longest_increasing_subsequence.cpp b/algorithms/dynamic-programming/longest_increasing_subsequence.cpp similarity index 100% rename from dynamic-programming/longest_increasing_subsequence.cpp rename to algorithms/dynamic-programming/longest_increasing_subsequence.cpp diff --git a/dynamic-programming/maxRectangle.cpp b/algorithms/dynamic-programming/maxRectangle.cpp similarity index 100% rename from dynamic-programming/maxRectangle.cpp rename to algorithms/dynamic-programming/maxRectangle.cpp diff --git a/dynamic-programming/Maximum size subset with given sum b/algorithms/dynamic-programming/maximum-size-subset-with-given-sum.cpp similarity index 100% rename from dynamic-programming/Maximum size subset with given sum rename to algorithms/dynamic-programming/maximum-size-subset-with-given-sum.cpp diff --git a/dynamic-programming/pretty_printing.c b/algorithms/dynamic-programming/pretty_printing.c similarity index 100% rename from dynamic-programming/pretty_printing.c rename to algorithms/dynamic-programming/pretty_printing.c diff --git a/dynamic-programming/subarrays_with_product_less_than_k.cpp b/algorithms/dynamic-programming/subarrays_with_product_less_than_k.cpp similarity index 100% rename from dynamic-programming/subarrays_with_product_less_than_k.cpp rename to algorithms/dynamic-programming/subarrays_with_product_less_than_k.cpp diff --git a/dynamic.cpp b/algorithms/dynamic.cpp similarity index 100% rename from dynamic.cpp rename to algorithms/dynamic.cpp diff --git a/The sum of all factorials of n! b/algorithms/factorial_sum.cpp similarity index 100% rename from The sum of all factorials of n! rename to algorithms/factorial_sum.cpp diff --git a/floyd_warshall.cpp b/algorithms/floyd_warshall.cpp similarity index 100% rename from floyd_warshall.cpp rename to algorithms/floyd_warshall.cpp diff --git a/graphs/KosarajuALgorithm/Kosaraju_ALgorithm b/algorithms/graphs/Kosaraju_ALgorithm.cpp similarity index 100% rename from graphs/KosarajuALgorithm/Kosaraju_ALgorithm rename to algorithms/graphs/Kosaraju_ALgorithm.cpp diff --git a/graphs/Kruskal's.cpp b/algorithms/graphs/Kruskal's.cpp similarity index 100% rename from graphs/Kruskal's.cpp rename to algorithms/graphs/Kruskal's.cpp diff --git a/graphs/MST using Kruskals Algorithm b/algorithms/graphs/MST_using_Kruskals.cpp similarity index 100% rename from graphs/MST using Kruskals Algorithm rename to algorithms/graphs/MST_using_Kruskals.cpp diff --git a/algorithms/graphs/bfs.cpp b/algorithms/graphs/bfs.cpp index 5b82036d..d2b504d6 100644 --- a/algorithms/graphs/bfs.cpp +++ b/algorithms/graphs/bfs.cpp @@ -1,98 +1,68 @@ -// -// Breadth-first search implementation in C++ -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/graphs/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Nikunj Taneja -// Github: @underscoreorcus -// -#include -#include - +#include using namespace std; - -class Graph +char mx[100][100]; +bool visited[100][100]; +int V,E,k,l,N,M; +bool isvalid(int x,int y) { - int V; // No. of vertices - - // Pointer to an array containing adjacency - // lists - list *adj; -public: - Graph(int V); // Constructor - - // function to add an edge to graph - void addEdge(int v, int w); - - // prints BFS traversal from a given source s - void BFS(int s); -}; - -Graph::Graph(int V) -{ - this->V = V; - adj = new list[V]; + if(x<=N && y<=M && x>=1 && y>=1) + return true; + return false; } - -void Graph::addEdge(int v, int w) +bool bfs(int x,int y) { - adj[v].push_back(w); // Add w to v’s list. -} - -void Graph::BFS(int s) + for(int i=1;i<100;i++) + for(int j=1;j<100;j++) + visited[i][j]=0; +queue > q; +q.push({x,y}); +visited[x][y]=1; +while(!q.empty()) { - // Mark all the vertices as not visited - bool *visited = new bool[V]; - for(int i = 0; i < V; i++) - visited[i] = false; - - // Create a queue for BFS - list queue; - - // Mark the current node as visited and enqueue it - visited[s] = true; - queue.push_back(s); - - // 'i' will be used to get all adjacent - // vertices of a vertex - list::iterator i; - - while(!queue.empty()) - { - // Dequeue a vertex from queue and print it - s = queue.front(); - cout << s << " "; - queue.pop_front(); - - // Get all adjacent vertices of the dequeued - // vertex s. If a adjacent has not been visited, - // then mark it visited and enqueue it - for (i = adj[s].begin(); i != adj[s].end(); ++i) - { - if (!visited[*i]) - { - visited[*i] = true; - queue.push_back(*i); - } - } - } + x=q.front().first; + y=q.front().second; + visited[x][y]=true; + q.pop(); + if(isvalid(x,y+1) && !visited[x][y+1] && mx[x][y+1]==mx[x][y]) + q.push({x,y+1}); + if(isvalid(x,y-1) && !visited[x][y-1] && mx[x][y-1]==mx[x][y]) + q.push({x,y-1}); + if(isvalid(x+1,y) && !visited[x+1][y] && mx[x+1][y]==mx[x][y]) + q.push({x+1,y}); + if(isvalid(x-1,y) && !visited[x-1][y] && mx[x-1][y]==mx[x][y]) + q.push({x-1,y}); + int counter=0; + if(visited[x][y+1]) + counter++; + if(visited[x][y-1]) + counter++; + if(visited[x+1][y]) + counter++; + if(visited[x-1][y]) + counter++; + if(counter>1) + return true; + } - +return false; +} + int main() { - // Sample graph - Graph g(4); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); - g.addEdge(3, 3); - cout << "Following is Breadth First Traversal " - << "(starting from vertex 2) \n"; - g.BFS(2); + cin>>N>>M; + for(int i=1;i<=N;i++) + for(int j=1;j<=M;j++) + cin>>mx[i][j]; + for(int i=1;i<=N;i++) + for(int j=1;j<=M;j++) + if( bfs(i,j)){ + cout<<"Yes"; + return 0; + } + + cout<<"No"; + + + return 0; } diff --git a/graphs/count_triangle.cpp b/algorithms/graphs/count_triangle.cpp similarity index 100% rename from graphs/count_triangle.cpp rename to algorithms/graphs/count_triangle.cpp diff --git a/graphs/cpp-graph_class.cpp b/algorithms/graphs/cpp-graph_class.cpp similarity index 100% rename from graphs/cpp-graph_class.cpp rename to algorithms/graphs/cpp-graph_class.cpp diff --git a/algorithms/graphs/dfs.cpp b/algorithms/graphs/dfs.cpp index 13778209..b0973491 100644 --- a/algorithms/graphs/dfs.cpp +++ b/algorithms/graphs/dfs.cpp @@ -1,69 +1,65 @@ -// -// Depth-first search algorithm implementation in C++ -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/graphs/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Nikunj Taneja -// Github: @underscoreorcus -// -#include -#include +#include +#include +#include +#include using namespace std; -// Graph class represents a directed graph -// using adjacency list representation -class Graph -{ - int V; - list *adj; - void DFSUtil(int v, bool visited[]); -public: - Graph(int V); - void addEdge(int v, int w); - void DFS(int v); -}; +vector visited; //this vector will mark visited components +vector > graph; //this will store the graph represented internally as an adjacency list +//this is because the adjacency list representation is the most suited to use DFS procedure on a given graph -Graph::Graph(int V) -{ - this->V = V; - adj = new list[V]; -} +int sz_connect_comp = 0; //this will store the size of current connected component (problem-specific feature) -void Graph::addEdge(int v, int w) +void dfs(int v) { - adj[v].push_back(w); // Add w to v’s list. -} - -void Graph::DFSUtil(int v, bool visited[]) -{ - visited[v] = true; - cout << v << " "; - list::iterator i; - for (i = adj[v].begin(); i != adj[v].end(); ++i) - if (!visited[*i]) - DFSUtil(*i, visited); -} -void Graph::DFS(int v) -{ - bool *visited = new bool[V]; - for (int i = 0; i < V; i++) - visited[i] = false; - DFSUtil(v, visited); + sz_connect_comp++; //"useful feature" performed on this DFS, this can vary from problem to problem + visited[v] = true; + + for(vector::iterator it = graph[v].begin(); it != graph[v].end(); it++) + { + if(! visited[*it]) //note that *it represents the adjacent vertex itself + { + dfs(*it); + } + } } int main() { - Graph g(4); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); - g.addEdge(3, 3); - cout << "Following is Depth First Traversal (starting from vertex 2)\n"; - g.DFS(2); - return 0; + int t; + cin >> t; + while(t--) + { + int n,m; + cin >> n >> m; + graph = vector > (n); //initialization of the graph + for(int i = 0; i < m; i++) + { + int u,v; + cin >> u >> v; + u--; + v--; + //these are added this way due to the friendship relation being mutual + graph.push_back(v); + graph[v].push_back(u); + } + int res = 0; // the number of fire escape routes + int ways = 1; // the number of ways to choose drill captains + visited = vector (n, 0); // initially mark all vertices as unvisited + for(int u = 0; u < n; u++) + { + //if the vertex was visited we skip it. + if(visited==true) + continue; + // if vertex was not visited it starts a new component + res++; // so we increase res + sz_connect_comp = 0; // init sz_connect_comp + dfs(u); // and calculate it through the dfs, marking visited vertices + // we multiply ways by sz_connect_comp modulo 1000000007 + ways = (long long)sz_connect_comp * ways % 1000000007; + } + printf("%d %d", res, ways); + + } + return 0; } diff --git a/graphs/find_articulation_points.cpp b/algorithms/graphs/find_articulation_points.cpp similarity index 100% rename from graphs/find_articulation_points.cpp rename to algorithms/graphs/find_articulation_points.cpp diff --git a/graphs/grith.cpp b/algorithms/graphs/grith.cpp similarity index 100% rename from graphs/grith.cpp rename to algorithms/graphs/grith.cpp diff --git a/graphs/hamiltonion.cpp b/algorithms/graphs/hamiltonion.cpp similarity index 100% rename from graphs/hamiltonion.cpp rename to algorithms/graphs/hamiltonion.cpp diff --git a/graphs/kosaraju.cpp b/algorithms/graphs/kosaraju.cpp similarity index 100% rename from graphs/kosaraju.cpp rename to algorithms/graphs/kosaraju.cpp diff --git a/graphs/kruskal.cpp b/algorithms/graphs/kruskal.cpp similarity index 100% rename from graphs/kruskal.cpp rename to algorithms/graphs/kruskal.cpp diff --git a/graphs/kruskals_017.cpp b/algorithms/graphs/kruskals_017.cpp similarity index 100% rename from graphs/kruskals_017.cpp rename to algorithms/graphs/kruskals_017.cpp diff --git a/graphs/suffix tree ukkonen algorithm b/algorithms/graphs/suffix_tree_ukkonen.cpp similarity index 100% rename from graphs/suffix tree ukkonen algorithm rename to algorithms/graphs/suffix_tree_ukkonen.cpp diff --git a/graphs/topological sort.(matrix).cpp b/algorithms/graphs/topological sort.(matrix).cpp similarity index 100% rename from graphs/topological sort.(matrix).cpp rename to algorithms/graphs/topological sort.(matrix).cpp diff --git a/graphs/topological sort.cpp b/algorithms/graphs/topological sort.cpp similarity index 100% rename from graphs/topological sort.cpp rename to algorithms/graphs/topological sort.cpp diff --git a/graphs/topological_sort.cpp b/algorithms/graphs/topological_sort.cpp similarity index 100% rename from graphs/topological_sort.cpp rename to algorithms/graphs/topological_sort.cpp diff --git a/greedy/statusCheck.cpp b/algorithms/greedy/statusCheck.cpp similarity index 98% rename from greedy/statusCheck.cpp rename to algorithms/greedy/statusCheck.cpp index bde68e1a..651a34b4 100644 --- a/greedy/statusCheck.cpp +++ b/algorithms/greedy/statusCheck.cpp @@ -1,3 +1,4 @@ +// The sum of all factorials of n! #include using namespace std; diff --git a/image-processing/RGBtoGrey.cpp b/algorithms/image-processing/RGBtoGrey.cpp similarity index 100% rename from image-processing/RGBtoGrey.cpp rename to algorithms/image-processing/RGBtoGrey.cpp diff --git a/math/AverageCalc.cpp b/algorithms/math/AverageCalc.cpp similarity index 100% rename from math/AverageCalc.cpp rename to algorithms/math/AverageCalc.cpp diff --git a/math/BITOBYT_OCT_LONG.cpp b/algorithms/math/BITOBYT_OCT_LONG.cpp similarity index 100% rename from math/BITOBYT_OCT_LONG.cpp rename to algorithms/math/BITOBYT_OCT_LONG.cpp diff --git a/math/Binomial Function.cpp b/algorithms/math/Binomial Function.cpp similarity index 100% rename from math/Binomial Function.cpp rename to algorithms/math/Binomial Function.cpp diff --git a/math/CHSERVE_OCT_LONG.cpp b/algorithms/math/CHSERVE_OCT_LONG.cpp similarity index 100% rename from math/CHSERVE_OCT_LONG.cpp rename to algorithms/math/CHSERVE_OCT_LONG.cpp diff --git a/math/Gauss Jordan.cpp b/algorithms/math/Gauss Jordan.cpp similarity index 100% rename from math/Gauss Jordan.cpp rename to algorithms/math/Gauss Jordan.cpp diff --git a/math/Prime_number_check b/algorithms/math/Prime_number_check.cpp similarity index 100% rename from math/Prime_number_check rename to algorithms/math/Prime_number_check.cpp diff --git a/math/binaryexponentiation.cpp b/algorithms/math/binaryexponentiation.cpp similarity index 100% rename from math/binaryexponentiation.cpp rename to algorithms/math/binaryexponentiation.cpp diff --git a/math/binfib.cpp b/algorithms/math/binfib.cpp similarity index 100% rename from math/binfib.cpp rename to algorithms/math/binfib.cpp diff --git a/math/catalan_number_dynamic.cpp b/algorithms/math/catalan_number_dynamic.cpp similarity index 100% rename from math/catalan_number_dynamic.cpp rename to algorithms/math/catalan_number_dynamic.cpp diff --git a/math/catalan_number_recursive.cpp b/algorithms/math/catalan_number_recursive.cpp similarity index 100% rename from math/catalan_number_recursive.cpp rename to algorithms/math/catalan_number_recursive.cpp diff --git a/math/evenorodd/eveodd.cpp b/algorithms/math/eveodd.cpp similarity index 100% rename from math/evenorodd/eveodd.cpp rename to algorithms/math/eveodd.cpp diff --git a/algorithms/math/factorial_loop.cpp b/algorithms/math/factorial_loop.cpp index 3256bdfc..5ed5bf6d 100644 --- a/algorithms/math/factorial_loop.cpp +++ b/algorithms/math/factorial_loop.cpp @@ -1,8 +1,15 @@ - long fact_l(int n) { - long out = 1; - for(int i = n; i > 1; i++) { - out *= i; - } +/* + @author Roman Korostenskyi + @date 08.10.2018 - return out; - } + Simple factorial algorithm based on loop +*/ +int factorial_loop(int n) { + int output = 1; + + for (int i = n; i >= 1; i--) { + output *= i; + } + + return output; +} \ No newline at end of file diff --git a/math/fibonacci.cpp b/algorithms/math/fibonacci.cpp similarity index 100% rename from math/fibonacci.cpp rename to algorithms/math/fibonacci.cpp diff --git a/math/fibonacci_loop.cpp b/algorithms/math/fibonacci_loop.cpp similarity index 100% rename from math/fibonacci_loop.cpp rename to algorithms/math/fibonacci_loop.cpp diff --git a/math/kthpermutation.cpp b/algorithms/math/kthpermutation.cpp similarity index 100% rename from math/kthpermutation.cpp rename to algorithms/math/kthpermutation.cpp diff --git a/math/prime.cpp b/algorithms/math/prime.cpp similarity index 100% rename from math/prime.cpp rename to algorithms/math/prime.cpp diff --git a/math/prime_or_not.cpp b/algorithms/math/prime_or_not.cpp similarity index 100% rename from math/prime_or_not.cpp rename to algorithms/math/prime_or_not.cpp diff --git a/math/squareroot b/algorithms/math/squareroot.cpp similarity index 100% rename from math/squareroot rename to algorithms/math/squareroot.cpp diff --git a/represent linear equation in form of matrix b/algorithms/matrix_linear.cpp similarity index 94% rename from represent linear equation in form of matrix rename to algorithms/matrix_linear.cpp index a8bf7041..d466729f 100644 --- a/represent linear equation in form of matrix +++ b/algorithms/matrix_linear.cpp @@ -1,3 +1,4 @@ +// represent linear equation in form of matrix #include #include diff --git a/scheduling-algorithms/sjf.cpp b/algorithms/scheduling-algorithms/sjf.cpp similarity index 100% rename from scheduling-algorithms/sjf.cpp rename to algorithms/scheduling-algorithms/sjf.cpp diff --git a/algorithms/scripts/format.js b/algorithms/scripts/format.js deleted file mode 100644 index 9864e6fc..00000000 --- a/algorithms/scripts/format.js +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -/** - * Usage: node format.js - * - * Author: Carlos Abraham Hernandez - * https://abranhe.com (abraham@abranhe.com) - */ - -const path = require('path'); -const glob = require('glob'); -const chalk = require('chalk'); -const decamelize = require('decamelize'); -const shell = require('child_process').execSync; - -const getFiles = (src, callback) => { - glob(src + '/**', callback); -}; - -getFiles('../', (err, res) => { - if (err) { - console.log('Error', err); - } else { - res.map((file) => { - // Accept only valid C++ Files (.cpp,.hpp,.h) - if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { - return; - } - - // Only avilable for Linux/Macos - // https://stackoverflow.com/a/41030518/7602110 - // Can be replaced in the future - shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`); - - if (file.replace(' ', '\\ ') !== decamelize(file)) { - console.log( - `The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}` - ); - - // Change file on git history - // https://stackoverflow.com/a/16071375/7602110 - shell(`cd ../\ - git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize( - file.replace(' ', '_').replace('../', '') - )}`); - } - - // Replace for convention .h for .hpp - if (path.extname(file) === '.h') { - shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`); - } - }); - } -}); diff --git a/algorithms/scripts/generate-readme.js b/algorithms/scripts/generate-readme.js deleted file mode 100644 index 6ffe5379..00000000 --- a/algorithms/scripts/generate-readme.js +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -/** - * Usage: node generate-readme.js - * - * Author: Carlos Abraham Hernandez - * https://abranhe.com (abraham@abranhe.com) - */ - -const fs = require('fs'); -const path = require('path'); -const glob = require('glob'); -const chalk = require('chalk'); - -const getFiles = (src, callback) => { - glob(src + '/**', callback); -}; - -const categories = [ - 'artificial-intelligence', - 'backtracking', - 'bit-manipulation', - 'cellular-automaton', - 'computational-geometry', - 'cryptography', - 'data-structures', - 'divide-and-conquer', - 'dynamic-programming', - 'gaming-theory', - 'graphs', - 'greedy-algorithms', - 'math', - 'networking', - 'numerical-analysis', - 'online-challenges', - 'randomized-algorithms', - 'serches', - 'selections', - 'sorting', - 'strings', - 'no-category' -]; - -const readme = [ - ` - -
-
-
-
-
- -
-
-
-
-
-
- -
-
-

All ▲lgorithms implemented in C++

- - - - - - -
-
-allalgorithms.com -
- - - -## Contents - -You can find the All ▲lgorithms categories at [algorithms.com/categories](https://algorithms.com/categories) -` -]; - -categories.forEach((category) => { - readme.push(` - [${category.charAt(0).toUpperCase() + category.slice(1).replace(/\-/g, ' ')}](#${category})`); -}); - -getFiles('../', (err, res) => { - let printedCategories = []; - - if (err) { - console.log('Error', err); - } else { - res.map((file) => { - if (path.extname(file) !== '.cpp') { - return; - } - let algorithmName = path.basename(file).replace('.cpp', '').replace('_', ' '); - let currentCategory = path.parse(file).dir.split(path.sep)[1]; - - if (!printedCategories.includes(currentCategory)) { - printedCategories.push(currentCategory); - readme.push(`\n## ${currentCategory.charAt(0).toUpperCase() + currentCategory.slice(1).replace(/\-/g, ' ')}\n`); - } - - readme.push( - ` - [${algorithmName.charAt(0).toUpperCase() + algorithmName.slice(1).replace(/\_/g, ' ')}](${file.replace( - '../', - '' - )})` - ); - }); - - readme.push(` - - -## Maintainers - -|[![1][1-avatar]][1]|[![2][2-avatar]][2]| -| :-: | :-: | -| [Carlos Abraham][1] | [Christian Bender][2] | - -## License - -This work is released under [MIT License][MIT] - -[![MIT IMG][MIT-logo]][MIT] - -To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. - -
- - - -
-
- -[MIT]: https://github.com/abranhe/algorithms/blob/master/license -[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png - - -[1]: https://github.com/abranhe -[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50 -[2]: https://github.com/christianbender -[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50 -`); - - fs.writeFile(`../readme.md`, readme.join('\n'), (err) => { - if (err) throw err; - console.log(chalk.green('The file was succesfully saved!')); - }); - } -}); \ No newline at end of file diff --git a/algorithms/scripts/package.json b/algorithms/scripts/package.json deleted file mode 100644 index cf9afa5f..00000000 --- a/algorithms/scripts/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "scripts", - "version": "1.0.0", - "description": "Keeping clean the All ▲lgorithms Project", - "main": "formatter.js", - "scripts": { - "validate": "node validate.js", - "format": "node format.js", - "readme": "node generate-readme.js" - }, - "license": "MIT", - "private": true, - "dependencies": { - "chalk": "^2.4.2", - "decamelize": "^2.0.0", - "glob": "^7.1.3" - } -} diff --git a/algorithms/scripts/validate.js b/algorithms/scripts/validate.js deleted file mode 100644 index bc561140..00000000 --- a/algorithms/scripts/validate.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -/** - * The All ▲lgorithms validator CLI - * - * Usage: node validate.js - * - * Author: Carlos Abraham Hernandez - * https://abranhe.com (abraham@abranhe.com) - */ - -const glob = require('glob'); -const path = require('path'); -const decamelize = require('decamelize'); -const chalk = require('chalk'); - -const getFiles = (src, callback) => { - glob(src + '/**', callback); -}; - -getFiles('../', (err, res) => { - if (err) { - console.log('Error', err); - } else { - let invalid = false; - res.map((file) => { - // Accept only valid C++ Files (.cpp,.hpp,.h) - if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') { - return; - } - - if (file !== decamelize(file.replace(' ', ''))) { - console.log(`${chalk.red(path.basename(file))} does not follow the correct style.`); - let invalid = true; - } - console.log(`${chalk.green(path.basename(file))} is ok.`); - }); - if (invalid) { - // Throw an error at the end of checking all files - throw new TypeError(`Expected the All ▲lgorithms structure.`); - } - } -}); diff --git a/searches/FibonacciSearch.cpp b/algorithms/searches/FibonacciSearch.cpp similarity index 100% rename from searches/FibonacciSearch.cpp rename to algorithms/searches/FibonacciSearch.cpp diff --git a/searches/binary_search_float.cpp b/algorithms/searches/binary_search_float.cpp similarity index 100% rename from searches/binary_search_float.cpp rename to algorithms/searches/binary_search_float.cpp diff --git a/searches/interpolationSEARCH.cpp b/algorithms/searches/interpolationSEARCH.cpp similarity index 100% rename from searches/interpolationSEARCH.cpp rename to algorithms/searches/interpolationSEARCH.cpp diff --git a/searches/interpolation_search.cpp b/algorithms/searches/interpolation_search.cpp similarity index 100% rename from searches/interpolation_search.cpp rename to algorithms/searches/interpolation_search.cpp diff --git a/algorithms/searches/kth_largest.cpp b/algorithms/searches/kth_largest.cpp new file mode 100644 index 00000000..2d740a9e --- /dev/null +++ b/algorithms/searches/kth_largest.cpp @@ -0,0 +1,40 @@ +/* +k-th largest element in the array +Finding k-th largest element in the array with the lowest possible time complexity O(nlogn).*/ + +#include +#include +#include +using namespace std; + +int kthLargest(vector arr, int n, int k) +{ + priority_queue, greater> pq; + for (int i = 0; i < k; i++) + { + pq.push(arr[i]); + } + for (int i = k; i < n; i++) + { + if (arr[i] > pq.top()) + { + pq.pop(); + pq.push(arr[i]); + } + } + return pq.top(); +} + +int main() +{ + int n, k, s; + vector arr; + cin >> n; + for (int i = 0; i < n; i++) + { + cin >> s; + arr.push_back(s); + } + cin >> k; + cout << kthLargest(arr, n, k) << endl; +} diff --git a/searches/trie_data_structure_String_search b/algorithms/searches/trie_data_structure_String_search.cpp similarity index 100% rename from searches/trie_data_structure_String_search rename to algorithms/searches/trie_data_structure_String_search.cpp diff --git a/sorting/3_way_quicksort.c b/algorithms/sorting/3_way_quicksort.c similarity index 100% rename from sorting/3_way_quicksort.c rename to algorithms/sorting/3_way_quicksort.c diff --git a/sorting/BucketSort.cpp b/algorithms/sorting/BucketSort.cpp similarity index 100% rename from sorting/BucketSort.cpp rename to algorithms/sorting/BucketSort.cpp diff --git a/sorting/CombSort.cpp b/algorithms/sorting/CombSort.cpp similarity index 100% rename from sorting/CombSort.cpp rename to algorithms/sorting/CombSort.cpp diff --git a/sorting/CycleSort.cpp b/algorithms/sorting/CycleSort.cpp similarity index 100% rename from sorting/CycleSort.cpp rename to algorithms/sorting/CycleSort.cpp diff --git a/sorting/PigeonholeSort.cpp b/algorithms/sorting/PigeonholeSort.cpp similarity index 100% rename from sorting/PigeonholeSort.cpp rename to algorithms/sorting/PigeonholeSort.cpp diff --git a/algorithms/sorting/bubble_sort.cpp b/algorithms/sorting/bubble_sort.cpp index c69975fb..ed22d402 100644 --- a/algorithms/sorting/bubble_sort.cpp +++ b/algorithms/sorting/bubble_sort.cpp @@ -1,58 +1,54 @@ -// -// C++ implementation of bubble sort +// C++ implementation of Bubble Sort(Optimised Solution). // // The All ▲lgorithms Project // -// https://allalgorithms.com/sorting +// https://allalgorithms.com/ // https://github.com/allalgorithms/cpp // -// Contributed by: Carlos Abraham Hernandez -// Github: @abranhe +// Contributed by: Abhishek Jaiswal +// Github: @Abhishek-iiit // -#include +#include +#include -// Swap elements -void swap(int *x, int *y) -{ - int temp = *x; - *x = *y; - *y = temp; -} +using namespace std; -// Implement bubble sort -void bubble_sort(int arr[], size_t n) -{ - for (size_t i = 0; i < n - 1; i++) - { - // last i elements are already in place - for (size_t j = 0; j < n-i-1; j++) - { - if (arr[j] > arr[j + 1]) - { - swap(&arr[j], &arr[j + 1]); - } - } - } -} +void bubbleSort(int arr[], int n) +{ + int i, j; + bool changed; + for (i = 0; i < n-1; i++) + { + changed = false; + for (j = 0; j < n-i-1; j++) + { + if (arr[j] > arr[j+1]) + { + swap(arr[j],arr[j+1]); + changed = true; + } + } + if (changed == false) + break; + } +} -// A utility function to print an array of size n -void print_array(int arr[], int n) +int main() { - for (size_t i = 0; i < n; i++) + int n; + cout<<"Input the total size :"<>n; + int arr[n]; + cout<<"Input the number one-by-one :"<>arr[i]; } - std::cout << std::endl; -} - -int main() -{ - int arr[] = {46, 24, 33, 10, 2, 81, 50}; - int n = sizeof(arr)/sizeof(arr[0]); - std::cout << "Unsorted array:" << std::endl; - print_array(arr, n); - bubble_sort(arr, n); - std::cout << "Sorted array:" << std::endl; - print_array(arr, n); - return 0; -} + bubbleSort(arr,n); + cout<<"Sorted array:"< - -/* Function to sort an array using insertion sort*/ -void insertion_sort(int arr[], int n) -{ - int key; - size_t j; - for (size_t i = 1; i < n; i++) - { - key = arr[i]; - j = i - 1; - - /* Move elements of arr[0..i-1], that are - greater than key, to one position ahead - of their current position */ - while (j >= 0 && arr[j] > key) - { - arr[j + 1] = arr[j]; - j--; - } - arr[j + 1] = key; - } -} - -// A utility function to print an array of size n -void print_array(int arr[], int n) -{ - for (size_t i = 0; i < n; i++) - { - std::cout << arr[i] << " "; - } - std::cout << std::endl; -} - - - -/* Driver program to test insertion sort */ -int main() -{ - int arr[] = {12, 11, 13, 5, 6}; - size_t n = sizeof(arr) / sizeof(arr[0]); - std::cout << "Unsorted array:" << std::endl; - print_array(arr, n); - insertion_sort(arr, n); - std::cout << "Sorted array:" << std::endl; - print_array(arr, n); - return 0; -} +// C++ program for insertion sort +#include +using namespace std; + +/* Function to sort an array using insertion sort*/ +void insertionSort(int arr[], int n) +{ + int i, key, j; + for (i = 1; i < n; i++) + { + key = arr[i]; + j = i - 1; + + /* Move elements of arr[0..i-1], that are + greater than key, to one position ahead + of their current position */ + while (j >= 0 && arr[j] > key) + { + arr[j + 1] = arr[j]; + j = j - 1; + } + arr[j + 1] = key; + } +} + +// A utility function to print an array of size n +void printArray(int arr[], int n) +{ + int i; + for (i = 0; i < n; i++) + cout << arr[i] << " "; + cout << endl; +} + +/* Driver code */ +int main() +{ + int arr[] = { 12, 11, 13, 5, 6 }; + int n = sizeof(arr) / sizeof(arr[0]); + + insertionSort(arr, n); + printArray(arr, n); + + return 0; +} + +// This is code is contributed by rathbhupendra diff --git a/strings/Aho-Corasick.cpp b/algorithms/strings/Aho-Corasick.cpp similarity index 100% rename from strings/Aho-Corasick.cpp rename to algorithms/strings/Aho-Corasick.cpp diff --git a/strings/kmp_pattern_matching.cpp b/algorithms/strings/kmp_pattern_matching.cpp similarity index 100% rename from strings/kmp_pattern_matching.cpp rename to algorithms/strings/kmp_pattern_matching.cpp diff --git a/strings/lexicographically_kth_ smallest_suffix.cpp b/algorithms/strings/lexicographically_kth_ smallest_suffix.cpp similarity index 100% rename from strings/lexicographically_kth_ smallest_suffix.cpp rename to algorithms/strings/lexicographically_kth_ smallest_suffix.cpp diff --git a/strings/palindrome_check.cpp b/algorithms/strings/palindrome_check.cpp similarity index 100% rename from strings/palindrome_check.cpp rename to algorithms/strings/palindrome_check.cpp diff --git a/strings/pangram_check.cpp b/algorithms/strings/pangram_check.cpp similarity index 100% rename from strings/pangram_check.cpp rename to algorithms/strings/pangram_check.cpp diff --git a/dynamic-programming/lis.cpp b/dynamic-programming/lis.cpp deleted file mode 100644 index 0ff515f5..00000000 --- a/dynamic-programming/lis.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -/* lis() returns the length of the longest increasing - subsequence in arr[] of size n */ -int lis( int arr[], int n ) -{ - int *lis, i, j, max = 0; - lis = (int*) malloc ( sizeof( int ) * n ); - - /* Initialize LIS values for all indexes */ - for (i = 0; i < n; i++ ) - lis[i] = 1; - - /* Compute optimized LIS values in bottom up manner */ - for (i = 1; i < n; i++ ) - for (j = 0; j < i; j++ ) - if ( arr[i] > arr[j] && lis[i] < lis[j] + 1) - lis[i] = lis[j] + 1; - - /* Pick maximum of all LIS values */ - for (i = 0; i < n; i++ ) - if (max < lis[i]) - max = lis[i]; - - /* Free memory to avoid memory leak */ - free(lis); - - return max; -} - -int main() -{ - /* Driver program to find Longest Increasing Subsequence */ - int arr[] = { 10, 22, 9, 33, 21, 50, 41, 60 }; - int n = sizeof(arr)/sizeof(arr[0]); - printf("Length of lis is %d", lis( arr, n ) ); - return 0; -} diff --git a/graphs/BFS.cpp b/graphs/BFS.cpp deleted file mode 100644 index d2b504d6..00000000 --- a/graphs/BFS.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include -using namespace std; -char mx[100][100]; -bool visited[100][100]; -int V,E,k,l,N,M; -bool isvalid(int x,int y) -{ - if(x<=N && y<=M && x>=1 && y>=1) - return true; - return false; -} -bool bfs(int x,int y) -{ - for(int i=1;i<100;i++) - for(int j=1;j<100;j++) - visited[i][j]=0; -queue > q; -q.push({x,y}); -visited[x][y]=1; -while(!q.empty()) -{ - x=q.front().first; - y=q.front().second; - visited[x][y]=true; - q.pop(); - if(isvalid(x,y+1) && !visited[x][y+1] && mx[x][y+1]==mx[x][y]) - q.push({x,y+1}); - if(isvalid(x,y-1) && !visited[x][y-1] && mx[x][y-1]==mx[x][y]) - q.push({x,y-1}); - if(isvalid(x+1,y) && !visited[x+1][y] && mx[x+1][y]==mx[x][y]) - q.push({x+1,y}); - if(isvalid(x-1,y) && !visited[x-1][y] && mx[x-1][y]==mx[x][y]) - q.push({x-1,y}); - int counter=0; - if(visited[x][y+1]) - counter++; - if(visited[x][y-1]) - counter++; - if(visited[x+1][y]) - counter++; - if(visited[x-1][y]) - counter++; - if(counter>1) - return true; - -} -return false; -} - -int main() -{ - cin>>N>>M; - for(int i=1;i<=N;i++) - for(int j=1;j<=M;j++) - cin>>mx[i][j]; - for(int i=1;i<=N;i++) - for(int j=1;j<=M;j++) - if( bfs(i,j)){ - cout<<"Yes"; - return 0; - } - - cout<<"No"; - - - - return 0; -} diff --git a/graphs/DFS algo b/graphs/DFS algo deleted file mode 100644 index b0973491..00000000 --- a/graphs/DFS algo +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include -using namespace std; - -vector visited; //this vector will mark visited components -vector > graph; //this will store the graph represented internally as an adjacency list -//this is because the adjacency list representation is the most suited to use DFS procedure on a given graph - -int sz_connect_comp = 0; //this will store the size of current connected component (problem-specific feature) - -void dfs(int v) -{ - sz_connect_comp++; //"useful feature" performed on this DFS, this can vary from problem to problem - visited[v] = true; - - for(vector::iterator it = graph[v].begin(); it != graph[v].end(); it++) - { - if(! visited[*it]) //note that *it represents the adjacent vertex itself - { - dfs(*it); - } - } -} - -int main() -{ - int t; - cin >> t; - while(t--) - { - int n,m; - cin >> n >> m; - graph = vector > (n); //initialization of the graph - for(int i = 0; i < m; i++) - { - int u,v; - cin >> u >> v; - u--; - v--; - //these are added this way due to the friendship relation being mutual - graph.push_back(v); - graph[v].push_back(u); - } - int res = 0; // the number of fire escape routes - int ways = 1; // the number of ways to choose drill captains - visited = vector (n, 0); // initially mark all vertices as unvisited - for(int u = 0; u < n; u++) - { - //if the vertex was visited we skip it. - if(visited==true) - continue; - // if vertex was not visited it starts a new component - res++; // so we increase res - sz_connect_comp = 0; // init sz_connect_comp - dfs(u); // and calculate it through the dfs, marking visited vertices - // we multiply ways by sz_connect_comp modulo 1000000007 - ways = (long long)sz_connect_comp * ways % 1000000007; - } - printf("%d %d", res, ways); - - } - return 0; -} diff --git a/graphs/Kosaraju.cpp b/graphs/Kosaraju.cpp deleted file mode 100644 index 288bdbdf..00000000 --- a/graphs/Kosaraju.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//this code if for kosaraju algorithm -//the algorithm is used to find strongly connected components in a graph -#include -using namespace std; - -vector g[100000]; //adjacency list for the graph -vector grev[100000]; //adjacency list for the reversed graph - -//printing a vector -void print(vector cc){ - int size = cc.size(); - for(int i = 0 ; i < size ; i++){ - cout << cc[i] << " "; - } - cout << endl; -} - -//DFS CALLS -void dfs1(int source , stack &order , bool * visited){ - visited[source] = true; - for(auto i : g[source]){ - if(!visited[i]) dfs1(i , order , visited); - } - order.push(source); -} -void dfs2(int source , bool * visited , vector &cc){ - visited[source] = true; - cc.push_back(source); - for(auto i : grev[source]){ - if(!visited[i]) dfs2(i , visited , cc); - } -} - -//code for finding and printing SCC(Stongly Connected Components) -void SCC(int n){ - bool * visited = new bool[n]{false}; - stack order; - for(int i = 0 ; i < n ; i++){ - if(!visited[i]){ - dfs1(i , order , visited); - } - } - delete []visited; - bool * visited2 = new bool[n]{false}; - while(!order.empty()){ - int source = order.top(); - order.pop(); - vector cc; - dfs2(source , visited2 , cc); - print(cc); - } - delete []visited2; -} - - -int main(){ - //n is number of vertices - //m is number of edges - int n , m , a , b; - cin >> n >> m; //inputting number of vertices and edges - //inputting m edges - for(int i = 0 ; i < m ; i++){ - //a directed edge from a to b - cin >> a >> b; - g[a].push_back(b); - grev[b].push_back(a); - } - SCC(n);//call function to find and print SCC -} diff --git a/graphs/Kruskal.cpp b/graphs/Kruskal.cpp deleted file mode 100644 index 8d08874e..00000000 --- a/graphs/Kruskal.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// #include -// #include -// #include -// #include -// #include -// #include -#include -#define pu push_back -#define m make_pair -using namespace std; - -// Functor to compare by the Mth element -template class F = std::less> -struct TupleCompare -{ - template - bool operator()(T const &t1, T const &t2) - { - return F::type>()(std::get(t1), std::get(t2)); - } -}; - -void addEdge(vector < pair > adj[],int u,int v,int key) -{ - adj[u].pu(m(v,key)); - adj[v].pu(m(u,key)); -} - -int main() -{ - int n; - int q; - cin>>n>>q; - vector < pair > adj[n]; - vector < tuple > v; - for(int h=0;h>a>>b>>key; - a-=1;b-=1; - // addEdge(a,b,key,adj); - v.pu(make_tuple(a,b,key)); - } - sort(begin(v),end(v), TupleCompare<2>()); - int colour[n]; - int number[n]; - list refer[n]; - list :: iterator it; - int countcolour = n; - for(int i=0;i(v[i]), b = get<1>(v[i]), c = get<2>(v[i]); - int d = colour[a],e = colour[b]; - if(d==e) continue; - else if(number[d]>number[e]) - { - // for(int j=0;j> v; - v.push_back(make_tuple(1, "Hello")); - v.push_back(make_tuple(2, "Aha")); - a.splice(a.end(), b); // extends the list a by moving the elements from b to the end of a - std::sort(begin(v), end(v), TupleCompare<0>()); - return 0; - 8 11 -1 2 50 -2 3 35 -3 4 30 -3 5 25 -2 4 95 -0 2 60 -2 6 40 -0 6 20 -0 7 10 -6 7 20 -4 6 45 - -Kruskal.cpp87:37 -LF -I -UTF-8C++ -master104 files - -} -*/ diff --git a/graphs/tsp.o b/graphs/tsp.o deleted file mode 100644 index 881927c7b0478883889aa2745aabebedc374c3c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3858 zcma)8TWl0n7(T-;>k3tfZU94+603qrFLWzaB2?{Y8roXAEJRE_Os7jbu-&aYvsg&b zLfPnKT~i;tJQ(4D7^4rq_yD|EsAg$`u_iod;)986#B@peun!nE)bBrM_Fhs>GXMPN zoA1A#GiRn-SdG`G@dg~lzROL0zN>>93dkDNb-TRm$&)HtMBS{ZLCwSzTJ zHx8O+`7?L<#L*|fYw}k<*nnx+Rf*NFMci0r;CfKbRPhkEqiK7k!|ULk2k-oS(&zoS zk-sMY4hcAN0r&B$Bn59rO9k&5W+N*ZyW{wyo8Ub!J6RyNL-C_`o#-(QaxHi*Efs<3 zaoFiG@o0$t=~gsW)TYmPW)>FT&Ij$k59|-@z0m$8V>ign)*sV} zthTsFdOES-XsJXFS}J(MUVCX3yx4ti`;a%4xDM2IHwa51Qi-}jK$puV>BMhfQD_HF zcQ&}|$i2IPq6n&^JB-P!JEdme_+pU&C>hK+?tKjH_(+6LUyv zeq(BMLo)G)tU@Nbh~Z>kUR_ccq(TdCy!jR%NNM>Qv~Du%EybOc$cD+2UM0Ti)X6$( zVtieRfJ{}iK{zjvDO2L%8FlE!MMQU=x$T~OQq89)I=`Td8JnFs7K-7GW81dv+QkCV zcuWuNX0Jp|tKKl{i6K&Iw|g?=mH?+YOSd?wW>$81!G$6KU&>syBY?0xb!F{S$fR@1OO}i30>Kj$c&ECs=Ir#D>G;`2 zHCKk_BswuWGc`3OYVz4V*|d7=AH0*uPTun5?%xj~lEG}U$7^4u46ml@WQH_L_T-hT zN%!f*v^A7ev&mpyCX+-miRpOXvW7d=+zT!RjgRHP+VS=u_iHqH9d7w zWNodd=To$zNj0Zj!OV7Mw`Q-nnXET3ne}54Mf<#^_R$8Bm|gw?i0Izx-qQ}CW2W#5 zI0?l2oz+G7Y7_GPxkxRTxm!PTqMs?B3uKx3{KF!roXlw#YNc0oAW!9pwcBF%pgp;y z*vHi|oef%goyD5txLASQ*%_3)9`~)deC%<^Cvkb$Hpopvdl8Zt9<~<}`wYDOkWUCr zhs3c9>;xp8;y!j7@=;tKWF;-F(l!H4M$1BzG5&-05H26vjQW~{)&y;f(7K^*gocWsH4ALCh{d4M zx5dYfLz9)i3vIi=9)Oh5==77hJOWL|t%oKvr9R30UVtWR+YL?DHd(|zC}Lz+hs(!y zLQ2ma&>97{2U5ljK$FoT&?JvONRqd%h*5Qd+rp)|zi!t`4QaQIHZ}DYE;u( z@oLwiZ9_W#aLCKBuJh2i9vZW_r48a(;QU~~>Tc)Uh#Co3354V(BN z?~*(7E)DbR(YPgh*Q(G>AjCGuwN16c#Bkvf96*$s;g!hMr4buw6 zs^DNGR(inok)x({l#iOyyFU~e3U}!NtEELB(PG?+X@+HX>8jcftaVT`Q5@D5yJWO$ zAK%x^)xdLH+J?=pd$ZH`!K#h-?a|4wHxLb*YTv8= 1; i--) { - output *= i; - } - - return output; -} \ No newline at end of file diff --git a/palindrome/palindrome_number.cpp b/palindrome/palindrome_number.cpp deleted file mode 100644 index 67503512..00000000 --- a/palindrome/palindrome_number.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Palindrome Checker implemented in C++ -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: SHUBHAM SHARMA -// Github: @VirtualRcoder - -#include -using namespace std; - -int main() -{ - int n, num, digit, rev = 0; - - cout << "Enter a positive number: "; - cin >> num; - - n = num; - - do - { - digit = num % 10; - rev = (rev * 10) + digit; - num = num / 10; - } while (num != 0); - - cout << " The reverse of the number is: " << rev << endl; - - if (n == rev) - cout << " The number is a palindrome."; - else - cout << " The number is not a palindrome."; - - return 0; -} diff --git a/searches/k-th largest element in the array b/searches/k-th largest element in the array deleted file mode 100644 index 954201d1..00000000 --- a/searches/k-th largest element in the array +++ /dev/null @@ -1,32 +0,0 @@ -/*Finding k-th largest element in the array with the lowest possible time complexity O(nlogn). - -#include -#include -#include -using namespace std; - -int kthLargest (vector arr, int n, int k){ - priority_queue, greater > pq; - for(int i = 0; i < k; i++){ - pq.push(arr[i]); - } - for(int i = k; i < n; i++){ - if(arr[i] > pq.top()){ - pq.pop(); - pq.push(arr[i]); - } - } - return pq.top(); -} - -int main(){ - int n, k, s; - vector arr; - cin>>n; - for(int i = 0; i < n; i++){ - cin>>s; - arr.push_back(s); - } - cin >> k; - cout << kthLargest(arr, n, k) << endl; -} diff --git a/sorting/Insertion_Sort.cpp b/sorting/Insertion_Sort.cpp deleted file mode 100644 index c5a7cf15..00000000 --- a/sorting/Insertion_Sort.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// C++ program for insertion sort -#include -using namespace std; - -/* Function to sort an array using insertion sort*/ -void insertionSort(int arr[], int n) -{ - int i, key, j; - for (i = 1; i < n; i++) - { - key = arr[i]; - j = i - 1; - - /* Move elements of arr[0..i-1], that are - greater than key, to one position ahead - of their current position */ - while (j >= 0 && arr[j] > key) - { - arr[j + 1] = arr[j]; - j = j - 1; - } - arr[j + 1] = key; - } -} - -// A utility function to print an array of size n -void printArray(int arr[], int n) -{ - int i; - for (i = 0; i < n; i++) - cout << arr[i] << " "; - cout << endl; -} - -/* Driver code */ -int main() -{ - int arr[] = { 12, 11, 13, 5, 6 }; - int n = sizeof(arr) / sizeof(arr[0]); - - insertionSort(arr, n); - printArray(arr, n); - - return 0; -} - -// This is code is contributed by rathbhupendra diff --git a/sorting/bubble_sort.cpp b/sorting/bubble_sort.cpp deleted file mode 100644 index ed22d402..00000000 --- a/sorting/bubble_sort.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// C++ implementation of Bubble Sort(Optimised Solution). -// -// The All ▲lgorithms Project -// -// https://allalgorithms.com/ -// https://github.com/allalgorithms/cpp -// -// Contributed by: Abhishek Jaiswal -// Github: @Abhishek-iiit -// -#include -#include - -using namespace std; - -void bubbleSort(int arr[], int n) -{ - int i, j; - bool changed; - for (i = 0; i < n-1; i++) - { - changed = false; - for (j = 0; j < n-i-1; j++) - { - if (arr[j] > arr[j+1]) - { - swap(arr[j],arr[j+1]); - changed = true; - } - } - if (changed == false) - break; - } -} - -int main() -{ - int n; - cout<<"Input the total size :"<>n; - int arr[n]; - cout<<"Input the number one-by-one :"<>arr[i]; - } - bubbleSort(arr,n); - cout<<"Sorted array:"< Date: Sun, 4 Oct 2020 18:23:43 +0530 Subject: [PATCH 252/285] Added more efficient version of euler totient function --- algorithms/math/euler_totient_function.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 algorithms/math/euler_totient_function.cpp diff --git a/algorithms/math/euler_totient_function.cpp b/algorithms/math/euler_totient_function.cpp new file mode 100644 index 00000000..07eef2fc --- /dev/null +++ b/algorithms/math/euler_totient_function.cpp @@ -0,0 +1,49 @@ +/*Problem Statement:- + Given a number n, find the count of numbers from [1,n] that are + relatively prime to n i.e. gcd(n,x)=1 +Solution:- + using euler totient function +*/ +#include + +using namespace std; + +int phi(int n) //less efficient but easy to understand +{ + float result=n; + for(int f=2;f*f<=n;f++) + if(n%f==0) + { + while(n%f==0) + n/=f; + result*=(1.0-(1.0/(float)f)); + } + if(n>1) + result*=(1.0-(1.0/(float)n)); + return int(result); +} + +int phi2(int n) //more efficient because of reduced number of multiplications +{ + int result=n; + for(int f=2;f*f<=n;f++) + if(n%f==0) + { + while(n%f==0) + n/=f; + result-=result/f; + } + if(n>1) + result-=result/n; + return result; +} + +int main() +{ + cout<<"\nEnter a number : "; + int n; + cin>>n; + cout<<"\nCount of numbers from [1,n] that are relatively prime to n are : "< Date: Mon, 5 Oct 2020 17:39:40 +0530 Subject: [PATCH 253/285] Create stack_using_two_queues.cpp --- .../stack/stack_using_two_queues.cpp | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 algorithms/data-structures/stack/stack_using_two_queues.cpp diff --git a/algorithms/data-structures/stack/stack_using_two_queues.cpp b/algorithms/data-structures/stack/stack_using_two_queues.cpp new file mode 100644 index 00000000..30443571 --- /dev/null +++ b/algorithms/data-structures/stack/stack_using_two_queues.cpp @@ -0,0 +1,66 @@ +#include +using namespace std; + +class QueueStack{ +private: + queue q1; + queue q2; +public: + void push(int); + int pop(); +}; + + +int main() +{ + int T; + cin>>T; + while(T--) + { + QueueStack *qs = new QueueStack(); + + int Q; + cin>>Q; + while(Q--){ + int QueryType=0; + cin>>QueryType; + if(QueryType==1) + { + int a; + cin>>a; + qs->push(a); + }else if(QueryType==2){ + cout<pop()<<" "; + + } + } + cout< q1; + queue q2; +public: + void push(int); + int pop(); +}; +void QueueStack :: push(int x) +{ + q2.push(x); + while(!q1.empty()){ + q2.push(q1.front()); + q1.pop(); + } + swap(q1,q2); +} +int QueueStack :: pop() +{ + if(q1.empty()) return -1; + else{ + int x = q1.front(); + q1.pop(); + return x; + } +} From 272d442565077f5b2ceb0f31159cead2dd4c2693 Mon Sep 17 00:00:00 2001 From: ameycodes Date: Tue, 6 Oct 2020 01:17:44 +0530 Subject: [PATCH 254/285] Added: Minimum product subset of an array --- algorithms/greedy/minimumProductSubset.cpp | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 algorithms/greedy/minimumProductSubset.cpp diff --git a/algorithms/greedy/minimumProductSubset.cpp b/algorithms/greedy/minimumProductSubset.cpp new file mode 100644 index 00000000..2fd9e243 --- /dev/null +++ b/algorithms/greedy/minimumProductSubset.cpp @@ -0,0 +1,59 @@ +//Find minimum product subset in an array using Greedy method + +#include +using namespace std; + +int calculate(int a[], int n) +{ + if (n == 1) + return a[0]; + + int max_neg = INT_MIN; + int min_pos = INT_MAX; + int count_neg = 0, count_zero = 0; + int prod = 1; + for (int i = 0; i < n; i++) { + + + if (a[i] == 0) { + count_zero++; + continue; + } + + if (a[i] < 0) { + count_neg++; + max_neg = max(max_neg, a[i]); + } + + if (a[i] > 0) + min_pos = min(min_pos, a[i]); + + prod = prod * a[i]; + } + + if (count_zero == n || + (count_neg == 0 && count_zero > 0)) + return 0; + + if (count_neg == 0) + return min_pos; + + if (!(count_neg & 1) && count_neg != 0) { + prod = prod / max_neg; + } + + return prod; +} + +int main() +{ + int n; + cout<<"Enter size of array: "; + cin>>n; + int a[n]; + cout<<"\nEnter array elements: "; + for(int i=0;i>a[i]; + cout << "\nAnswer: "< Date: Tue, 6 Oct 2020 01:48:22 +0530 Subject: [PATCH 255/285] Added: Algorithm to find minimum number of denominations --- algorithms/greedy/minimumCoins.cpp | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 algorithms/greedy/minimumCoins.cpp diff --git a/algorithms/greedy/minimumCoins.cpp b/algorithms/greedy/minimumCoins.cpp new file mode 100644 index 00000000..e231d251 --- /dev/null +++ b/algorithms/greedy/minimumCoins.cpp @@ -0,0 +1,41 @@ +// Given a value V and the list of available denomination of money, +// find minimum number of coins and/or notes needed to make the change. + +#include +using namespace std; + +// All denominations of Indian Currency +int deno[] = { 1, 2, 5, 10, 20, + 50, 100, 500, 1000 }; +int n = sizeof(deno) / sizeof(deno[0]); + +vector calculate(int V) +{ + sort(deno, deno + n); + vector ans; + + for (int i = n - 1; i >= 0; i--) { + + while (V >= deno[i]) { + V -= deno[i]; + ans.push_back(deno[i]); + } + } + return ans; + //for (int i = 0; i < ans.size(); i++) + //cout << ans[i] << " "; +} + +int main() +{ + int n; + cout<<"Enter the monitory value: "; + cin>>n; + cout << "Following is minimal number of change for " << n + << ": "; + vector ans = calculate(n); + for(auto i: ans) + cout< Date: Tue, 6 Oct 2020 14:41:36 +0530 Subject: [PATCH 256/285] added Hamming Code --- algorithms/Networks/Hamming_Code/README.md | 10 ++ .../Hamming_Code/hamming_code_reciever.cpp | 167 ++++++++++++++++++ .../Hamming_Code/hamming_code_sender.cpp | 139 +++++++++++++++ 3 files changed, 316 insertions(+) create mode 100644 algorithms/Networks/Hamming_Code/README.md create mode 100644 algorithms/Networks/Hamming_Code/hamming_code_reciever.cpp create mode 100644 algorithms/Networks/Hamming_Code/hamming_code_sender.cpp diff --git a/algorithms/Networks/Hamming_Code/README.md b/algorithms/Networks/Hamming_Code/README.md new file mode 100644 index 00000000..f892705d --- /dev/null +++ b/algorithms/Networks/Hamming_Code/README.md @@ -0,0 +1,10 @@ +# Hamming Code + +Sender Side: Input is the first character of your name or any other character you like. + +Reciever Side: Recieved codeword using TCP Socket. + +The reciever also serves the following functionalities:- +a) Prints Data recieved without error. +b) Prints Data recieved with error. + diff --git a/algorithms/Networks/Hamming_Code/hamming_code_reciever.cpp b/algorithms/Networks/Hamming_Code/hamming_code_reciever.cpp new file mode 100644 index 00000000..803fbdc5 --- /dev/null +++ b/algorithms/Networks/Hamming_Code/hamming_code_reciever.cpp @@ -0,0 +1,167 @@ +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace std; + +#define MAX 2048 +#define port 5200 + + +void flip(int &a) { + a=!a; +} + + +void revprint(int codeword[],int n) { + for(int i=n-1;i>=0;i--) { + cout<=1) { + cout<<"Hence flip bit "<=0;i--) { + if((i+1)!=1&&(i+1)!=2&&(i+1)!=4&&(i+1)!=8) { + message[j--]=codeword[i]; + } + } + + cout<<"Message : "; + revprint(message,8); + + int x=0; + for(int i=0;i<8;i++) { + if(message[i]==1) { + x+=(1<>ch; + + switch(ch) { + case 1:{ + cout<<"Recieved Message: "; + revprint(codeword,12); + decoded(codeword); + + cout<<"Meesage Recieved Successfully...!"< +#include +#include +#include +#include +#include + +using namespace std; + +#define MAX 500 +#define port 5200 + + +void tobinary(int a[],char c) { + int x=(int)c; + + cout<=0;i--) { + cout<=0;i--) { + if(a[i]==-1) { + a[i]=b[j]; + j--; + } + } +} + + +int main(){ + + int clientSocket , serverSocket , receiveMsgSize; + + clientSocket = socket(AF_INET , SOCK_STREAM , 0); // creating the socket + + if(clientSocket < 0){ + cout << "Creation of client socket failed" << endl; + return 0; + } + + struct sockaddr_in serverAddr , clientAddr; + + // providing socket with IP and port + serverAddr.sin_family = AF_INET; + serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1"); + serverAddr.sin_port = htons(port); + + if(connect(clientSocket , (struct sockaddr*) & serverAddr , sizeof(serverAddr)) < 0){ // connecting to the receiver + cout << "Connection Error..!" << endl; + return 0; + } + else{ + cout << "Connection Established..!" << endl; + } + + + char c; + cout<<"Enter the First letter of your name: "; + cin>>c; + + int binary[8]; + tobinary(binary,c); + + cout<<"The entered message in binary is: "; + revprint(binary,8); + + + int codeword[12]; + fillmessageintocodes(codeword,binary); + + + for(int i=0;i<4;i++) { + int count=0; + for(int j=0;j<12;j++) { + if((j+1)&(1< Date: Tue, 6 Oct 2020 14:46:47 +0530 Subject: [PATCH 257/285] updated README --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index dd64172d..8921f5b7 100644 --- a/readme.md +++ b/readme.md @@ -288,6 +288,7 @@ just a paper and pencil. - [Packet Sniffer](networking/) - [Determine Endianess](networking/) - [Validate IP](networking/) +- [Hamming Code](networking/Hamming_Code/) ## [Numerical Analysis](numerical-analysis) From 48a89a2eb975890154389d30aa0d0c8db966b158 Mon Sep 17 00:00:00 2001 From: "OEM Configuration (temporary user)" Date: Tue, 6 Oct 2020 14:48:39 +0530 Subject: [PATCH 258/285] updated README --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8921f5b7..f9153c0b 100644 --- a/readme.md +++ b/readme.md @@ -288,7 +288,7 @@ just a paper and pencil. - [Packet Sniffer](networking/) - [Determine Endianess](networking/) - [Validate IP](networking/) -- [Hamming Code](networking/Hamming_Code/) +- [Hamming Code](networking/Hamming_Code) ## [Numerical Analysis](numerical-analysis) From 42f6419fca90c3070914371c9cea412cd797160b Mon Sep 17 00:00:00 2001 From: "OEM Configuration (temporary user)" Date: Tue, 6 Oct 2020 14:50:37 +0530 Subject: [PATCH 259/285] made network algorithms accesbile from README --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index f9153c0b..e429a9e3 100644 --- a/readme.md +++ b/readme.md @@ -285,10 +285,10 @@ just a paper and pencil. ## [Networking](networking) -- [Packet Sniffer](networking/) -- [Determine Endianess](networking/) -- [Validate IP](networking/) -- [Hamming Code](networking/Hamming_Code) +- [Packet Sniffer](Networks/) +- [Determine Endianess](Networks/) +- [Validate IP](Networks/) +- [Hamming Code](Networks/Hamming_Code) ## [Numerical Analysis](numerical-analysis) From 3a099011074f5a5618b9c9fd45aac09e6ba18ae4 Mon Sep 17 00:00:00 2001 From: Parmeet Singh Date: Tue, 6 Oct 2020 23:47:51 +0530 Subject: [PATCH 260/285] Add files via upload --- data-structures/IncrementLL.cpp | 127 ++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 data-structures/IncrementLL.cpp diff --git a/data-structures/IncrementLL.cpp b/data-structures/IncrementLL.cpp new file mode 100644 index 00000000..7cbf14dc --- /dev/null +++ b/data-structures/IncrementLL.cpp @@ -0,0 +1,127 @@ +#include +using namespace std; + +/* + +Increment Linked List by 1 + +This program increments the list by 1. The program takes input with one space and when entered -1 at the end, it stops taking more inputs +For example + +Input: +3 1 -1 + +Output: +3 2 + +Input2: +9 9 -1 + +Output2: +1 0 0 + +Idea is to reverse a LL, made some calculations and reverse it again to obtain the answer. + +*/ + +class Node { + public: + int data; + Node *next; + + Node(int data) { + this->data = data; + this->next = NULL; + } +}; + +Node* takeInput() { + Node* head = NULL; + Node* prev = NULL; + int d; + cin >> d; + + while(d != -1) { + Node* newnode = new Node(d); + if(head == NULL) { + head = newnode; + prev = head; + } + else { + prev->next = newnode; + prev = newnode; + } + cin >> d; + } + return head; +} + +Node* reverseLL(Node* head) { + Node* curr = head; + Node* prev = NULL; + while(curr != NULL) { + if(prev == NULL) { + prev = curr; + curr = curr->next; + prev->next = NULL; + } + else { + Node* var = curr; + curr = curr->next; + var->next = prev; + prev = var; + } + } + return prev; +} + +void print(Node* head) { + Node* temp = head; + while(temp != NULL) { + cout<data<<" "; + temp = temp->next; + } +} + +int main() { + Node* head = takeInput(); + Node *newHead = NULL; + newHead = reverseLL(head); + + bool carry = false; + + Node *temp = newHead; + Node *prev = NULL; + int digit = temp->data + 1; + while(temp!= NULL) { + if(carry) { + int data = temp->data + 1; + if(data >= 10) { + temp->data = (data%10); + carry = true; + } + else { + temp->data = data; + carry = false; + break; + } + } + else if(digit>=10) { + temp->data = (digit%10); + carry = true; + } + else if(digit<10) { + temp->data = temp->data + 1; + break; + } + prev = temp; + temp = temp->next; + } + if(carry) { + Node* newNode = new Node(1); + prev->next = newNode; + newNode->next = NULL; + } + head = reverseLL(newHead); + print(head); +} From 2e4526fc60e27429b65aa91a956a86d534efe558 Mon Sep 17 00:00:00 2001 From: "OEM Configuration (temporary user)" Date: Wed, 7 Oct 2020 05:26:14 +0530 Subject: [PATCH 261/285] added changes --- algorithms/Networks/Hamming_Code/README.md | 10 ---------- readme.md | 7 +++---- 2 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 algorithms/Networks/Hamming_Code/README.md diff --git a/algorithms/Networks/Hamming_Code/README.md b/algorithms/Networks/Hamming_Code/README.md deleted file mode 100644 index f892705d..00000000 --- a/algorithms/Networks/Hamming_Code/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Hamming Code - -Sender Side: Input is the first character of your name or any other character you like. - -Reciever Side: Recieved codeword using TCP Socket. - -The reciever also serves the following functionalities:- -a) Prints Data recieved without error. -b) Prints Data recieved with error. - diff --git a/readme.md b/readme.md index e429a9e3..dd64172d 100644 --- a/readme.md +++ b/readme.md @@ -285,10 +285,9 @@ just a paper and pencil. ## [Networking](networking) -- [Packet Sniffer](Networks/) -- [Determine Endianess](Networks/) -- [Validate IP](Networks/) -- [Hamming Code](Networks/Hamming_Code) +- [Packet Sniffer](networking/) +- [Determine Endianess](networking/) +- [Validate IP](networking/) ## [Numerical Analysis](numerical-analysis) From a44885a7d1ec426bf992829f43b4ffd377bc7f16 Mon Sep 17 00:00:00 2001 From: ameycodes Date: Wed, 7 Oct 2020 10:01:39 +0530 Subject: [PATCH 262/285] Added: Blur image using OpenCV --- algorithms/image-processing/blurImage.cpp | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 algorithms/image-processing/blurImage.cpp diff --git a/algorithms/image-processing/blurImage.cpp b/algorithms/image-processing/blurImage.cpp new file mode 100644 index 00000000..5bf60524 --- /dev/null +++ b/algorithms/image-processing/blurImage.cpp @@ -0,0 +1,31 @@ +// Using OpenCV to blur an image. + +#include +#include +#include +#include +#include + +using namespace cv; +using namespace std; + +int main() +{ + Mat image = imread("jeep.jpg", CV_LOAD_IMAGE_UNCHANGED); + + // Check for no data + if (! image.data ) + { + cout << "Could not open or find the image.\n"; + return -1; // unsuccessful + } + + blur(image,image,Size(10,10)); + + namedWindow( "jeep", CV_WINDOW_AUTOSIZE ); + imshow( "jeep", image ); + + waitKey(0); + + return 0; +} From f843a6aae1767a57f94342de45c26c4262ce5b9c Mon Sep 17 00:00:00 2001 From: Naman Yadav Date: Wed, 7 Oct 2020 15:13:13 +0530 Subject: [PATCH 263/285] Kth Ancestor a Tree Node using Binary Lifting technique --- .../graphs/kth-ancestor-of-a-tree-node.cpp | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 algorithms/graphs/kth-ancestor-of-a-tree-node.cpp diff --git a/algorithms/graphs/kth-ancestor-of-a-tree-node.cpp b/algorithms/graphs/kth-ancestor-of-a-tree-node.cpp new file mode 100644 index 00000000..6123970e --- /dev/null +++ b/algorithms/graphs/kth-ancestor-of-a-tree-node.cpp @@ -0,0 +1,52 @@ +//Kth Ancestor of a treenode using Binary Lifting. If kth ancestor does not exist, return -1. Implemented in C++17 +// author : github.com/yadavnaman +#include +using namespace std; + +class TreeAncestor { + +public: + vector< vector >dp; // dp[i][node] : node's 2^i parent + int n; + TreeAncestor(int m, vector& parent) { + n = m; + dp.resize(20,vector (m,-1)); + for(int node = 0 ; node < parent.size(); ++node){ + dp[0][node] = parent[node]; + } + // 2^i parent + for(int i = 1; i< 20; ++i) { + for(int node = 0 ; node < parent.size(); ++node) { + int node_par = dp[i-1][node]; + if(node_par != -1){ + dp[i][node] = dp[i-1][node_par]; + } + } + } + + } + + int getKthAncestor(int node, int k) { + for(int i = 0; i < 20; ++i) { + if(k & (1<> m >> k; + vector par(m); + for(int i = 0; i < m; ++i){ + cin>>par[i]; + } + cin >> node; + TreeAncestor* obj = new TreeAncestor(m,par); + cout << obj->getKthAncestor(node,k) <<"\n"; +} \ No newline at end of file From 0bca5de6029d7e1db2415baf41b038cdfc8d494f Mon Sep 17 00:00:00 2001 From: Parmeet Singh Date: Thu, 8 Oct 2020 00:50:52 +0530 Subject: [PATCH 264/285] Add files via upload --- data-structures/Inbuilt_Pair.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 data-structures/Inbuilt_Pair.cpp diff --git a/data-structures/Inbuilt_Pair.cpp b/data-structures/Inbuilt_Pair.cpp new file mode 100644 index 00000000..e86a32e4 --- /dev/null +++ b/data-structures/Inbuilt_Pair.cpp @@ -0,0 +1,28 @@ +/* +Pair is a container class in CPP defined in header file. It consists of two elements. + +You can access the first element as 'first' and second element as 'second'. They both can be of any data type. (This class is made using templates) + +We can use the pair class where we need to store two properties like when finding diameter of a binary tree. + +This is the inbuilt version, we can create our own version too. + +*/ +#include +using namespace std; + +int main() { + + pair p ; + + p.first = 100; + p.second = 'G' ; + + cout << p.first << " " ; + cout << p.second << endl ; + + return 0; + +} + + From 0f9942e0283a1e29d37987bf88d5a44365243ba1 Mon Sep 17 00:00:00 2001 From: Parmeet Singh Date: Thu, 8 Oct 2020 01:03:16 +0530 Subject: [PATCH 265/285] Add files via upload --- .../Priority_Queues/CheckMaxHeap.cpp | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 data-structures/Priority_Queues/CheckMaxHeap.cpp diff --git a/data-structures/Priority_Queues/CheckMaxHeap.cpp b/data-structures/Priority_Queues/CheckMaxHeap.cpp new file mode 100644 index 00000000..bb362175 --- /dev/null +++ b/data-structures/Priority_Queues/CheckMaxHeap.cpp @@ -0,0 +1,63 @@ +/* + +Problem: +Given an array of integers, check whether it represents max-heap or not. +Return true or false. + + +*/ + + +#include +using namespace std; + +bool checkMaxHeap(int arr[], int n){ + + int loopSize = ((n-1)-1)/2; + int j = 0; + while(j <= loopSize) { + int parent = j; + int left = (2*parent)+1; + int right = (2*parent)+2; + + bool ok = false; + if(left < n) { + if(arr[left] <= arr[parent]) + ok = true; + else { + return false; + } + } + + if(right < n) { + if(arr[right] <= arr[parent]) + ok = true; + else { + return false; + } + } + j++; + } + return true; +} + +int main() { + int n; + cin>>n; + int *arr = new int[n]; + for(int i=0; i> arr[i]; + } + bool ans = checkMaxHeap(arr, n); + if(ans){ + cout << "true" << endl; + } + else{ + cout << "false" << endl; + } + + delete [] arr; +} + + + From a967b45213073afbe12cb71920b59d5b8371d6d8 Mon Sep 17 00:00:00 2001 From: Ankur-S1 <65460931+Ankur-S1@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:17:07 +0530 Subject: [PATCH 266/285] stack using linked list --- .../stack/stack_using_linked_list.cpp | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 algorithms/data-structures/stack/stack_using_linked_list.cpp diff --git a/algorithms/data-structures/stack/stack_using_linked_list.cpp b/algorithms/data-structures/stack/stack_using_linked_list.cpp new file mode 100644 index 00000000..5047cc16 --- /dev/null +++ b/algorithms/data-structures/stack/stack_using_linked_list.cpp @@ -0,0 +1,107 @@ +#include +#include + +using namespace std; + +//- Global Variable (came from main)! +struct Node *top = NULL; + +struct Node{ + int data; + struct Node *next; +}; + +void linkedlistTraversal(struct Node * ptr){ + while(ptr!=NULL){ + printf("Element: %d\n", ptr->data); + ptr = ptr->next; + } +} + +int isEmpty(struct Node* top){ + if(top == NULL){ + return 1; + } + return 0; +} + +int isFull(struct Node* top){ + struct Node * n = (struct Node *) malloc(sizeof(struct Node)); + if(n == NULL){ + return 1; + } + return 0; +} + +struct Node* push(struct Node* top, int data){ + if(isFull(top)){ + printf("Stack Overflow!\n"); + } + else{ + struct Node * n = (struct Node*) malloc(sizeof(struct Node)); + n->data = data; + n->next = top; + top = n; + return top; + } +} + +int pop(struct Node * tp){ + if(isEmpty(tp)){ + printf("Stack Underflow!"); + } + else{ + struct Node * n = tp; + top = (tp)->next; + int x = n->data; + free(n); + return x; + } +} + +int peek(int pos){ + struct Node * ptr = top; + for (int i = 0; (i < pos-1 && ptr!=NULL); i++) + { + ptr = ptr->next; + } + if(ptr!=NULL){ + return ptr->data; + } + else{ + return -1; // assuming there's no -ve element in stack + } +} + +int stackTop(struct Node * top){ + return top->data; +} + +int stackBottom(struct Node * top){ + struct Node * p = top; + while(p->next!=NULL){ + p = p->next; + } + return p->data; +} + +int main() +{ + top = push(top, 69); + top = push(top, 10); + top = push(top, 8); + top = push(top, 7); + linkedlistTraversal(top); + + for (int i = 1; i <= 4; i++) + { + printf("The element at position %d is %d\n",i,peek(i)); + } + + // printf("The top most element in stack is %d\n",stackTop(top)); + printf("The bottom most element in stack is %d\n",stackBottom(top)); + + + + return 0; +} From c8cf016ef04f2192538e032872b1b9104fac0c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abra=C3=A3o=20Caiana=20de=20Freitas?= Date: Thu, 8 Oct 2020 00:49:50 -0300 Subject: [PATCH 267/285] Create BinaryIndexedTree2d.cpp --- .../data-structures/BinaryIndexedTree2d.cpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 algorithms/data-structures/BinaryIndexedTree2d.cpp diff --git a/algorithms/data-structures/BinaryIndexedTree2d.cpp b/algorithms/data-structures/BinaryIndexedTree2d.cpp new file mode 100644 index 00000000..a840eb87 --- /dev/null +++ b/algorithms/data-structures/BinaryIndexedTree2d.cpp @@ -0,0 +1,35 @@ +// Binary Indexed Tree of sum in 2d array +// AbraaoCF - UFCG +#include +using namespace std; +#define maxx 1100 +int bit[maxx][maxx]; +void update(int idx, int idy, int value) +{ + while(idx <= maxx) + { + int idy_temp = idy; + while(idy_temp <= maxx) + { + bit[idx][idy_temp] += value; + idy_temp += (idy_temp &-idy_temp); + } + idx += (idx&-idx); + } + return; +} +int query(int idx,int idy) +{ + int sum = 0; + while(idx > 0) + { + int idy_temp = idy; + while(idy_temp > 0) + { + sum += bit[idx][idy_temp]; + idy_temp -= (idy_temp &-idy_temp); + } + idx -= (idx&-idx); + } + return sum; +} From af51291720c70e9edb07ee88a4a8166a6f479b34 Mon Sep 17 00:00:00 2001 From: ameycodes Date: Thu, 8 Oct 2020 12:43:04 +0530 Subject: [PATCH 268/285] Added: Create single coloured blank image --- .../image-processing/createColoredImage.cpp | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 algorithms/image-processing/createColoredImage.cpp diff --git a/algorithms/image-processing/createColoredImage.cpp b/algorithms/image-processing/createColoredImage.cpp new file mode 100644 index 00000000..25a33a2e --- /dev/null +++ b/algorithms/image-processing/createColoredImage.cpp @@ -0,0 +1,48 @@ +// Create a coloured image in C++ using OpenCV. + +#include "opencv2/highgui/highgui.hpp" +using namespace cv; +using namespace std; + +int main() +{ + // To create an image + // CV_8UC3 depicts : (3 channels,8 bit image depth + // Height = 500 pixels, Width = 1000 pixels + // (0, 0, 100) assigned for Blue, Green and Red + // plane respectively. + // So the image will appear red as the red + // component is set to 100. + Mat img(500, 1000, CV_8UC3, Scalar(0,0, 100)); + + // check whether the image is loaded or not + if (img.empty()) + { + cout << "\n Image not created. You" + " have done something wrong. \n"; + return -1; // Unsuccessful. + } + + // first argument: name of the window + // second argument: flag- types: + // WINDOW_NORMAL If this is set, the user can + // resize the window. + // WINDOW_AUTOSIZE If this is set, the window size + // is automatically adjusted to fit + // the displayed image, and you cannot + // change the window size manually. + // WINDOW_OPENGL If this is set, the window will be + // created with OpenGL support. + namedWindow("A_good_name", CV_WINDOW_AUTOSIZE); + + // first argument: name of the window + // second argument: image to be shown(Mat object) + imshow("A_good_name", img); + + waitKey(0); //wait infinite time for a keypress + + // destroy the window with the name, "MyWindow" + destroyWindow("A_good_name"); + + return 0; +} From c99ee6b1bb3e1f5b5332ea768a99b0e4f5f8adbe Mon Sep 17 00:00:00 2001 From: ameycodes Date: Thu, 8 Oct 2020 12:49:53 +0530 Subject: [PATCH 269/285] Added: Create Gaussian filter --- .../image-processing/createGaussianFilter.cpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 algorithms/image-processing/createGaussianFilter.cpp diff --git a/algorithms/image-processing/createGaussianFilter.cpp b/algorithms/image-processing/createGaussianFilter.cpp new file mode 100644 index 00000000..0e7ab6f9 --- /dev/null +++ b/algorithms/image-processing/createGaussianFilter.cpp @@ -0,0 +1,43 @@ +// Generate Gaussian filter + +#include +#include +#include +using namespace std; + +// Function to create Gaussian filter +void FilterCreation(double GKernel[][5]) +{ + // intialising standard deviation to 1.0 + double sigma = 1.0; + double r, s = 2.0 * sigma * sigma; + + // sum is for normalization + double sum = 0.0; + + // generating 5x5 kernel + for (int x = -2; x <= 2; x++) { + for (int y = -2; y <= 2; y++) { + r = sqrt(x * x + y * y); + GKernel[x + 2][y + 2] = (exp(-(r * r) / s)) / (M_PI * s); + sum += GKernel[x + 2][y + 2]; + } + } + + // normalising the Kernel + for (int i = 0; i < 5; ++i) + for (int j = 0; j < 5; ++j) + GKernel[i][j] /= sum; +} + +int main() +{ + double GKernel[5][5]; + FilterCreation(GKernel); + + for (int i = 0; i < 5; ++i) { + for (int j = 0; j < 5; ++j) + cout << GKernel[i][j] << "\t"; + cout << endl; + } +} From 2d001f0ed22272ea2f620763dfc488887e052606 Mon Sep 17 00:00:00 2001 From: Parmeet Singh Date: Fri, 9 Oct 2020 01:37:04 +0530 Subject: [PATCH 270/285] Add files via upload --- .../kthLargestUsingPriorityQueue.cpp | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp diff --git a/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp b/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp new file mode 100644 index 00000000..c24bf19d --- /dev/null +++ b/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp @@ -0,0 +1,44 @@ +#include +using namespace std; + +/* + +Given an array A of random integers and an integer k, find and return the kth largest element in the array. + +*/ + +int kthLargest (vector arr, int n, int k){ + + priority_queue, greater> pq; + + for(int i = 0; i < k; i++) { + pq.push(arr[i]); + } + + for(int i = k; i < n; i++) { + int val = pq.top(); + if(arr[i] > val) { + pq.pop(); + pq.push(arr[i]); + } + } + + return pq.top(); + +} + +int main() { + int n, k, s; + vector arr; + cin >> n; + + for (int i = 0; i < n; i++) { + cin >> s; + arr.push_back(s); + } + + cin >> k; + cout << kthLargest(arr, n, k) << endl; +} + + From 3931b00eb7de21c31252fdd772a2d8de7e31e8ab Mon Sep 17 00:00:00 2001 From: Pratyush Pandey <64234448+Back-Log@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:26:26 +0530 Subject: [PATCH 271/285] Prime Factorization C++ Program Efficient Program to calculate all the Prime factors of a given number. --- algorithms/math/Prime_Factorization.cpp | 75 +++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 algorithms/math/Prime_Factorization.cpp diff --git a/algorithms/math/Prime_Factorization.cpp b/algorithms/math/Prime_Factorization.cpp new file mode 100644 index 00000000..f4ed245b --- /dev/null +++ b/algorithms/math/Prime_Factorization.cpp @@ -0,0 +1,75 @@ +#include +#include +using namespace std; +vectorget_factors(vector&primes,int n) +{ + vectorans; + ans.clear(); + for(int i=0;i*i<=n;i++) + { + if(n%primes[i]==0) + { + ans.push_back(primes[i]); + while(n%primes[i]==0) + { + n=n/primes[i]; + } + + } + } + if(n!=1) + { + ans.push_back(n); + } + return ans; +} +vectorget_prime(vector&prime,int n) +{ + for(int i=3;i<=1000;i+=2) + { + prime[i]=1; + } + //mark all the even number as non prime + for(int i=3;i*i<=1000;i+=2) + { + if(prime[i]==1) + { + for(int j=i*i;j<=1000;j+=i) + { + prime[j]=0; + } + } + } + prime[0]=prime[1]=0; + prime[2]=1; + vectorfectors; + for(int i=2;i<=1000;i++) + { + if(prime[i]==1) + { + fectors.push_back(i); + } + } +return fectors; + +} +int32_t main() +{ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + //first task to genrate prime fectors and store it + vectorp(1000,0); + //now we have all prime number till n + int n; + cin>>n; + //enter n (the number you want to get prime fector) + vectorprimes=get_prime(p,n); + vectorans=get_factors(primes,n); + cout<<"Prime Factors are :"; + for(auto i:ans) + { + cout< Date: Mon, 12 Oct 2020 12:39:58 +0530 Subject: [PATCH 272/285] Create divide_string_in_n_equal_parts.cpp This c++ program divides a string into n equal parts. --- .../divide_string_in_n_equal_parts.cpp | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 algorithms/strings/divide_string_in_n_equal_parts.cpp diff --git a/algorithms/strings/divide_string_in_n_equal_parts.cpp b/algorithms/strings/divide_string_in_n_equal_parts.cpp new file mode 100644 index 00000000..83e423fb --- /dev/null +++ b/algorithms/strings/divide_string_in_n_equal_parts.cpp @@ -0,0 +1,53 @@ +// C++ program to divide a string +// in n equal parts +#include +#include + +using namespace std; + +class string_division +{ + +// Function to print n equal parts of str +public: +void divide_String(char str[], int n) +{ + + int str_size = strlen(str); + int i; + int part_size; + + // Check if string can be divided in + // n equal parts + if (str_size % n != 0) + { + cout<<"Invalid Input: String size"; + cout<<" is not divisible by n"; + return; + } + + // Calculate the size of parts to + // find the division points + part_size = str_size / n; + for (i = 0; i< str_size; i++) + { + if (i % part_size == 0) + cout< Date: Tue, 13 Oct 2020 10:46:32 +0530 Subject: [PATCH 273/285] Added AVL Tree Implementation --- data-structures/avl.cpp | 175 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 data-structures/avl.cpp diff --git a/data-structures/avl.cpp b/data-structures/avl.cpp new file mode 100644 index 00000000..3be62efe --- /dev/null +++ b/data-structures/avl.cpp @@ -0,0 +1,175 @@ +#include +#include +using namespace std; + +struct node +{ + int data, height; + node *left, *right; +}; + +class avl +{ + node* root=NULL; +public: + int height(node* root){ + if(root) + return root->height; + return 0; + } + node* rotateLeft(node* root){ + node* newroot = root->right; + root->right = newroot->left; + newroot->left = root; + return newroot; + } + node* rotateRight(node* root){ + node* newroot = root->left; + root->left = newroot->right; + newroot->right = root; + return newroot; + } + void insert(int x){ + this->root = insert(this->root, x); + } + node* insert(node* root, int x){ + if(root==NULL){ + root = new node; + root->data = x; + root->height = 1; + root->left = NULL; + root->right = NULL; + return root; + } + if(x < root->data) + root->left = insert(root->left,x); + else if(x > root->data) + root->right = insert(root->right,x); + else + return root; + + int lh = height(root->left), rh = height(root->right); + root->height = 1 + max(lh,rh); + + lh -= rh; + if(lh>1){ + if(x > root->left->data) + root->left = rotateLeft(root->left); + return rotateRight(root); + } + else if(lh<-1){ + if(x < root->right->data) + root->right = rotateRight(root->right); + return rotateLeft(root); + } + return root; + } + int minValue(node* root){ + while(root->left) + root = root->left; + return root->data; + } + void remove(int x){ + this->root = remove(this->root, x); + } + node* remove(node* root, int x){ + if(root == NULL) + return NULL; + if(x < root->data) + root->left = remove(root->left, x); + else if(x > root->data) + root->right = remove(root->right, x); + else{ + if(root->left == NULL && root->right == NULL){ + delete root; + return NULL; + } + else if(root->right == NULL){ + node* temp = root; + root = root->left; + delete temp; + return root; + } + else if(root->left == NULL){ + node* temp = root; + root = root->right; + delete temp; + return root; + } + else{ + root->data = minValue(root->right); + root->right = remove(root->right, root->data); + } + } + + int lh = height(root->left), rh = height(root->right); + root->height = 1 + max(lh,rh); + + lh -= rh; + if(lh>1){ + if(x > root->left->data) + root->left = rotateLeft(root->left); + return rotateRight(root); + } + else if(lh<-1){ + if(x < root->right->data) + root->right = rotateRight(root->right); + return rotateLeft(root); + } + return root; + } + void printLevel(){ + printLevel(this->root); + } + void printLevel(node* root){ + if(root){ + queue q; + q.push(root); + q.push(NULL); + node* temp; + while(!q.empty()){ + temp = q.front(); + q.pop(); + if(temp){ + cout << temp->data << " "; + if(temp->left) + q.push(temp->left); + if(temp->right) + q.push(temp->right); + } + else if(q.front()){ + cout << endl; + q.push(NULL); + } + } + } + } + void print(){ + print(this->root); + } + void print(node* root){ + if(root){ + print(root->left); + cout << root->data << " "; + print(root->right); + } + } +}; + +int main() +{ + avl a; + a.insert(5); + a.insert(6); + a.insert(7); + a.insert(8); + a.insert(9); + a.insert(4); + a.printLevel(); + a.remove(7); + a.remove(5); + cout << endl; + a.printLevel(); + + return 0; +} \ No newline at end of file From 6178e133e1c6e0ec6fbd10221ba4f56a4f36760c Mon Sep 17 00:00:00 2001 From: Vishal Ved Parashar <36540315+vshalprashr@users.noreply.github.com> Date: Tue, 13 Oct 2020 10:47:39 +0530 Subject: [PATCH 274/285] Add files via upload --- data-structures/binaryTreeMinTimeBurn.cpp | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 data-structures/binaryTreeMinTimeBurn.cpp diff --git a/data-structures/binaryTreeMinTimeBurn.cpp b/data-structures/binaryTreeMinTimeBurn.cpp new file mode 100644 index 00000000..a039c389 --- /dev/null +++ b/data-structures/binaryTreeMinTimeBurn.cpp @@ -0,0 +1,61 @@ +#include +using namespace std; + +class Node{ +public: + int data; + Node *left, *right; + Node(int x){ + this->data = x; + this->left = this->right = NULL; + } +}; + + +pair minTime(Node* node, int *result){ + if(node->left == NULL && node->right == NULL) + return {0,1}; + cout << "Node " << node->data << endl; + pair ansl={0,-1},ansr={0,-1}; + if(node->left) + ansl = minTime(node->left,result); + if(node->right) + ansr = minTime(node->right,result); + if(ansl.second == -1) + return {ansr.first+1,ansr.second+1}; + if(ansr.second == -1) + return {ansl.first+1,ansl.second+1}; + if(ansl.firstleft = new Node(1); + root->right = new Node(2); + root->left->left = new Node(3); + root->left->right = new Node(4); + root->right->left = new Node(5); + root->right->right = new Node(6); + root->left->left->left = new Node(10); + root->left->right->left = new Node(9); + root->right->right->left = new Node(7); + root->right->right->right = new Node(8); + + cout << "Exec Start" << endl; + int *result = new int; + minTime(root,result); + cout << *result << endl; + + return 0; +} \ No newline at end of file From b4fa7fecda5fc312e1647d801276b9fc87863cb4 Mon Sep 17 00:00:00 2001 From: Shivangidubey08 <40246134+Shivangidubey08@users.noreply.github.com> Date: Tue, 13 Oct 2020 15:58:43 +0530 Subject: [PATCH 275/285] Added time complexity in comments. --- .../Priority_Queues/kthLargestUsingPriorityQueue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp b/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp index c24bf19d..582d0118 100644 --- a/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp +++ b/data-structures/Priority_Queues/kthLargestUsingPriorityQueue.cpp @@ -41,4 +41,4 @@ int main() { cout << kthLargest(arr, n, k) << endl; } - +// Time complexity of this solution is O(nlogn). From d24c34298f3ce4f488685719779793fe95a1e2c6 Mon Sep 17 00:00:00 2001 From: Abraham Hernandez Date: Thu, 15 Oct 2020 00:40:26 -0400 Subject: [PATCH 276/285] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 851d09b68395ab1520820e49f4e677c87f9f90ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyH3ME5S$H`2%3=iyhg9dlRD^{)h6{F=*g|$zW3?u`| zKr)aF{4fK&vsK3Dj;WJ@WFQ$hFreo{;Zm#vJ4ZV@sB8ovR&<-t)>%SpN?;w>IWj^K zFC}`Z#E2nYPJfBKINgdUc{cx{>9QEwPWgJAQ|X0ptCP!qW6Exzs%r} zZz-vgfn?ynG9Xp6Xr|m<+^ygCsdsJRdgM~kyiN@Y?cPTKf9N@KVL^`xQ4*?@2RWk4k4154MR59cL From 6d8fa8740412d3ef12c0e787f28438c7870e1b02 Mon Sep 17 00:00:00 2001 From: Celian RAIMBAULT Date: Sun, 18 Oct 2020 12:11:30 +0200 Subject: [PATCH 277/285] Added math/median_subarray --- algorithms/math/median_subarray.cpp | 134 ++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 algorithms/math/median_subarray.cpp diff --git a/algorithms/math/median_subarray.cpp b/algorithms/math/median_subarray.cpp new file mode 100644 index 00000000..710dc833 --- /dev/null +++ b/algorithms/math/median_subarray.cpp @@ -0,0 +1,134 @@ +// * Description : +// Given an array of integers nums and the length of subarrays +// print all medians of each subarrays +// * Example : +// Array : [5,2,2,7,3,7,9,0,2,3], Subarray length : 5 +// Should print : 3 3 7 7 3 3 +// The first subarray is [5, 2, 2, 7, 3], then the median is 3 +// * Complexity : +// O(N log K) time, O(N) space, N = array.size(), K = subarray.size() + +#include +#include +#include + +using namespace std; + +// Method : +// Firstly initialize two heaps, lower and upper such that +// abs(lower.size() - upper.size()) <= 1 && +// median >= lower[i] && median <= upper[i] +// The median is either the average of the two top values +// or the top value of the greatest heap. +// To add a value add it to the smallest heap and swap tops +// if lower and upper don't follow the first condition. +// To remove a value we find it, remove it and add the top of +// the other heap to the updated heap (sizes are now the same). +// We just remove and then add an item for each index of [0, N-k) +// to simulate a sliding window. +vector medianSubarray(vector& values, int k) { + // We use long long instead of int to avoid overflows + // median >= lower[i] && median <= upper[i] + multiset> lower; + multiset upper; + vector medians; + + // Initialize lower and upper + for (int i = 0; i < k; ++i) { + if (lower.size() <= upper.size()) + lower.insert(values[i]); + else + upper.insert(values[i]); + + // Swap values if heaps aren't balanced + if (!lower.empty() && !upper.empty() && + *lower.begin() > *upper.begin()) { + long long tmp = *lower.begin(); + lower.erase(lower.begin()); + lower.insert(*upper.begin()); + upper.erase(upper.begin()); + upper.insert(tmp); + } + } + +// To get the median inline +#define GET_MEDIAN (lower.size() == upper.size() ? \ + (*lower.begin() + (*upper.begin() - *lower.begin()) * .5) : \ + lower.size() > upper.size() ? *lower.begin() : *upper.begin()) + + medians.push_back(GET_MEDIAN); + + for (int i = 0; i < values.size() - k; ++i) { + // Remove the i item + bool removed = false; + if (!lower.empty() && values[i] <= *lower.begin()) { + // Remove it + auto target = lower.find(values[i]); + if (target != lower.end()) { + lower.erase(target); + removed = true; + + // Insert the top of the other heap to the updated heap + if (!upper.empty()) { + lower.insert(*upper.begin()); + upper.erase(upper.begin()); + } + } + } + + if (!removed) { + // Remove it + upper.erase(upper.find(values[i])); + + // Insert the top of the other heap to the updated heap + if (!lower.empty()) { + upper.insert(*lower.begin()); + lower.erase(lower.begin()); + } + } + + // Add the i + k item + if (lower.size() <= upper.size()) + lower.insert(values[i + k]); + else + upper.insert(values[i + k]); + + // Swap values if heaps aren't balanced + if (!lower.empty() && !upper.empty() && + *lower.begin() > *upper.begin()) { + long long tmp = *lower.begin(); + lower.erase(lower.begin()); + lower.insert(*upper.begin()); + upper.erase(upper.begin()); + upper.insert(tmp); + } + + medians.push_back(GET_MEDIAN); + } + + return medians; +} + +int main() { + vector>> dataset = { + {5, {5,2,2,7,3,7,9,0,2,3}}, + {3, {1,3,-1,-3,5,3,6,7}}, + {1, {1,2}}, + {2, {2147483647,2147483647}}, + }; + + // Should be : + // 3 3 7 7 3 3 + // 1 -1 -1 3 5 6 + // 1 2 + // 2.14748e+09 + for (auto test : dataset) { + auto y = medianSubarray(test.second, test.first); + for (double median : y) + cout << median << " "; + + cout << endl; + } + + return 0; +} From 4fa49887c88faaf07a1f563899b76d6ea308e87b Mon Sep 17 00:00:00 2001 From: Sagar Pandya Date: Wed, 21 Oct 2020 20:28:22 +0530 Subject: [PATCH 278/285] remove recursion and implement iteratively --- algorithms/dsu/naive_dsu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/algorithms/dsu/naive_dsu.cpp b/algorithms/dsu/naive_dsu.cpp index 84ea37a9..5686fcc0 100644 --- a/algorithms/dsu/naive_dsu.cpp +++ b/algorithms/dsu/naive_dsu.cpp @@ -33,11 +33,11 @@ void make_set(int val) int find_parent(int val) { - if(val == parent[val]) - { - return val; + while (parent[val] != val) { + parent[val] = parent[parent[val]]; + val = parent[val]; } - return find_parent(parent[val]); + return val; } void union_set(int x, int y) From 4dbd283f87f28b6283598791a15e883959742235 Mon Sep 17 00:00:00 2001 From: Bilal Zafar Date: Fri, 23 Oct 2020 06:51:07 +0500 Subject: [PATCH 279/285] Update prime.cpp We can find the prime number by running only to the half of the number entered. In this way the running time can be decreased. Also we can use bool variable to keep track of prime number rather than integer which is more memory efficient --- algorithms/math/prime.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/algorithms/math/prime.cpp b/algorithms/math/prime.cpp index 02f55b28..1e4a0734 100644 --- a/algorithms/math/prime.cpp +++ b/algorithms/math/prime.cpp @@ -1,14 +1,17 @@ #include using namespace std; -int main() -{int n,flag; -cin>>n; -//to check whether a number is prime or not -for(int i=2;i0) - cout<<"number is not prime"<>n; + //to check whether a number is prime or not + bool isPrime=true; + for(int i = 2 ;i <= n/2; i++){ + if( n%i == 0){ + isPrime=false; + break; + } + } + if(isPrime) cout<<"Number is Prime"< Date: Fri, 23 Oct 2020 22:28:24 +0530 Subject: [PATCH 280/285] Added Simplest algorithm for SumSquareBinomial --- .../sum_of_square_of_binomial_coefficient.cpp | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 algorithms/math/sum_of_square_of_binomial_coefficient.cpp diff --git a/algorithms/math/sum_of_square_of_binomial_coefficient.cpp b/algorithms/math/sum_of_square_of_binomial_coefficient.cpp new file mode 100644 index 00000000..032034db --- /dev/null +++ b/algorithms/math/sum_of_square_of_binomial_coefficient.cpp @@ -0,0 +1,32 @@ +/* +Program :To find the sum of square of +binomial coefficient. + +This Program is contributed by Abhishek Jaiswal +*/ +#include +using namespace std; + +int factorial(int begin, int end) +{ + int num = 1; + for (int i = begin; i <= end; i++) + num *= i; + + return num; +} + +int square(int n) +{ + return factorial(n + 1, 2 * n) / factorial(1, n); +} + +int main() +{ + int n; + cout << "Enter the number :"; + cin >> n; + cout << "The Sum of Square is " << square(n) << endl; + return 0; +} + From 93c4ffbcc7cc8c8afaa87e99328a25bd14c4b982 Mon Sep 17 00:00:00 2001 From: Abhishek Jasiwal <73077352+b419007@users.noreply.github.com> Date: Fri, 23 Oct 2020 23:22:33 +0530 Subject: [PATCH 281/285] Added SimplestAlgorithm Two_Binary_string_addition --- algorithms/strings/adding_two_string.cpp | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 algorithms/strings/adding_two_string.cpp diff --git a/algorithms/strings/adding_two_string.cpp b/algorithms/strings/adding_two_string.cpp new file mode 100644 index 00000000..1d4fc3cc --- /dev/null +++ b/algorithms/strings/adding_two_string.cpp @@ -0,0 +1,59 @@ +/* +Program : To add 2 string + +this Program is Contributed by github@b419007 +*/ + +#include +using namespace std; + +int Len(string &str1, string &str2) +{ + int len1 = str1.size(); + int len2 = str2.size(); + if (len1 < len2) + { + for (int i = 0 ; i < len2 - len1 ; i++) + str1 = '0' + str1; + return len2; + } + else if (len1 > len2) + { + for (int i = 0 ; i < len1 - len2 ; i++) + str2 = '0' + str2; + } + return len1; +} + +string add( string a, string b ) +{ + string result; + int len = Len(a, b); + + int carry = 0; + for (int i = len-1 ; i >= 0 ; i--) + { + int aBit = a.at(i) - '0'; + int bBit = b.at(i) - '0'; + int sum = (aBit ^ bBit ^ carry)+'0'; + + result = (char)sum + result; + carry = (aBit & bBit) | (bBit & carry) | (aBit & carry); + } + + if (carry) + result = '1' + result; + + return result; +} + +int main() +{ + string str1,str2; + cout<<"Enter the string 1 :"; + cin>>str1; + cout<<"Enter the string 2 :"; + cin>>str2; + cout << "Sum is " << add(str1, str2); + return 0; +} From e53da6986845f302f64c0b7f717e6bf69238195a Mon Sep 17 00:00:00 2001 From: Cigan Oliviu David Date: Tue, 17 Nov 2020 13:33:30 +0200 Subject: [PATCH 282/285] Refactor bubble_sort --- algorithms/sorting/bubble_sort.cpp | 115 +++++++++++++++++++---------- 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/algorithms/sorting/bubble_sort.cpp b/algorithms/sorting/bubble_sort.cpp index ed22d402..7b23d915 100644 --- a/algorithms/sorting/bubble_sort.cpp +++ b/algorithms/sorting/bubble_sort.cpp @@ -8,47 +8,80 @@ // Contributed by: Abhishek Jaiswal // Github: @Abhishek-iiit // -#include -#include - -using namespace std; - -void bubbleSort(int arr[], int n) -{ - int i, j; - bool changed; - for (i = 0; i < n-1; i++) - { - changed = false; - for (j = 0; j < n-i-1; j++) - { - if (arr[j] > arr[j+1]) - { - swap(arr[j],arr[j+1]); - changed = true; +// Refactoring by: Cigan Oliviu David +// Github: @CiganOliviu +// + +#include + + +unsigned int readLength() { + + unsigned int length; + + std::cin >> length; + + return length; +} + +void readArray(int array[], unsigned int length) { + + for (int i = 0; i < length; i++) + std::cin >> array[i]; +} + + +void bubbleSortArray(int array[], unsigned int length) { + + bool changed; + + length -= 1; + + for (int i = 0; i < length; i++) { + + changed = false; + + for (int j = 0; j < length - i; j++) { + + if (array[j] > array[j + 1]) { + + std::swap(array[j], array[j+1]); + changed = true; + } } - } - if (changed == false) - break; - } -} - -int main() -{ - int n; - cout<<"Input the total size :"<>n; - int arr[n]; - cout<<"Input the number one-by-one :"<>arr[i]; - } - bubbleSort(arr,n); - cout<<"Sorted array:"< Date: Tue, 28 Feb 2023 21:22:48 +0700 Subject: [PATCH 283/285] Add files via upload added simple LinkedList.cpp --- data-structures/linkedList.cpp | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 data-structures/linkedList.cpp diff --git a/data-structures/linkedList.cpp b/data-structures/linkedList.cpp new file mode 100644 index 00000000..33ef17bc --- /dev/null +++ b/data-structures/linkedList.cpp @@ -0,0 +1,56 @@ +#include + +using namespace std; + +class Node { +public: + int data; + Node* next; + + Node(int data) { + this->data = data; + this->next = NULL; + } +}; + +class LinkedList { +public: + Node* head; + + LinkedList() { + this->head = NULL; + } + + void addNode(int data) { + Node* newNode = new Node(data); + if (this->head == NULL) { + this->head = newNode; + return; + } + Node* currentNode = this->head; + while (currentNode->next != NULL) { + currentNode = currentNode->next; + } + currentNode->next = newNode; + } + + void printList() { + Node* currentNode = this->head; + while (currentNode != NULL) { + cout << currentNode->data << " "; + currentNode = currentNode->next; + } + cout << endl; + } +}; + +int main() { + LinkedList list; + list.addNode(1); + list.addNode(2); + list.addNode(3); + list.addNode(4); + list.addNode(5); + list.printList(); + return 0; +} \ No newline at end of file From e5c1ce903586a7e39480fd0c4ba72200e9535a98 Mon Sep 17 00:00:00 2001 From: Alex Stan <90788596+Ultra980@users.noreply.github.com> Date: Sun, 15 Oct 2023 22:13:15 +0300 Subject: [PATCH 284/285] Create vowel_counter.cpp --- algorithms/strings/vowel_counter.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 algorithms/strings/vowel_counter.cpp diff --git a/algorithms/strings/vowel_counter.cpp b/algorithms/strings/vowel_counter.cpp new file mode 100644 index 00000000..4dca0389 --- /dev/null +++ b/algorithms/strings/vowel_counter.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; + +int main() { + string s; + int cnt; + cout << "Enter the string: "; + cin >> s; + + cnt = 0; + for ( char ch : s ) { + switch ( ch ) { + case 'a': + case 'e': + case 'i': + case 'o': + case 'u': + cnt++; + break; + default: + break; + } + } + + cout << "The string has " << cnt << " vowels.\n"; + + return 0; +} From 15328b884caff892a019056d21a354dceecf8716 Mon Sep 17 00:00:00 2001 From: kelijah1121 <148648133+kelijah1121@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:23:31 -0500 Subject: [PATCH 285/285] Update matrix_linear.cpp fixed small typo in library causing code to not work --- algorithms/matrix_linear.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/matrix_linear.cpp b/algorithms/matrix_linear.cpp index d466729f..75ead31e 100644 --- a/algorithms/matrix_linear.cpp +++ b/algorithms/matrix_linear.cpp @@ -1,5 +1,5 @@ // represent linear equation in form of matrix -#include +#include #include using namespace std;