문제

I have this example:

String str = "HellMCo I fiCZMnd thBVMis site intZereVCsting";
String tags = "BCMVZ";

I need a regular expression that helps me to find every combination of tags. As you can see in str we find four variations. I don't know too much about regular expressions.

I'm starting to test with this pattern:

(\d{,1}[BCMVZ])

PD: I'm testing here http://regexpal.com/ but it doesn't work my pattern.

So my real question is, how can I detect any variation of any character from another string?

도움이 되었습니까?

해결책

Maybe try someting like:

[BCMVZ]+

it find any tags combinations with this chars BCMVZ.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top