vlc_linux/vlc-3.0.16/modules/text_renderer/freetype/fonts/dwrite.cpp
/*
 * Remove any extra null characters and escape any regex metacharacters
 */
Remove any extra null characters and escape any regex metacharacters
Remove any extra null characters and escape any regex metacharacters
static wstring SanitizeName( const wstring &name )
{
    const auto pattern = wregex{ L"[.^$|()\\[\\]{}*+?\\\\]" };
    const auto replace = wstring{ L"\\\\&" };
    auto result = regex_replace( wstring{ name.c_str() }, pattern, replace,
                                 regex_constants::match_default | regex_constants::format_sed );
    return result;
}
static wstring SanitizeName ( const wstring & name ) { const auto pattern = wregex { L" \\ \\ \\ \\ " } ; const auto replace = wstring { L" \\ \\ " } ; auto result = regex_replace ( wstring { name . c_str ( ) } , pattern , replace , regex_constants :: match_default | regex_constants :: format_sed ) ; return result ; }
Remove any extra null characters and escape any regex metacharacters
Remove any extra null characters and escape any regex metacharacters