-
06. ์์น ์ฐพ๊ธฐ๐ง codingtest/์ ๊ทํํ์(regexp) 2022. 9. 3. 19:15728x90
- ์์น ์ฐพ๊ธฐ๋ ํ ์คํธ ๋ฌธ์์ด ์์์ ๋ฐ๋์ ์ผ์นํด์ผํ๋ ์์น๋ฅผ ์ง์ ํ ๋ ์ฌ์ฉ
๋จ์ด ๊ฒฝ๊ณ ์ง์ ํ๊ธฐ
\b ๋ก ํ์ํ๋ ๋จ์ด๊ฒฝ๊ณ -> ๋จ์ด์ ์์์ด๋ ๋ง์ง๋ง์ ์ผ์น ์ํฌ๋ ์ฌ์ฉ \B ๋ก ํ์ํ๋ ๋จ์ด๊ฒฝ๊ณ -> ๋จ์ด์ ์์์ด๋ ๋ง์ง๋ง์ ์ผ์น ์ํค์ง ์ถ์ง ์์๋ ์ฌ์ฉ
์์๋น๊ต
- ์์ the cat scattered his food all over room, -> cat ์ dog๋ก ์นํ
๋์ ์ ์นํ๊ฒฐ๊ณผ cat
the dog sdogtered his food all over room, \bcat\b
the dog scattered his food all over room, ๐
\b
๋ ์ค์ ๋ก ๋ฌธ์์ ์ผ์นํ๋ ๊ฒ์ด ์๋ ์์น๋ฅผ ๊ฐ๋ฆฌํด์์๋น๊ต
- ์์ Please enter the nine-digit id as it appears on your color - coded pass-key
๋์ ์ ๋งค์นญ๊ฒฐ๊ณผ \B-\B
Please enter the nine-digit id as it appears on your color - coded pass-key ๐
\B-\B
๋ ๋จ์ด๊ตฌ๋ถ(word-break)๋ฌธ์๋ก ๋๋ฌ์ธ์ธ ํ์ดํ๊ณผ ์ผ์นํจ๋ฌธ์์ด ๊ฒฝ๊ณ ์ง์ ํ๊ธฐ
๋จ์ด ๊ฒฝ๊ณ๋ ๋จ์ด์ ์์น(๋จ์ด์ ์์, ๋จ์ด์ ๋ง์ง๋ง, ๋จ์ด ์ ์ณฌ)๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์์น๋ฅผ ์ฐพ์ - ์บ๋ฟ(^) : ๋ฌธ์์ด์ ์์์ ๋ํ๋(๐ ์งํฉ([]) ๋ฐ์์) - ๋ฌ๋ฌ๊ธฐํธ($) : ๋ฌธ์์ด์ ๋ง์ง๋ง์ ๋ํ๋ - ๋ค์คํ ๋ชจ๋(?m) : ์บ๋ฟ(^)๊ณผ ๋ฌ๋ฌ๊ธฐํธ($) ๋ก ํ์ํ ๊ฒฝ๊ณ๋ฌธ์์ ๋ค์คํ์ ์ง์ํจ(๐ (?m)์ ์ง์ํ์ง ์๋ ์ ๊ทํํ์ ๊ตฌํ๋ ๋ง์)
'๐ง codingtest > ์ ๊ทํํ์(regexp)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
08. ์ญ์ฐธ์กฐ ์ฌ์ฉํ๊ธฐ (0) 2022.09.03 07. ํ์ ํํ์ ์ฌ์ฉํ๊ธฐ (0) 2022.09.03 05. ๋ฐ๋ณต ์ฐพ๊ธฐ (0) 2022.09.03 04. ๋ฉํ ๋ฌธ์ ์ฌ์ฉํ๊ธฐ! (0) 2022.09.03 03. ๋ฌธ์ ์งํฉ์ผ๋ก ์ฐพ๊ธฐ! (0) 2022.09.03