목록표현식 (1)
Allen's 데이터 맛집
[1] 특정 패턴의 단어 추출 활용
특정 패턴 추출 정규식을 사용하면 특정 패턴의 단어를 추출할 수 있습니다. 이번에는 숫자가 포함된 단어를 추출하는 방법을 알아보겠습니다.import java.util.regex.*;import java.util.ArrayList;public class PatternWordExtraction { public static void main(String[] args) { String text = "Order123, product456, and item789 are in the list."; Pattern pattern = Pattern.compile("\\b\\w*\\d+\\w*\\b"); Matcher matcher = pattern.matcher(text); ..
Mini Project/간단한 자연어 데이터 처리
2024. 7. 31. 15:18