machinepack-strings
Version:
Work with strings.
127 lines (125 loc) • 2.67 kB
JSON
{
"machine": "match",
"expectations": [
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "("
},
"outcome": "error"
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "abc"
},
"outcome": "notFound"
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "three"
},
"outcome": "success",
"returns": {
"found": "Three",
"at": 0,
"subgroups": []
}
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "three",
"caseInsensitive": false
},
"outcome": "success",
"returns": {
"found": "three",
"at": 18,
"subgroups": []
}
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "three",
"caseInsensitive": true
},
"outcome": "success",
"returns": {
"found": "Three",
"at": 0,
"subgroups": []
}
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?yeah",
"regexp": "run\\?yeah"
},
"outcome": "success",
"returns": {
"found": "run?yeah",
"at": 50,
"subgroups": []
}
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "mi.e\\."
},
"outcome": "success",
"returns": {
"found": "mice.",
"at": 30,
"subgroups": []
}
},
{
"using": {
"string": "Three blind mice, three blind mice. See how they run?",
"regexp": "mi.e"
},
"outcome": "success",
"returns": {
"found": "mice",
"at": 12,
"subgroups": []
}
},
{
"using": {
"string": "Hello world",
"regexp": "w(\\w+)(l)d"
},
"outcome": "success",
"returns": {
"found": "world",
"at": 6,
"subgroups": ["or","l"]
}
},
{
"using": {
"string": "You\nComplete\nMe",
"regexp": "^(C|M)\\w"
},
"outcome": "notFound"
},
{
"using": {
"string": "You\nComplete\nMe",
"regexp": "^(C|M)\\w",
"multiline": true
},
"outcome": "success",
"returns": {
"found": "Co",
"at": 4,
"subgroups": ["C"]
}
}
]
}