commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Honton, Charles" <Charles_Hon...@intuit.com>
Subject Re: svn commit: r1589446 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/time/FastDateParser.java test/java/org/apache/commons/lang3/time/FastDateParserTest.java
Date Thu, 24 Apr 2014 15:58:57 GMT
TextStrategy is only for parsing finite set of string choices. Literal
text is handled by CopyQuotedStrategy.


On 4/23/14, 6:14 PM, "sebb" <sebbaz@gmail.com> wrote:

>On 23 April 2014 21:19, Honton, Charles <Charles_Honton@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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message