Question

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?

Était-ce utile?

La solution

Maybe try someting like:

[BCMVZ]+

it find any tags combinations with this chars BCMVZ.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top