Project

General

Profile

Actions

Bug #367

closed

Regex for "validates_format_of" in Parameter model does not look right

Added by Bash Shell over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I have a parameter value with the value:

test       value

However, I got a validation error because the following validation does not accept a variety of characters.

validates_format_of   :name, :value, :with => /\A(\S+\s?)+\Z/, :message => "can't be blank or contain trailing white space" 

It would be useful to have a more liberal validation like so:

validates_format_of   :name, :value, :with => /^[\w\d\W]+$/, :message => "can't be blank or contain trailing white space" 

So that the following lines can be accommodated:

*       -       nofile  65535%%*       -       nproc  65535

for /etc/security/limits.conf, for example.

Actions

Also available in: Atom PDF