Reputation: 47
I have problem to use regular expression at Sharepoint 2013 Search. I insert it into crawl rule and checked Use regular expression syntax for matching this rule.
I valid my regex on page regex101 so I am sure at 100% it is right.
^(https?:\/\/)([\da-zA-z\.]+)\/([\da-zA-z]+)$
This is on the first place of craw rules and I select exclude, but pages are still searchable. What am I doing wrong?
Upvotes: 1
Views: 2481
Reputation: 627292
Please pay attention that according to MSDN blogs (though it is for MS SharePoint 2010, I think it is still valid for 2013, too)
Regular expression operators cannot be used in the protocol part of the URL. This means, for example, the following RegEx rule cannot be created: .//www.microsoft.com/. If you try to create a rule like this, the system will add http:// in the beginning and thus make “.” as the second part of the URL. The resulting rule in this case will be: http:// .//www.microsoft.com/.* which may not be what you intended.
So, try just ([\da-zA-Z.]+)\/([\da-zA-Z]+)$
.
Or even ([^\/]+)\/([^\/]+)$
Upvotes: 2