We often use Regex
to simplify string expressions or to extract parts of
them. For example, taking only the namespace part from the fullname of a class
or taking only the domain name from the url.
With this method, we can take the same regex operations in different methods to a single place and manage them from there.
See Learn Regex for an example.