在python中以随机顺序匹配两个字符串

Jac*_* S. 2 python regex

如果我有2个字符串,如:

a = "hello"
b = "olhel"
Run Code Online (Sandbox Code Playgroud)

我想使用正则表达式(或其他东西?)来查看两个字符串是否包含相同的字母.在我的例子中,a = b,因为它们具有相同的字母.怎么能实现这一目标?

Gle*_*ard 10

a = "hello"
b = "olhel"
print sorted(a) == sorted(b)
Run Code Online (Sandbox Code Playgroud)