다음 정규 표현식은 "Gray"와 "James"를 일치로 반환합니다. 나는 왜 "Name"이 일치하지 않는지 이해하지 못합니다. 설명 할 수 있니?Reg 표현식 : "name"이 일치 항목으로 반환되지 않는 이유
"Name: Gray, James"[/(\w+), (\w+)/]
다음 정규 표현식은 "Gray"와 "James"를 일치로 반환합니다. 나는 왜 "Name"이 일치하지 않는지 이해하지 못합니다. 설명 할 수 있니?Reg 표현식 : "name"이 일치 항목으로 반환되지 않는 이유
"Name: Gray, James"[/(\w+), (\w+)/]
여기에 쉼표를 따르지 않는, 당신의 정규식
Match the regular expression below and capture its match into backreference number 1 «(\w+)»
Match a single character that is a “word character” (letters, digits, and underscores) «\w+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
Match the characters “, ” literally «, »
Match the regular expression below and capture its match into backreference number 2 «(\w+)»
Match a single character that is a “word character” (letters, digits, and underscores) «\w+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
회색
을 어떻게 작동하는지,Name
(\ + w) (+ w \) 제임스
에 대한 설명입니다.
감사합니다. 그 설명은 어디서 났습니까? 그것은 그것이 프로그램에 의해 생성 된 것 같습니다. – BrainLikeADullPencil
경기 쉼표 옆에있는 단어 공백 "(\ + w),"
경기 쉼표와 공백 후 단어 "(+ w \),"
정규 표현식이 두 단어를 일치하기 때문에 쉼표와 공백으로 구분하여 –