reg ex group and sub group
Is it possible to use regex to capture a whole phrase as well as each word in the phrase concatenated?
So for :
smith jones
To return:
smith,jones,smithjones
furtherm开发者_JAVA技巧ore due to other constraints (solr PatternTokenizer) i can only use one grouping.
It doesn't look like you'll be able to do this without some extra work. With PatternTokenizerFactory, you are limited to the 'matching' part of regex so you can't do replacements.
Why not create your own tokenizer that uses the token stream created by PatternTokenizer and then builds a concatenated string which it returns at the end?
精彩评论