mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
* find_i function for case insensitive searching
* card::contains uses case insensitive find * Added card::contains_words for quick search, which searches for each word separately git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1484 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -413,6 +413,14 @@ bool cannocial_name_compare(const String& as, const Char* b) {
|
||||
}
|
||||
}
|
||||
|
||||
size_t find_i(const String& heystack, const String& needle) {
|
||||
if (needle.empty()) return 0;
|
||||
for (size_t i = 0 ; i + needle.size() <= heystack.size() ; ++i) {
|
||||
if (is_substr_i(heystack, i, needle)) return true;
|
||||
}
|
||||
return String::npos;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Regular expressions
|
||||
|
||||
/// Escape a single character for use in regular expressions
|
||||
|
||||
Reference in New Issue
Block a user