I have a pretty easy (imo) Regular expression which doesn' translate to C#. RegExr says it works, however testing it in C# doesn't work... Do I need to change anything to make it work in C#?
RegEx:
/https://subdomain[.1]domain[.1]com/(.*)(ashx|axd)/g
Replace:
http://subdomain.domain.com/$1$2
Input string:
<script src="https://subdomain.domain.com/ScriptResource.axd?d=SQ032obz8ZDKgHbn6XZ3X4xN0iWznAgAxgrdjOtFjVj-yUo-Lk-c2r4ciOs2uasdfjiemr4ciOs2uaGYfeYrYGiemnAQT9UzGoQVKs_JPL8l7TA1LjPYKexOcr4ciOs2uar4ciOs2uaHgpZf-tDxkb_le2NhBN0&t=ffffffffb868b5f4"
type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
Sys.Application.initialize();
//]]>
</script>
/(in http://)!! escape them!!/in a regex without escaping them, or using different delimiters, right?//following the protocol specifier would only parse as a single/for the regex I believe. There's plenty of documentation on the .Net Regex class and how to use it. Unfortunately Regex isn't a language in itself and has different implementations on pretty much every platform./and/gat beginning and end that caused the problem.