About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



Using Regular Expressions To Build SPList Collections

One of my friends just asked me a rather distinctive question. What if I wanted to build a typed collection of SPList objects by passing in a SharePoint web (SPWeb) and a pattern to match the list by (string) into some arbitrary method?

In order to do this, we can presume since the pattern is being passed in as a parameter that in some additional scene it is being constructed and is well-formed. Therefore, we can do a uncomplicated regular expression match leveraging the list title and the pattern. Following, test the result of the match, ensuring that it coordinates to success. We then return the collection if the count is higher than 0, otherwise just return null.

C#:
  1. public static List<SPList> PoolListsByExpression(string pattern, SPWeb web)
  2. {
  3. List<SPList> tempListCollection = new List<SPList>();
  4. foreach (SPList list in web.Lists)
  5. {
  6. if (Regex.Match(list.Title, pattern).Success)
  7. {
  8. tempListCollection.Add(list);
  9. }
  10. }
  11. if (tempListCollection.Count> 0)
  12. {
  13. return tempListCollection;
  14. }
  15. return null;
  16. }

  • Share/Bookmark

2 Comments »

  1. [...] Using Regular Expressions To Build SPList Collections [...]

    Pingback by Links (7/15/2008) « Steve Pietrek - Everything SharePoint — July 15, 2008 @ 5:49 pm

  2. [...] 2008-10-08 – Using Regular Expressions To Build SPList Collections saved by ajonser2008-10-03 – Coin slots saved by sad12672008-10-02 – Data Center Security – 5 Critical Requirements saved by Osmosis2008-09-30 – More SQL saved by soviepills2008-09-27 – Multi-mold high frequency PWM controller UCC39421/2 and application saved by waven152008-09-14 – Even More GNUMP3d saved by TMF72008-09-11 – The Default Ruby Dial Plan Demystified saved by qdiddy10q2008-09-07 – Redirects: Good, Bad & Conditional saved by jasonscheirer [...]

    Pingback by Websites tagged "patternmatch" on Postsaver — October 8, 2008 @ 1:55 am

RSS feed for comments on this post. TrackBack URL

Leave a comment