dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04339
Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 1426: Final regex adjustment allows for numerals following first letter. These are all ok:
Certainly more concise. I like using \w - should have done that.
Though I'm not so sure about using the case_insensitive (slight pun
intended) flag.
I'd rather the regex is selfcontained. Maybe an inline quantifier like
"^(?i)[a-z]\w{0,9}$"
is better. Though this no longer matches in my emacs regexp builder.
I think I could live with
"^[a-zA-Z]\w{0,9}$"
and this is very portable.
On 13 February 2010 06:27, Jason Pickering <jason.p.pickering@xxxxxxxxx> wrote:
> I might suggest the somewhat more readable line
>
> Pattern conceptNamePattern = Pattern.compile("^[a-z]\w{0,9}$",
> Pattern.CASE_INSENSITIVE);
>
>
> Regards,
> Jason
>
>
>
> On 2/12/10, noreply@xxxxxxxxxxxxx <noreply@xxxxxxxxxxxxx> wrote:
>> ------------------------------------------------------------
>> revno: 1426
>> committer: Bob Jolliffe <bobj@bobj-laptop>
>> branch nick: trunk
>> timestamp: Fri 2010-02-12 13:52:57 +0000
>> message:
>> Final regex adjustment allows for numerals following first letter. These
>> are all ok:
>> AGE, age, AGE_hiv, AGE6 , B____
>> These are not:
>> _AGE, AGE#, THE_AGE_OF_MY_GRANDMOTHER, 8age
>> modified:
>>
>> dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/ValidateDataElementCategoryAction.java
>>
>>
>> --
>> lp:dhis2
>> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
>>
>> Your team DHIS 2 developers is subscribed to branch lp:dhis2.
>> To unsubscribe from this branch go to
>> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
>>
>
Follow ups
References