Sorry for a mistake. 'on in other direction' should be 'not in the opposite direction'.
On Wed, Jan 12, 2011 at 2:47 PM, indika kumara <[email protected]>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). > > 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. > > 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 <[email protected] > > 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. >> >> I also don't think case sensitivity needs to be a flag. Such constraints >> can be specified in the regex itself AFAIK. >> >> Thanks, >> Hiranya >> >> >> On Wed, Jan 12, 2011 at 1:46 PM, indika kumara <[email protected]>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 < >>> [email protected]> wrote: >>> >>>> >>>> >>>> On Wed, Jan 12, 2011 at 12:47 PM, indika kumara >>>> <[email protected]>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 < >>>>> [email protected]> 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: [email protected]; Mobile: +94 77 633 3491 >> Blog: http://techfeast-hiranya.blogspot.com >> > >
