Nintex Workflow - using all Regex options in your actions

 

Nintex Workflows supports a Regular Expression action.  This action has a very simple configurable UI with only the "Ignore case" option.

But there are a number of other very interesting Regex Options that you may want to use in your pattern.  This blog article is about how to enable them, and what sort of patterns you might use them for.

 

Regular Expression Options

Making an educated guess that the Nintex workflows uses the standard .NET Regular Expression (System.Text.RegularExpressions.Regex) rather than implementing their own regex engine.  Here's a list of the Regular Expression Options supported in the .NET Framework.

http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx

  • i = IgnoreCase (this option is available in the Nintex action)
  • m = Multiline, if enabled, ^ and $ matches beginning and end of each line, rather than the whole block of text
  • s = Singleline, if enabled, . (period) matches all characters including newline (\n), by default, the period character only matches [^\n] (any character except the newline).
  • n = ExplicitCapture, don't capture groups
  • x = IgnorePatternWhitespace, ignore unescaped whitespace, and allow inline # comments

 

Using Regex Options within a pattern group

.NET allows you to use regular expressions with special options within a pattern group.  To do this, the pattern is:

  • (?imnsx-imnsx:pattern)

You can read up about it here: http://msdn.microsoft.com/en-us/library/bs2twtah.aspx#group_options

Lets see some examples.

 

Using the multiline option

Example, given this block of text:

Dear John,

Thanks for the email.

/footer

We want to extract the line that has the word "thanks".

We can use this expression:

  • (?m:^.*thanks.*$)
  • multiline match of any line that contains the word thanks.  Match from beginning of line ^ to end of line $.

image

The results in the workflow:

image

 

Using the singleline option

Example, given this block of text:

Dear John,

Thanks for the email.

/footer

We want to capture everything before the /footer.

  • ^(?s:.*)(?=/footer)
  • use singleline option, match any character (including line breaks).  Use a positive look-ahead match on /footer, but don't actually include it in the pattern match result.

image

The results in the workflow:

image

Removing HomeGroup icon from Windows 8 desktop

This morning, I found a HomeGroup icon in my Windows 8 Deskotp.  I'm not actually sure what happened and how it appeared.  I am pretty sure it wasn't there last night.

To remove it, but not remove it from Explorer, search for "desktop icons"

image

 

I toggle the selection for "Network" on, then off again.

image

OK, and the HomeGroup icon has disappeared from the desktop.

How to create your Windows 8 Start Button with PowerShell

Before I go on, I have to say I find the Start Menu unnecessary.  There are already many ways to get to your Start Screen:

  • Throw mouse to lower-left corner (with the mouse)
  • Press the Windows key (on your keyboard)
  • Swipe in from the left edge (touch screen)
  • Press the Start button (any device with a hardware start button)

 

That said, Windows is still about choice.  And here's how you can add your own "Start Menu Button"

  1. Create a shortcut.
  2. Type in this:
    powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [Windows.Forms.SendKeys]::SendWait('^({ESC})')"

    (all in one line)
    This sends the Windows key (CTRL-ESC) via Powershell.
    image
  3. Configure the shortcut to run minimized
    image
  4. Change the Icon, I select this icon from the bootux.dll file %SystemRoot%\System32\bootux.dll) 
    image
    (All the icons are white, select them to see what they look like) 
  5. Drag the shortcut and pin it to the task bar, on the far left.
    image
  6. Now you have that familiar Start menu button back.  Click it and you'll get the Start Screen to pop up. 
    image

 

Notes

  • Does not appear to work in Windows RT, but if you have a Surface just hit that start hardware button

SharePoint Saturday Sydney 2012

Thank you all for attending SharePoint Saturday, giving up your time.  Sydney marks the last of the 6 SharePoint Saturdays that I've had the privilege to present in this year, ticking off:

The best part of SharePoint Saturday is just meeting talking to the enthusiastic SharePoint fans and hear what people are doing out there.  Honestly, not many people are that crazy to give up a sunny Saturday to learn about SharePoint - you guys are amazing.

The worst part is the travel. 

 

Sydney SharePoint User Group

I was honestly surprised almost everybody already know about the Sydney SharePoint User Group.  We meet monthly in the CBD between 6-7pm on the 3rd Tuesday of the Month.  We actually start at 5:30pm to eat up all the pizza first, and for the guys that don't need to head home right away, join us at the pub and geek out.

Sign up here so you can see what topic is coming up next month:

 

Golf Course

The User Group gave away a Miniature Golf Course during the event.

The Miniature Book of Miniature Golf

If you didn't manage to win one, but is still interested in it, it's here:

 

Downloads

InfoPath form load rules and loading event order

 

A strange gotcha in InfoPath concerning which event runs first.

  • Create an InfoPath form, with a field.
  • Create a Form Load rule, that sets this field to 1.
  • Add code behind, and create a Form_Loading event, that sets the same field to 2.

 

In InfoPath rich client form / debugging

  • The result number is 2

In InfoPath browser form

  • The result number is 1

 

Keep this order in mind if you use both Form Load rules as well as Form_Loading event.