On Wed, Jan 12, 2011 at 3:46 PM, Charith Wickramarachchi <
charith.dhanus...@gmail.com> wrote:

> See comments in line.
>
> On Wed, Jan 12, 2011 at 2:17 PM, indika kumara <indika.k...@gmail.com>wrote:
>
>> +1 , Although I have not tested, I believed that the regular expression
>> itself can express what charith needed (though you may need code changes
>> because of Java API).
>>
>
> Can you show a solid example of what you say?
>

I just believed and had not tested.  I can find from Google that  'a(?:)bc'
match for 'aBc' . So, implicitly, the compiler should be 'case-sensitive'.
This may be for other cases.

If it is a limitation is Regex, then you solution may be OK. (I have not
checked)


>  AFAIK its a limitation is Regex.
>
> http://www.wellho.net/mouth/943_Matching-within-multiline-strings-and-ignoring-case-in-regular-expressions.html
>
> From my point of view, trying to expose the JAVA API in the synapse API is
>> not good. The synapse API is high level than Java and targets for high level
>> users.
>
>
> Yes . i know that  having too many attributes is confusing
> But what i do not see is whats wrong with having the attribute 'flag' in
> this context .
>
> Its readable and does make sence for people who use it. (*DOTALL mode ,
> MUTILINE , etc mode are quite standered modes in some languages *)
>
>
> <filter source="." regex=".*connection.*" flag="DOTALL , CASE_INSENSITIVE"
>
>
>
>
>
>
>
>>
>>
>> Problem -> Solution -> programing model -> synapse API -> implementation's
>> language API  .... on in other direction.
>>
>> Thanks,
>>
>> Indika
>>
>>
>>
>> On Wed, Jan 12, 2011 at 2:37 PM, Hiranya Jayathilaka <
>> hiranya...@gmail.com> wrote:
>>
>>> Yeah I also don't like adding a new XML attribute for this. Also the
>>> syntax ('|' as a separator) is not very XML friendly.
>>>
>>>
> Agreed here we can use comma (',') to separate
>
> But i don't see any usability issue with this new attribute
>
> <filter source="." regex=".*connection.*" flag="DOTALL , CASE_INSENSITIVE"
>
> I also don't think case sensitivity needs to be a flag. Such constraints
>>> can be specified in the regex itself AFAIK.
>>>
>>>
> AFAIK it can't can you send a pointer for this ? Example : say i want to
> match the regex  .*Hello.* in case insensitive way. So in that case how
> filter mediator specify it ? In regular expression ? ( thease flags are wel
> kown ones when it comes to regex compilers :))
>
>
>
> Ok there we can use a regex with all case combination of world  "Hello"
> sperated with a pipe but thats a pain :)
>
> thanks,
> Charith
>
>
>
>> Thanks,
>>> Hiranya
>>>
>>>
>>> On Wed, Jan 12, 2011 at 1:46 PM, indika kumara <indika.k...@gmail.com>wrote:
>>>
>>>> Hi Charith,
>>>>
>>>> Is it a limitation in Java or regular expression? We usually try to
>>>> reduce the number of attributes( from the language's perspective).
>>>>
>>>> Thanks,
>>>>
>>>> Indika
>>>>
>>>>
>>>> On Wed, Jan 12, 2011 at 1:33 PM, Charith Wickramarachchi <
>>>> charith.dhanus...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> 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/
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Hiranya Jayathilaka
>>> Senior Software Engineer;
>>> WSO2 Inc.;  http://wso2.org
>>> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
>>> Blog: http://techfeast-hiranya.blogspot.com
>>>
>>
>>
>
>
> --
> Charith Dhanushka Wickramarachchi
> http://charithwiki.blogspot.com/
>
>

Reply via email to