Warning: Some posts on this platform may contain adult material intended for mature audiences only. Viewer discretion is advised. By clicking ‘Continue’, you confirm that you are 18 years or older and consent to viewing explicit content.
Yes, but you can really only do that with single characters, since your first example is an ordered group and the second is an unordered set in a capturing group. The equivalency drops off when you include more characters.
Plus, you can do things like [a-zA-Z], and you can’t do that with the former example.
I would imagine there’s a difference in computing overhead, too, but I have no idea which is more performant.
Yes, but you can really only do that with single characters, since your first example is an ordered group and the second is an unordered set in a capturing group. The equivalency drops off when you include more characters.
Plus, you can do things like
[a-zA-Z]
, and you can’t do that with the former example.I would imagine there’s a difference in computing overhead, too, but I have no idea which is more performant.