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?

Was it helpful?

Solution

Maybe try someting like:

[BCMVZ]+

it find any tags combinations with this chars BCMVZ.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top