티스토리 뷰

 

(?:...) 캡쳐를 하지 않는다.

 

 var st = "bug bug's and bug bugs";

 st.match(/bug(?='s)/g);

["bug"]

 

(?=...) 일치하는 문자의 캡처를 제외한다.

 

 

(?!...)  캡체를 제외한 모든 문자를 찿는다.

 

bug bug's and bug bugs .match(/ bug(?!'s) /g );

 

["bug","bug","bug"]

 

 

 

[^...]  /[^c-u]/ c - u 사이를 제외한 다른 문자열 선택

 

abcdefghijklmnopqrstuvwxyz 0123456789

 

 

Stop, don't go that way! If you do, and you shouldn't btw, you might die. Hey, thats life.match( /\b\w+(?=,)\b/g );

 

["Stop","do","btw","Hey"]

Stop, don't go that way! If you do, and you shouldn't btw, you might die. Hey, thats life.

 

 

Stop, don't go that way! If you do, and you shouldn't btw, you might die. Hey, thats life.match( /\b\w+(?!,)\b/g );

Stop, don't go that way! If you do, and you shouldn't btw, you might die. Hey, thats life.

 

 

 

apples to apples.match( / (apples) to \1  /g );

 

apples to apples

 

 

 

댓글
D-DAY
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함