Chat now with support
Chat with Support

Foglight for Java EE Technologies 5.9.13 - Application Servers User Guide

Monitoring Application Servers Monitoring Systems Monitoring Servers Monitoring Deployed Applications Monitoring Requests Managing Traces Using Object Tracking to Locate Memory Leaks Monitoring Methods Application Servers Monitor Views
JVM view Method Groups view Request Types view Entity EJBs view Message Driven EJBs view Stateful Session EJBs view Stateless Session EJBs view Deployed Applications view JSPs/Servlets components view Resource Adapters components view Web Applications components view Web Services components view .NET views JBoss Services views Oracle Services views Tomcat Services views WebLogic Services views WebSphere Services views JMX Administration dashboard JMX Explorer dashboard
Appendix: Regular Expressions

How regular expressions are scanned

When ambiguities are possible, use these rules to decide how regular expressions do their matching.

The rules for applying regular expressions to target strings are as follows:

If a regular expression contains “|” operators, the left most matching sub-expression is chosen. Example: if the regular expression is ‘(cat|dog)’ and the target string is ‘cats and dogs’, the match succeeds with ‘cat’ after the first three letters have been scanned.
In “*”, “+”, and “?” constructs, longer matches are chosen in preference to shorter ones. Example: if the regular expression is ‘^He’s ba*’ and the target string is ‘He’s baaaaack!’, the match succeeds with ‘He’s baaaaa’ after the full list of contiguous a’s have been scanned.

Typical regular expression patterns

The caret and dollar represent the start and end, respectively, of a string. They do not represent characters, but simply the abstract notion of begin and end. They are useful as anchors for the rest of the regular expression.

^www[.]quest[.]com$

www.quest.com but not http://www.quest.com or

www.quest.com/index.html

^com[.]quest[.].*

com.quest.performasure, but not

homedir.com.quest.performasure

rmi$

java.rmi, but not java.rmi.activation

Matching with character classes

Using character classes provides a range of possibilities and enables you to give a specific list. The first example in the table shows the use of a regular expression to match the American or British spelling of the word ‘analyze.’

Analy[sz]e this

Analyze this, and Analyse this

www[0-9][0-9]?[.]example

www0.example, www01.example, but not

www001.example

The regular expression matches ‘www’ followed by a numeral, followed by no more than one more numeral, followed by ‘.example’. Thus, 001 fails the match.

www[^a-zA-Z]?\.example

www.example, www1.example, but not

wwwx.example

www[.]quest[.]com www.quest.com

This is the recommended way of matching the dot separator in Java package names and fully qualified names.

Matching any character: the dot

You use the dot (.) metacharacter when you want to indicate that any character is allowed at this position. Combined with parentheses, dot metacharacters can be used to indicate the number of arbitrary characters to be allowed after another pattern. See the second entry in the table below for an example of this case. The first entry in the table is an illustration of the commonly seen ‘dot-star’ combination, which matches any number of arbitrary characters. Also, it’s important to remember that dots are not metacharacters when they occur within a character class.

com\.quest\..*

com.quest.the rest of the string, commas, spaces, periods, and all.

As long as the test string contains ‘com.quest.’ followed by any number of additional characters, the match succeeds.

[ ]co(.|..|...|....)[ ]

The ‘words’ cod, coal, codes, collar, and even co13 The character classes at both ends of the regular expression contain the space character, which limits the match to space-separated words. The matched word must begin with ‘co’, followed by one, two,

three, or four characters.

594[-./]1026

594-1026, 594.1026, 594/1026

A dot inside a character class is not a metacharacter.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating