• Anonymous
  • Login
  • Register
Regular Expressions for LotusScript

Owners Harald Albers Project Creation Sep 21, 2010
Contributors - Last Release Sep 29, 2010
Downloads 505Download Latest Release
Rating
(2 ratings)
Description Regular Expression support for LotusScript


This project enables LotusScript developers to use Regular Expressions in their code.
It does so by providing a script library with simple wrappers around Java classes that are invoked by LS2J.
The wrapper classes behave like native LotusScript classes. All the clumsiness of JNI declarations that comes with using LS2J is abstracted away from the user.
 
The SimpleRegexMatcher can determine whether a text matches a pattern.
In case of a match it gives you access to the matching part of the original text via its Match property.
 
The RegexMatcher combines java.util.regex.Pattern and java.util.regex.Matcher into one handy LotusScript wrapper to perform Regular Expression operations on text.
You can do repeated matches on the same string with the find() method to locate multiple occurrences of pattern matches, and you can access captured groups with the group() function. The replaceAll() and replaceFirst() methods let you replace matching parts with strings that may contain backreferences to captured parts of the original string.

In contrast to the SimpleRegexMatcher that is targeted to users new to the java.util.regex classes, RegexMatcher assumes a basic level of familiarity with the underlying Java classes.
 
The Regular Expressions used in this class follow java.util.regex.Pattern syntax as described in
        http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
 
Intended audience: LotusScript developers.
 
example code
    Use "Regular Expressions"

    ' This example searches for an agent with licence to kill.
    Dim Matcher1 As New SimpleRegexMatcher
    If Matcher1.matches("James Bond is agent 007.", "\b00\d\b") Then
        Print "found agent #" & Matcher1.Match  ' prints "found agent #007"
    End If
 

    ' Find name of someone who introduces himself in a James Bondish way.

    ' This example features capture groups and a backreference to the first capture group.
    Dim Matcher2 As New RegexMatcher("My name is Presley. Elvis Presley.", "name is (\w+)\. (\w+) \1\.", 0)
    If Matcher2.find() Then
        Print Matcher2.group(2) & " " & Matcher2.group(1' prints "Elvis Presley"
    End If

    ' Replace parts of the input using captured groups
    Dim Matcher3 As New RegexMatcher("from 10:00 to 12:00", "from (\d\d:\d\d) to (\d\d:\d\d)", 0)
    Print Matcher3.replaceAll("$1-$2"' prints "10:00-12:00"


Projects can have short and readable URLs, e.g. http://mobilecontrols.openntf.org.

You can request a short URL to your project by sending a mail to support at openntf dot org.
Owners are the people with maximal rights. For example they can create releases and add more contributors.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
Enter the contributors or owners here who you want to receive notifications and questions by email.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
In addition to the owners additional OpenNTF contributors have to be listed here. Contributors don't have the same access rights as owners, e.g. they cannot create releases.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
Enter a short description of the project here (up to 100 characters).

The short description shows up in the project UI and in some of the views.
In this field you should enter a more detailed description of your project.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.
A Catalog Release is for projects that are production ready and that are end-user "install friendly".

This property describes whether any release of this project has been added to the catalog.

Learn more about the catalog.
GitHub can be used as source control repository for OpenNTF projects. In this case the Issues from GitHub are used instead of the Defects from OpenNTF.

Contact ip-manager@openntf if you want to have a GitHub project created in the OpenNTF space.

Learn more about OpenNTF on GitHub