Guido's last post is good for a simple way to do this without regular expressions. However if you find you need a more flexible solution, you may need to come back to regular expressions. Good free tutorials on regular expressions can be found at
http://www.regular-expressions.info/tutorial.html and
http://java.sun.com/docs/books/tutorial/essential/regex/ Also of interest is the API for the
Pattern class.
In this case you can also make use of \b to match a word boundary: "\\b11\\b" will match "11" as long as it's preceded and followed by non-word characters, or the beginning or end of the string.
[ April 30, 2008: Message edited by: Jim Yingst ]