kamagra how much to take

Using Regular Expressions For SharePoint List Collection Queries

It’s pretty common that when working heavily with SharePoint based applications that make heavy use of numerous SharePoint lists that you often have to query down into SPListCollection collections using some sort of search criteria. The below example builds a typed collection consuming a regular expression pattern specified as a string literal and an SPListCollection, using a Regex.Match in order to build a typed SPList collection.

  1.         public static List&<SPList> GetListFromCollectionByName(string pattern, SPListCollection listCollection)
  2.         {
  3.             var list = new List<SPList>();
  4.             foreach (SPList iteratedList in listCollection)
  5.             {
  6.                 if (Regex.Match(iteratedList.Title, pattern).Success)
  7.                 {
  8.                     list.Add(iteratedList);
  9.                 }
  10.             }
  11.             return list.Count > 0 ? list : null;
  12.         }

No Comments


  1. Links (9/7/2009) « Steve Pietrek – Everything SharePoint - [...] Using Regular Expressions For SharePoint List Collection Queries [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>