The Developer guide focuses on using regular expressions when using WQL in the pub.xml:queryXMLNode service, thus the doc.p references throughout. In the many examples provided in the doc, you can use the text within and including the slashes. For the example,
doc.p[/\bport\b/].text
you could use the /\bport\b/ within a BRANCH switch label to test if the BRANCH variable has the whole word “port” within it.
The article Mark referenced is at
[url=“wmusers.com”]wmusers.com
As for wM regex compared to Java 5.0/1.5 there are probably differences but in a cursory review, I haven’t seen any that I could point out. Since wM regex predated the Java regex we shouldn’t be surprised if there are a few though. Sun says Java regex is similar to Perl regex ([url=“java.util.regex (Java 2 Platform SE 5.0)”]JDK 19 Documentation - Home).
A summary of the Java regex constructs is located at [url=“Pattern (Java 2 Platform SE 5.0)”]JDK 19 Documentation - Home
I use a little regex test service to verify that any of the regex constructs I create do exactly what I need.
Service: RobSandbox:regexTest
Input: input (string)
Output: result (string)
BRANCH on ‘input’
…/DBILL/: MAP (Put your regex in the label here. Map sets result to “hit”)
…$default: MAP (Map sets result to “no hit”)
When the service is run in Developer, you get prompted for input and the output shows whether the regex matches the input or not. This makes it easy to test various input conditions, such as null variable, empty variable, only spaces, “real” content, etc. Once my regex is “debugged” I copy it to the real place in the integration where it is needed.
HTH
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services