multiregexp
multiregexp copied to clipboard
regexp can not match
regexp: (.)的(?:联系方式|电话|电话号码|手机号) string: david的联系方式 result: can not match code: List<String> strRegList = new ArrayList<String>(5); strRegList.add("(.)的(?:联系方式|电话|电话号码|手机号)");
int [] subList = MultiPattern.of(strRegList).matcher().match("david的联系方式");
dkbrics does not handle capturing groups.
can you try (.)的(联系方式|电话|电话号码|手机号)
get it. by the way, What is the algorithm's time complexity.
Building the automaton can be exponential in time and memory with the number of pattern you have. Running it is linear with your input and independent from the number of patterns you have.
@fulmicoton I have the same issue, not sure what's wrong:
Java.util.pattern find indexes using:
Pattern versionPattern = Pattern.compile("\"version\":\\s*(\\d+)(\\.\\d)?");
But using the same pattern as above - do not work using this library, Any idea? example string i'm searching at:
{
"version": 2,
"name": "stile",
"id": "test",
"types": [
"testty"
]
}