On 24 April 2014 16:58, Honton, Charles <charles_hon...@intuit.com> wrote: > TextStrategy is only for parsing finite set of string choices. Literal > text is handled by CopyQuotedStrategy. >
I see. In which case I suggest renaming it to reflect its new case-blind behaviour. Also remove keyValues - it wastes space. > > On 4/23/14, 6:14 PM, "sebb" <seb...@gmail.com> wrote: > >>On 23 April 2014 21:19, Honton, Charles <charles_hon...@intuit.com> wrote: >>> TextStrategy is used for: >>> E - DAY_OF_WEEK >>> G - ERA >>> M - MONTH >>> a - AM_PM >> >>Is that the only possible use of TextStrategy? >>What about literal text? >> >>> SimpleDateFormat uses case-insensitive parsing for each of these fields. >>> I will add tests for each of those fields in multiple Locales. >> >>Thanks. >> >>> The (?u)(?i) modifier is active just for the duration of the group. >> >>I did not know that. >>Eventually found it documented but hidden away in the section on >>differences from Perl. >> >>Note: could be written as (?iu) >> >>> Consider the following unit test: >>> >>> @Test >>> public void testCaseSensitiveModifier() throws Exception { >>> Pattern aabb = Pattern.compile("((?u)(?i)AA)BB"); >>> assertTrue(aabb.matcher("aaBB").matches()); >>> assertTrue(aabb.matcher("AABB").matches()); >>> assertFalse(aabb.matcher("aabb").matches()); >>> assertFalse(aabb.matcher("AAbb").matches()); >>> } >>> >>> Regards, >>> chas > . . . >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org