0
regex.Match가 빈 문자열을 반환하는 이유는 무엇입니까?
정규 표현식과 일치하지만 match.Value 또는 그룹과 항상 일치하는 문자열 부분을 얻고 싶습니다. 나를 미치게하고있어. 편집 :
이 근무 :
당신의 정규식 ^로 시작하여 $로 끝나는 경우가 전체 문자열과 일치하려고Private Function NormalizeValue(ByVal fieldValue As String) As String
Dim result As String = ""
Dim pattern As String = "[a-zA-Zñ'-]*"
Dim matches As Match
matches = Regex.Match(fieldValue, pattern)
While (matches.Success = True)
result = result & matches.Value
matches = matches.NextMatch()
End While
Return result
End Function
코드의 스크린 샷 = 멋진 것은 아닙니다. 텍스트로 붙여 넣고 코드 포맷터를 사용하십시오. –