RegexExtractor

abstract class RegexExtractor[P, T](var fullRegex: String, var groupRegex: String)

A Regular expression step which takes a text and extracts meaningful values according to a regular expression:

  • either a user-defined expression for the full text to extract: e.g. "Given the following number: (.*)"
  • or a default regex for groups capturing value delimited with ${}

It provides methods to extract either all the groups as a list, or a number of values as a tuple

Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def extract1(t: String): String

extract the value contained in the first group

extract the value contained in the first group

def extract10(t: String): (String, String, String, String, String, String, String, String, String, String)
def extract2(t: String): (String, String)
def extract3(t: String): (String, String, String)
def extract4(t: String): (String, String, String, String)
def extract5(t: String): (String, String, String, String, String)
def extract6(t: String): (String, String, String, String, String, String)
def extract7(t: String): (String, String, String, String, String, String, String)
def extract8(t: String): (String, String, String, String, String, String, String, String)
def extract9(t: String): (String, String, String, String, String, String, String, String, String)
def extractAll(t: String): List[String]
def strip(text: String): String

remove value markers ${} from the text

remove value markers ${} from the text

def withRegex(full: String, group: String): RegexExtractor[P, T]

change the regexps

change the regexps