(refs #163)Remove escaping for '.'

This commit is contained in:
takezoe
2013-10-21 10:53:36 +09:00
parent bbcb04b263
commit 2316a80be9
2 changed files with 2 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ trait Validations {
*/ */
def identifier: Constraint = new Constraint(){ def identifier: Constraint = new Constraint(){
override def validate(name: String, value: String): Option[String] = override def validate(name: String, value: String): Option[String] =
if(!value.matches("^[a-zA-Z0-9\\-_\\.]+$")){ if(!value.matches("^[a-zA-Z0-9\\-_.]+$")){
Some(s"${name} contains invalid character.") Some(s"${name} contains invalid character.")
} else if(value.startsWith("_") || value.startsWith("-")){ } else if(value.startsWith("_") || value.startsWith("-")){
Some(s"${name} starts with invalid character.") Some(s"${name} starts with invalid character.")

View File

@@ -2,8 +2,7 @@ package util
import org.specs2.mutable._ import org.specs2.mutable._
class class ValidationsSpec extends Specification with Validations {
ValidationsSpec extends Specification with Validations {
"identifier" should { "identifier" should {
"validate id string " in { "validate id string " in {