Value Lists and Collections: Wildcard Collections and Java Regex Expressions

From DocWiki

Jump to: navigation, search

Value Lists and Collections: Wildcard Collections and Java Regex Expressions

Problem Summary The Release 8.0(1) online help has incorrect content on creating Wildcard collections.
Error Message None
Possible Cause N/A
Recommended Action Wildcard collections use java regular expressions. Some simple examples of regular expressions are included below:
  • Exact match: If you want to match one item, enter the string you want to match in the Wildcard field. For example: Agent_10.
  • Any character: Specifying "." as part of the pattern will match any character. For example: the pattern "p.g" will match "p" followed by any other single character and then a "g" character: pig, pag, psg, pog.
  • List of valid characters: Use brackets to specify a list of valid characters. For example: the pattern "p[ie]g" will match "p" followed by an "i" OR "e" character and then a "g" character: pig, peg.
  • Negation: Using a caret ^ specifies that the pattern can contain any character except the specified characters. For example: the pattern "p[^ie]g" " will match "p" followed by anything except an "i" or "e" character and then a "g" character: pag, pbg.
  • Range: Specifies a range of valid characters using brackets. For example, the pattern "p[0-9]g" will match "p" followed by 0,1,2,3,4,5,6,7,8,or 9 followed by a "g" character: p0g, p1g, p2g, p3g, p4g, p5g, p6g, p7g, p8g, p9g.
  • Zero or more match: Specifies that the preceeding expression will be repeated 0 or more times. For example, the pattern "p.*g" will match the character "p", followed by 0 or more characters, followed by a "g" character: pg, pig, peg, piig, peeg.
  • One or more match: Specifies that the preceeding expression will be repeated 1 or more times. For example, the pattern "p.+g" will match the character "p", followed by 1 or more characters, followed by a "g" character: pig, peg, piig, peeg.
  • Escape character: Specifies that the character following the backslash should not be interpreted. Tthis allows brackets, periods, and other characters to be part of the pattern. For example, the pattern "p\[ie\]g" matches "p" followed by a "[", followed by a "i", followed by an "e", followed by a "]", and then followed by a "g" character: p[ie]g.

For more information refer to Java Regular Expressions documentation for more examples and how to build more complex patterns.

Release Release 8.0(1)
Associated CDETS # CSCtg59053

Rating: 0.0/5 (0 votes cast)

Personal tools