Removing the /i doesn't do anything unfortunately - I read the
handbook page too and thought it should work.

They use this to check for any string using alphanumeric characters +
dashes + underscores;

[0-9a-zA-Z_-]

So I would have though that using [a-zA-Z] would work for just upper
and lowercase letters.

Just so I'm not doing anything stupid, everytime I update the
validation in the model and upload it, I then delete what ever files
are in the /app/tmp/cache/models directory - is there anything else I
need to do.

Felix.

On 13 July 2010 19:37, McBuck DGAF <[email protected]> wrote:
> I thought the "i" at the end of the rule I suggested would make it
> case insensitive, as described in the manual. (Like I said, regex is
> not my thing, I am still learning there . . .)  Anyway, try removing
> the "i" from the end of the last rule you suggested (ie, '/^[a-zA-Z]
> $/') and see if that works.
>
> On Jul 13, 1:36 pm, Felix <[email protected]> wrote:
>> OK, that validation rule works, kinda.
>>
>> If I remove the validation for the company name (temporarily) the rest
>> of the form validation works, with one exception.
>>
>> The new regex doesn't allow for upper case letters, only lower case.
>>
>> I tried changing it from; '/^[a-z]$/i'
>>
>> to: '/^[a-z][A-Z]$/i' --didn't work
>>
>> to: '/^[a-zA-Z]$/i' --didn't work
>>
>> I think there's something basic I'm missing here!
>>
>> As for the company name that still gives the same errors as before.
>>
>> Thanks for your help thus far, Felix.
>>
>> On Jul 13, 3:13 pm, McBuck DGAF <[email protected]> wrote:
>>
>> > Sorry, I wasn't looking at the regex itself, I was just looking at the
>> > way you implemented it (and we have not addressed your 'company_name'
>> > issue at all, but the solution here should be readily adaptable to
>> > that).
>>
>> > I am no regex expert, but wouldn't the following get you what you
>> > want?:
>>
>> > 'rule' => '/^[a-z]$/i',
>>
>> >  (the regex must be delimited by "/", which is probably the source of
>> > your current error)
>>
>> > On Jul 12, 7:18 pm, Felix <[email protected]> wrote:
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to