MySQL regexp_replace() function is used for pattern matching. It replaces the given string character by matching the characters.
select regexp_replace('str', 'character', 'new_character');Select regexp_replace('BCA', 'B', 'M');Output:
 
Select regexp_replace('Java', 'Java', 'Mysql');Output:
 
