Um, in one sense, that's what Pattern.compile() does - creates Pattern object based on an input string which represents that pattern. But I don't know if that's what you mean. If you mean, is there a method that will tell me to use " |--" in this situation, then no, not really. You have to read the documentation for the java.util.regex.Pattern class. And/or spend time with a good book like O'Reilly's Mastering Regular Expressions. Or just practice a lot.
