mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Cleanup and overhaul (#21)
* Syntax cleanup * More minor cleanup, use Linq * Fix broken features by using correct values * Feature flags the same * Features are modular * No AlphaFS, more .NET versions * Fix appveyor * Put back identifiers, for some reason * String interpolation, modernization * Better use of GetField * XmlTextWriter to remove possible issues * Fix header for OpenMSX
This commit is contained in:
@@ -155,13 +155,13 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
string needleString = needle as string;
|
||||
string strawString = straw as string;
|
||||
if (!String.IsNullOrWhiteSpace(strawString) && needleString != null)
|
||||
if (!string.IsNullOrWhiteSpace(strawString) && needleString != null)
|
||||
{
|
||||
string regexStraw = strawString;
|
||||
|
||||
// If the straw has no special characters at all (excluding whitespace), treat it as an exact match
|
||||
if (regexStraw == Regex.Escape(regexStraw).Replace("\\ ", " "))
|
||||
regexStraw = "^" + regexStraw + "$";
|
||||
regexStraw = $"^{regexStraw}$";
|
||||
|
||||
// Check if a match is found with the regex
|
||||
found |= Regex.IsMatch(needleString, regexStraw, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
|
||||
|
||||
Reference in New Issue
Block a user