machinepack-strings
Version:
Work with strings.
100 lines (97 loc) • 1.93 kB
JSON
{
"machine": "match-global",
"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": []
},
{
"found": "three",
"at": 18,
"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": "Hello world",
"regexp": "l(\\w)"
},
"outcome": "success",
"returns": [
{
"found": "ll",
"at": 2,
"subgroups": ["l"]
},
{
"found": "ld",
"at": 9,
"subgroups": ["d"]
}
]
},
{
"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"]
},
{
"found": "Me",
"at": 13,
"subgroups": ["M"]
}
]
}
]
}