diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index df758646540..1242fdc2a68 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -121,7 +121,13 @@ class RPCParser static Json::Value jvParseCurrencyIssuer(std::string const& strCurrencyIssuer) { - static boost::regex reCurIss("\\`([[:alpha:]]{3})(?:/(.+))?\\'"); + // Matches a sequence of 3 characters from + // `ripple::detail::isoCharSet` (the currency), + // optionally followed by a forward slash and some other characters + // (the issuer). + // https://www.boost.org/doc/libs/1_82_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html + static boost::regex reCurIss( + "\\`([][:alnum:]<>(){}[|?!@#$%^&*]{3})(?:/(.+))?\\'"); boost::smatch smMatch; diff --git a/src/ripple/protocol/impl/UintTypes.cpp b/src/ripple/protocol/impl/UintTypes.cpp index ff2644b085b..821e81238b0 100644 --- a/src/ripple/protocol/impl/UintTypes.cpp +++ b/src/ripple/protocol/impl/UintTypes.cpp @@ -93,14 +93,8 @@ to_currency(Currency& currency, std::string const& code) currency = beast::zero; - std::transform( - code.begin(), - code.end(), - currency.begin() + detail::isoCodeOffset, - [](auto c) { - return static_cast( - ::toupper(static_cast(c))); - }); + std::copy( + code.begin(), code.end(), currency.begin() + detail::isoCodeOffset); return true; }