Updated: What you're describing is three parts.
What we do want is one or more characters that are digits, forward slash, and :
: [0-9/:]*
(the asterisk means "zero or more instances"). Surrounded by:
<span>(optional stuff we don't want)
is represented as: <span>[^0-9/:]*
(optional stuff we don't want)Currency
is: [^0-9/:]*Currency
(The ^
means "not") - so this will essentially match any number of characters which is not the bits we want, including things like
In c#:
string pattern = @"<span>[^0-9/:]*(?<value>[0-9/:]*)[^0-9/:]*Currency";
Match match = Regex.Match(input, pattern, RegexOptions.SingleLine | RegexOptions.IgnoreCase);
string output = match.Groups["value"].Value;