I absolutely hate RegEx, I really need to learn it – it’s so powerful. Here’s the issue:
I’m trying to rewrite URLs in IIS, and I’ve got this default RegEx:
^([^/]+)/?$
However, that does let things like this business/profile.html through, but it lets business-profile.html through.
How do I change it so that it lets the former through?
Thanks
If you want to understand and learn Regex, learn to break down their meaning when you’re confused as to what they’re doing. Here’s the same regex, in expanded format.
So this regex matches:
/character in it/at the end of itTo “fix” the regex, we need to know what you really mean by “let through”. Do you mean “match the regex?”
(Side note: A great resource is http://www.regular-expressions.info/ – it provides a great cross-tool reference and tutorial for regex use.)