On Wed, Jan 12, 2011 at 12:47 PM, indika kumara <indika.k...@gmail.com>wrote:

> +1 for the idea. BTW, Is there any way to do this without introducing a new
> attribute? i.e only using the regex.
>
>
Hi Indika,

We need to have the flags at the time we compile the regex

ex :
Pattern pattern = Pattern.compile(patternStr, Pattern.MULTILINE |
Pattern.CASE_INSENSITIVE);

So we need to configure the flags some how. Alternative is  having them in
the properties file but IMO that will reduce the flexibility.
I dont think having a new attribute is a problem since this change is
backward compatible (its a optional attribute)

thanks,
Charith




Thanks,
>
> Indika
>
>
> On Wed, Jan 12, 2011 at 12:26 PM, Charith Wickramarachchi <
> charith.dhanus...@gmail.com> wrote:
>
>> Hi ,
>>
>> If we look at the current Synapse filter mediator it does not support
>> regex based filtering for multi-line Strings.
>> IMO having that feature is useful  since there are scenarios where we need
>> to do reg-ex filtering in multi-line Strings in message.
>>
>> So as a solution to that i thought of introducing  flag support to the
>> Filter mediator with the regex matching. So users can optionally configure
>> flags like
>> MULTILINE , DOTALL , CASE_INSENSITIVE with the filter mediator.
>>
>> And also they will be able to use the combination of flags
>>
>> ex :
>> DOTALL | CASE_INSENSITIVE
>>
>> after introducing this example filter mediator will look like this
>>
>> <filter source="." regex=".*connection.*" flag="DOTALL | CASE_INSENSITIVE"
>> xmlns:m="http://www.webserviceX.NET/";>
>>
>> you can find more information in [1]
>>
>> I'm going of introduce following flags which i think is useful.
>>
>>    - MULTILINE
>>    - DOTALL
>>    - UNIX_LINES
>>    - CASE_INSENSITIVE
>>
>> If devs are ok i'll go head and add this feature to trunk.
>>
>> [1] http://www.javamex.com/tutorials/regular_expressions/multiline.shtml
>>
>> thanks,
>> Charith
>>
>>
>>
>> --
>> Charith Dhanushka Wickramarachchi
>> http://charithwiki.blogspot.com/
>>
>>
>


-- 
Charith Dhanushka Wickramarachchi
http://charithwiki.blogspot.com/

Reply via email to