Hot answers tagged

4

First off, i can recommend Expresso to build and test regular expressions. Try this: <script?\w+((\s+\w+(\s*=\s*(?:"(?<value>.*?)"|'(?<value>.*?)'|[^'">\s]+))?)+\s*|\s*)/?>*</script> Some things to notice: You should run it with Ignore Case, to capture capital script tags. The named capture group "value" contains the value of ...


2

A regular expression you could use to pick up sites that have /docs/ in them would be /^.+/docs/.*/g If you'd like to test what would and wouldn't get caught by this you can test it on a site like http://www.regexr.com/. I like this site in particular because of how easy it is to test with any text as well as having the 'cheatsheet' on the side. EDIT: ...


2

Found the solution... Here's how I changed my code. private void UploadAttachments(Helper sharePointHelper, IList<HttpPostedFile> postedFileCollection, int itemId) { // Get the list SPList listToUpdate = Helper.GetList(this.BackendListName); SPListItem itemToUpdate = null; // Get the existing item to update itemToUpdate = ...


2

This is not possible as FAST supports FQL (FAST Query Language) and not regular expressions. Your best bet is to create an external processors which uses regexp to find social security numbers. If you find a match, assign the value "true" or similar to a crawled property. Then create a managed property of type bool which you map this crawled property. When ...


2

Looks like regex is not exported in the new column validation feature. References: http://www.sharepointdevwiki.com/display/sp2010/Site+Column+Validation Laura Rogers blogged about a way to pull it off in a Data View Web Part: http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=83


1

Use /([^,]*,[^,]*){3}/ or /([^,]*,[^,]*){2,}/ (this one expresses business logic a bit better, explicitly saying '2 or more times') PS: https://regex101.com/ might be useful to test those Update: My bad, I forgot to mention you usually don't need to put regex in / in .NET. A screenshot from that awesome article in MSDN:


1

You can not use regex query with CAML. The closest thing you will get to wildcard searching and CAML is using either the BeginsWith or the Contains element. http://msdn.microsoft.com/en-us/library/ms196501.aspx So the only thing you are missing then is an EndsWith. In regards to dates make sure you format your dates as "yyyy-MM-dd-Thh:mm:ssZ" and all ...


1

check the below answers. will give you the idea how to achieve the target: Change name in ItemAdding event receiver or create a new Item also if you want to use WebDAV: http://simplyaprogrammer.com/2008/05/importing-files-into-sharepoint.html


1

Unless you use any 3rd party workflow products, such as Nintex/K2 or others, you would either need to develop your own activities or use any of the ones available freely (e.g. RegEx based activity) - such http://www.ilovesharepoint.com/2011/02/just-released-advanced-workflow-actions.html Also some other example http://blogs.msdn.com/b/sharepointdesigner/...


1

You could probably first decode the string from html, then trim it and then reencode it to html, like this: var aString = yourTextBoxText; aString= SPEncode.HtmlDecode(aString); Since the texbox will always render <html><div> before the content you can not use .Trim(), instead use: aString = aString.Replace("<html> <div>", ""); ...


1

There is no way to do this. What you can do is detect security numbers at indexing time (with regex if you want) and add them to a managed property like "detectednumbers". Then you can query document that contains a number, or only document that contains a specific number. I'm afraid this is the only way to go.



Only top voted, non community-wiki answers of a minimum length are eligible