Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

정규식 치환

항목값
화면 이름Regex replace
식별자regexReplaceV1
지원 실행 방식Batch, Faster, Streaming
범주정규식 (Regex), 문자열 (String)
반환 자료형String

정규식 패턴을 사용해 문자열을 치환합니다.

입력 인자

이름지정 여부자료형의미와 조건
Expression필수Expression<String>치환할 입력 문자열입니다.
Pattern필수Expression<String>일치시킬 정규식 패턴입니다.
Replace필수Expression<String>치환 문자열입니다.

입출력 예시

예시 1: 기본 동작

인자 값:

  • Expression: tail_number
  • Pattern: (\w\w)(-)
  • Replace: **-
tail_number출력
MT-123**-123
XB-434**-434
MT-123, XB-434**-123, **-434

예시 2: 기본 동작

인자 값:

  • Expression: tail_number
  • Pattern: \
  • Replace: \\
tail_number출력
this is a backslash \ etcthis is a backslash \ etc

예시 3: 기본 동작

인자 값:

  • Expression: path
  • Pattern: \
  • Replace: /
path출력
path\to\filepath/to/file
C:\Users\JohnC:/Users/John

예시 4: 기본 동작

인자 값:

  • Expression: price
  • Pattern: $
  • Replace: USD
price출력
Price is $50Price is USD 50
$100 and $200USD 100 and USD 200

예시 5: 기본 동작

인자 값:

  • Expression: price
  • Pattern: $(\d+)
  • Replace: $1 dollars
price출력
I have $100I have 100 dollars
$50 and $7550 dollars and 75 dollars

예시 6: 기본 동작

인자 값:

  • Expression: tail_number
  • Pattern: (\w\w)(-)
  • Replace: \
tail_number출력
MT-123\123
XB-434\434
MT-123, XB-434\123, \434

예시 7: 기본 동작

인자 값:

  • Expression: text
  • Pattern: foo
  • Replace: \$
text출력
foo$
foo bar foo$ bar $

예시 8: 기본 동작

인자 값:

  • Expression: tail_number
  • Pattern: (\w\w)(-)
  • Replace: $
tail_number출력
MT-123$123
XB-434$434
MT-123, XB-434$123, $434

예시 9: 기본 동작

인자 값:

  • Expression: tail_number
  • Pattern: (\w\w)(-)
  • Replace: $1
tail_number출력
MT-123MT123
XB-434XB434
MT-123, XB-434MT123, XB434

예시 10: null 처리

인자 값:

  • Expression: tail_number
  • Pattern: regex
  • Replace: foo
tail_numberregex출력
MT-123(null

예시 11: null 처리

null 입력은 null 결과를 만듭니다.

인자 값:

  • Expression: null
  • Pattern: (\w\w)(-)
  • Replace: **

출력: null

예시 12: null 처리

null 입력은 null 결과를 만듭니다.

인자 값:

  • Expression: foo
  • Pattern: bar
  • Replace: null

출력: null