diff --git a/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyProfileCardResponseDto.java b/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyProfileCardResponseDto.java index 874d1c73..a7dd717a 100644 --- a/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyProfileCardResponseDto.java +++ b/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyProfileCardResponseDto.java @@ -49,7 +49,11 @@ private static String extractInstagramAccount(String snsUrl) { if (snsUrl == null || snsUrl.isBlank()) { return ""; } - return snsUrl.replace("https://www.instagram.com/", "") - .replace("/", ""); + + return snsUrl + .replaceAll("https?://(www\\.)?instagram\\.com/", "") + .replaceAll("instagram\\.com", "") + .replaceAll("/", "") + .trim(); } }