No description, website, or topics provided.
Scala
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src add zeroOrMore helper Jun 4, 2014
.gitignore update gitignore Jun 3, 2014
.travis.yml Update versions of Scala, libraries & plugins Jan 2, 2016
README.md sbt code in README.md fixed Feb 5, 2016
build.sbt Update versions of Scala, libraries & plugins Jan 2, 2016

README.md

Build Status Coverage Status

ScalaVerbalExpressions

import com.github.verbalexpressions.VerbalExpression
import VerbalExpression._

val validUrl = $.startOfLine()
                .andThen("http")
                .maybe("s")
                .andThen("://")
                .maybe("www.")
                .anythingBut(" ")
                .endOfLine()

assert("https://www.google.com" is validUrl)
assert("ftp://home.comcast.net" isNot validUrl)

// VerbalExpressions can be nested within each other
val fraction = $.andThen(".").digits()
val number = $.maybe("-").digits().maybe(fraction)

assert(Seq("3", "-4", "-0.458") forall number.check)
assert(Seq("0.", "hello", "4.3.2") forall number.notMatch)

For more methods, checkout the wiki and the source

sbt

Add the following to your build.sbt:

resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/"

libraryDependency += "com.github.verbalexpressions" %% "scalaverbalexpression" % "1.0.1"