next up previous contents
Next: Matching words with <with Up: Using Metacharacters in Regular Previous: Repeating Characteer Sets with   Contents

Matching a Specific Number of Sets with \{ and \}

`*'¸¸À¸·Î´Â ÃÖ´ë Ƚ¼ö¸¦ ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. ¸î¸î ÇÁ·Î±×·¥µé¿¡¼± ´ÙÀ½°ú °°Àº Ƚ¼ö¸¦ ÁöÁ¤ÇÏ´Â Á¤±Ô½ÄÀ» ¾µ ¼ö ÀÖ½À´Ï´Ù. ÀÌ´Â µÎ °³ÀÇ ½ÖÀ¸·Î ÀÌ·ç¾îÁø Ư¼ö Ç¥ÇöÀ» »ç¿ëÇÕ´Ï´Ù: `\{'¿Í `\}'.

¿¹¸¦ µé¾î ¼Ò¹®ÀÚ 4 °³¿¡¼­ 8°³·Î ÀÌ·ç¾îÁø ¹®ÀÚ¿­Àº [a-z]\{4,8\}¿¡ ÇØ´çÇÕ´Ï´Ù. Ƚ¼ö¸¦ ÁöÁ¤ÇÒ ¶§ ¾²ÀÌ´Â ¼öÄ¡´Â 0¿¡¼­ 255 »çÀÌÀÇ ¼öÄ¡¸é µË´Ï´Ù. ¸¸¾à µÎ ¹ø° ¼öÄ¡°¡ »ý·«µÇ¸é *¿Í ºñ½ÁÇÏ°Ô »óÀ§ °æ°è¿¡ Àû¿ë¹ÞÁö ¾Ê½À´Ï´Ù. µû¶ó¼­ Ư¼ö ¹®ÀÚ *´Â \{0,\}¿Í °°Àº ¶æÀÔ´Ï´Ù.¿Í ¸¶Âù°¡Áö·Î ÀÌ´Â ¾Õ ÆÐÅÏÀÇ È½¼ö¸¦ ÁöÁ¤Çϱâ À§ÇØ ¾²ÀÔ´Ï´Ù. µû¶ó¼­ ÀÌ Ç¥ÇöÀÌ ¹®ÀåÀÇ Ã³À½¿¡ ³ª¿Â´Ù¸é modifierÀÇ ±â´ÉÀ» ÀÒ°í ÀÏ¹Ý ±ÛÀÚ·Î ¾²ÀÌ°Ô µË´Ï´Ù.

Figure 3: Regular Expression Pattern Repetition Examples
\begin{figure}
\begin{center}
\begin{tabular}{l\vert p{7cm}}
\textbf{Regular Exp...
...\texttt{A\{4,8\}}·Î ½ÃÀÛÇÏ´Â ÁÙ \\
\hline
\end{tabular}\end{center}\end{figure}




1999-12-14