Skip to Content
러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
book

러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
358
러닝 자바스크립트
이 예제는 좀 지나치게 단순화한 겁니다. 다른 속성이
alt
속성보다 앞에 있거나,
alt
앞에 공
백이 두 개 이상이라면 이 정규식으로는 아무것도 찾지 못합니다. 나중에 이 예제를 다시 살펴
보면서 그 문제를 해결할 겁니다.
밴드 이름 예제와 마찬가지로, 첫 번째 그룹은 따옴표 뒤에
0
개 이상의 문자를 찾습니다(물음
표를 썼으므로 소극적으로 일치해서, 두 번째
<
img
>
까지 진행하는 일은 없습니다 ). 그다음에
있는
\1
는 앞에서 찾은 따옴표의 짝입니다.
적극적 일치와 소극적 일치에 대해 정확히 이해했는지 다시 한 번 확인해 봅시다. 바로 앞 예제
의 정규식에서
*
다음의 물음표를 지우고 적극적으로 일치하게 만드십시오. 표현식을 다시 실
행하십시오. 어떻게 되나요? 왜 그런지 이해할 수 있나요? 적극적 일치와 소극적 일치는 정규
식을 정확히 사용할 수 있는지 판가름하는 매우 중요한 개념입니다. 아직 잘 모르겠다면
17
.
3
절로 돌아가서 다시 읽어보시기 바랍니다.
17.15
그룹 교체
그룹을 사용하면 문자열 교체도 더 다양한 방법으로 할 수 있습니다. 이번에도
HTML
을 예로
들겠습니다.
<
a
>
태그에서
href
가 아닌 속성을 전부 제거하고 싶다고 합시다.
let
html
= '<
a
class
="
nope
"
href
= "/
yep
">
Yep
</ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

최용, 앤드루 호프먼

Publisher Resources

ISBN: 9788968483387