One of the most powerful features for Notes R8.0.1+ is Widgets. If you are not familar with widgets I recommend checking out the
tutorial.
However to get the full reach of that feature you do need to know regular expressions. If your a developer that is all well and good, but for your average user it can look very cryptic.
So here are a few easy to remember commands.
\w = Alphanumeric character (A to Z, a to z, 0 to 9)
\W = Not an Alphanumeric character (everything not above)
\d = Numeric digit (0 to 9)
\D = Non-numeric character (not 0 to 9)
\s = Whitespace. This is a space, tab, newline.
\S = Not a whitespace.
. = Match any character.
{x,y} or {x} = repeat the match. x is minimum number of times, y is maximum number of times.
( ) = Grouping your match (more on that later).
[ ] = range of characters to match.
There are many more commands but just with this handful of commands you should be able to match pretty much everything.
So for example. Lets say you have a Part number as follows.
XYZ12345A1A7
There a number of ways to match this. So you need to break it down into the components. For the example we will define the part number as...
XYZ = three characters upper case.
12345 = Five digits
A1A7 = Four alphanumeric characters (case does not matter).
With this set up the following regular expression should match all combinations.
[A-Z]{3}\d{5}\w{4}
Once you know the commands it is very easy to read.
[A-Z]{3} = Match A to Z three times in a row.
\d{5} = the next five characters are numeric digits.
\w{4} = the last four characters are alphanumeric characters.
Lastly lets talk about grouping. The regular expression above would match a part number and mark it as group 0. Now you may have to pass that part number onto a web site that requires "XYZ12345" to go into one field and "A1A7" to go into a second field. So you need to mark these as seperate groups. To do this you put the sections in brackets ( ).
So the final regular expression would be...
([A-Z]{3}\d{5})(\w{4})
and there you go! Simple when you know how! :D