| Author |
Nesting or subroutines in RegEx Pattern class
|
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4422
|
|
I'm writing a small parser for the "Content-Type" line in email and HTTP pages.
I really want to break the one Pattern into two for more rational processing:
What I would like is for the "x-token" in the first pattern refer to the xtokenPattern in the second line. But I can't make this happen. Is it possible? What do I need to do?
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16692
|
|
You can probably just replace the x-token in the first with the second regex in a group... However, if you do that, the greedy nature of the second regex will probably take the rest of the characters. You might also want to change the second regex to be relunctant.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4422
|
|
Thanks, but my first posting was not exactly what I wanted. I want to have different values for case-sensitive. And my real case is a lot more complex, I simplified it for posting.
|
 |
 |
|
|
subject: Nesting or subroutines in RegEx Pattern class
|
|
|