StreamTokenizer splits up 001_to_003 into two tokens; how can I prevent it from doing so?
问题 Java's StreamTokenizer seems to be too greedy in identifying numbers. It is relatively light on configuration options, and I haven't found a way to make it do what I want. The following test passes, IMO showing a bug in the implementation; what I'd really like is for the second token to be identified as a word "20001_to_30000". Any ideas? public void testBrokenTokenizer() throws Exception { final String query = "foo_bah 20001_to_30000"; StreamTokenizer tok = new StreamTokenizer(new