Find count of WordPress users by role and search string for user name

Adding this as an answer here for reference for anyone searching for WP_User_Query stuff:

As per the docs The search field on WP_User_Query uses * for wildcard text search, and will search on login, nicename, email and URL, unless specified otherwise.

E.g. to match any name containing bob you need:

$args = array(
    'search'         => '*bob*'
);

$user_query = new WP_User_Query( $args );