import java.util.Arrays;
class Main
{
{
String string
= "hello^world'this*has two tokens'#2ndToken"; System.
out.
println(Arrays.
toString(string.
split("(?=(([^']+'){2})*[^']*$)[^a-zA-Z\\d]+"))); }
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJICAgU3RyaW5nIHN0cmluZyA9ICJoZWxsb153b3JsZCd0aGlzKmhhcyB0d28gdG9rZW5zJyMybmRUb2tlbiI7CiAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKEFycmF5cy50b1N0cmluZyhzdHJpbmcuc3BsaXQoIig/PSgoW14nXSsnKXsyfSkqW14nXSokKVteYS16QS1aXFxkXSsiKSkpOwoJfQp9