You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "O. Klein" <kl...@octoweb.nl> on 2012/02/16 14:33:31 UTC

PatternReplaceFilterFactory group

PatternReplaceFilterFactory has no option to select the group to replace.

Is there a reason for this, or could this be a nice feature? 

--
View this message in context: http://lucene.472066.n3.nabble.com/PatternReplaceFilterFactory-group-tp3750201p3750201.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: PatternReplaceFilterFactory group

Posted by "O. Klein" <kl...@octoweb.nl>.
steve_rowe wrote
> 
> Hi O.,
> 
> PatternReplaceFilter(Factory) uses Matcher.replaceAll() or replaceFirst(),
> both of which take in a string that can include any or all groups using
> the syntax "$n", where n is the group number.  See the
> Matcher.appendReplacement() javadocs for an explanation of the
> functionality and syntax:
> &lt;http://docs.oracle.com/javase/6/docs/api/java/util/regex/Matcher.html#appendReplacement%28java.lang.StringBuffer,%20java.lang.String%29&gt;
> 
> Steve
> 
>> -----Original Message-----
>> From: O. Klein [mailto:klein@]
>> Sent: Thursday, February 16, 2012 8:34 AM
>> To: solr-user@.apache
>> Subject: PatternReplaceFilterFactory group
>> 
>> PatternReplaceFilterFactory has no option to select the group to replace.
>> 
>> Is there a reason for this, or could this be a nice feature?
>> 
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/PatternReplaceFilterFactory-group-
>> tp3750201p3750201.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 

Thanks. I should get it working then.

--
View this message in context: http://lucene.472066.n3.nabble.com/PatternReplaceFilterFactory-group-tp3750201p3750650.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: PatternReplaceFilterFactory group

Posted by Steven A Rowe <sa...@syr.edu>.
Hi O.,

PatternReplaceFilter(Factory) uses Matcher.replaceAll() or replaceFirst(), both of which take in a string that can include any or all groups using the syntax "$n", where n is the group number.  See the Matcher.appendReplacement() javadocs for an explanation of the functionality and syntax: <http://docs.oracle.com/javase/6/docs/api/java/util/regex/Matcher.html#appendReplacement%28java.lang.StringBuffer,%20java.lang.String%29>

Steve

> -----Original Message-----
> From: O. Klein [mailto:klein@octoweb.nl]
> Sent: Thursday, February 16, 2012 8:34 AM
> To: solr-user@lucene.apache.org
> Subject: PatternReplaceFilterFactory group
> 
> PatternReplaceFilterFactory has no option to select the group to replace.
> 
> Is there a reason for this, or could this be a nice feature?
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/PatternReplaceFilterFactory-group-
> tp3750201p3750201.html
> Sent from the Solr - User mailing list archive at Nabble.com.