KTUGFaq

KTUG FAQ

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
Good news from afar can bring you a welcome visitor.
FrontPage › RegularExpression
Á¤±ÔÇ¥Çö½Ä¿¡ °üÇÏ¿© ¼³¸íÇÕ´Ï´Ù.

¸ñÂ÷

1 Á¤±ÔÇ¥Çö½ÄÀ̶õ
1.1 Á¤±ÔÇ¥Çö½ÄÀÇ »ç¿ë
2 °ü·Ã ¼­Àû
3 °ü·Ã ¸µÅ©
4 Tips
5 Utility

1 Á¤±ÔÇ¥Çö½ÄÀ̶õ

  • Command ¶óÀλ󿡼­ È®ÀåÀÚ¿¡ »ó°ü¾øÀÌ abc ·Î ½ÃÀÛÇÏ´Â ÆÄÀÏÀ̸§À» ¾Ë°í ½ÍÀ»¶§ dir abc.* ¿Í °°Àº ½ÄÀ¸·Î Ç¥ÇöÀ» ÇÕ´Ï´Ù. ¿©±â¿¡¼­ * Ç¥ÇöÀÌ everythingÀ» Ç¥ÇöÇÏ´Â Á¤±ÔÇ¥Çö½ÄÀÇ ÀÏÁ¾ÀÔ´Ï´Ù.
    • ^´Â ¹®ÀÚ¿­ÀÇ Ã³À½, $´Â ¹®ÀÚ¿­ÀÇ ¸¶Áö¸·, + ´Â ÇϳªÀÌ»óÀÇ ¹®ÀÚ, * ´Â 0 °³ÀÌ»óÀÇ ¹®ÀÚ ÀǹÌÀÔ´Ï´Ù. ÀÌ¿Ü¿¡µµ »ó´çÈ÷ ¸¹½À´Ï´Ù.
    • Á¤±ÔÇ¥Çö½ÄÀº ¹®ÀÚ¿­ÀÌ ÆÐÅÏ¿¡ ¸ÅĪµÇ´Â°¡¸¦ ÆÇ´ÜÇÏ´Â ¿ëµµ·Î ÁÖ·Î »ç¿ëÇÕ´Ï´Ù.
      • ¿¹¸¦ µé¾î¼­ a+def ¶ó´Â Á¤±ÔÇ¥Çö½Ä¿¡¼­ aaadef ´Â ¸ÅĪµÇÁö¸¸ def ´Â ¸ÅĪµÇÁö ¾Ê½À´Ï´Ù.
  • Á¤±ÔÇ¥Çö½ÄÀº Regular Expression À̶ó´Â ¸»À» ÀϺ»»ç¶÷µéÀÌ Çѹ®È­ ÇÑ°ÍÀÔ´Ï´Ù. Á¤±ÔÇ¥Çö½ÄÀº Automata À̷п¡¼­ °øºÎÇÏ°Ô µÇ°í, Compiler À̷п¡¼­ ¸¹ÀÌ »ç¿ëÇÕ´Ï´Ù. ÄÄÆÄÀÏ·¯¸¦ ¸¸µé¶§ »ç¿ëÇÏ´Â µµ±¸ÀÎ Lex ¿¡¼­µµ ¼Ò½ºÄڵ忡¼­ Identifier, Reserved¿öµåµîÀÇ ÁöÁ¤µÈ ÆÐÅÏÀ» ã±â À§Çؼ­ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÕ´Ï´Ù.

1.1 Á¤±ÔÇ¥Çö½ÄÀÇ »ç¿ë

  • Á¤±ÔÇ¥Çö½ÄÀº ¹®¼­³»¿¡¼­ ¾î¶°ÇÑ ÆÐÅÏÀ» ã°í ±×³»¿ëÀ» º¯°æÇÏ´Â ¿ëµµ·Î °¡Àå ¸¹ÀÌ »ç¿ëÇÕ´Ï´Ù.
    • vi ¿¡µðÅÍ·Î ÆíÁýÀ» ÇÒ¶§ 2¹ø ¶óÀκÎÅÍ 4¹ø¶óÀαîÁö Á¦ÀÏóÀ½ ÁÙ¿¡ °ø¶õÀ» 4°³ Áý¾î ³Ö¾î¾ß ÇÒ °æ¿ì°¡ »ý±é´Ï´Ù. À̶§ ´ÙÀ½°ú °°ÀÌ »ç¿ëÇϸé ÆíÇÕ´Ï´Ù. 2,4s/^/ /g
    • LaTeX¿¡¼­ description environment·Î µÇ¾î ÀÖ´Â °ÍÀ» Çѹø¿¡ itemize·Î ¹Ù²Ù°í ½ÍÀ»¶§ perlÀ» ÀÌ¿ëÇÑ´Ù¸é ´ÙÀ½°ú °°ÀÌ ½±°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù. Àǹ̴ 'global(g)ÇÏ°Ô substitute (s) description À̶ó´Â ÆÐÅÏÀ» itemize·Î º¯°æ(substitute)Ç϶ó' ¶ó´Â Àǹ̰¡ µË´Ï´Ù. ¹°·Ð ´õ º¹ÀâÇÑ ÆÐÅÏÀ̳ª Á¶°ÇÀ» ÀÌ¿ëÇÑ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
  while (<>) {
    s/description/itemize/g;
  }
  • ¸¸¾à ¾î¶² ¹®¼­³»¿¡¼­ÀÇ ¹Ýº¹µÇ´Â patternÀ» ã¾Æº¸´Â °æ¿ì¸¦ »ý°¢ÇØ º¾½Ã´Ù. ´ÙÀ½ °°Àº ¹®¼­¿¡¼­ ¿ì¸®°¡ ã°íÀÚ ÇÏ´Â patternÀº <sup >(\d)</sup></a></span>(.*)</div></footnote>¶ó°í ÇսôÙ.¿·¿¡ ½áÁø Á¤±ÔÇ¥Çö½ÄÀº ¹Ù¸£°Ô µÈ Ç¥ÇöÀÌ ¾Æ´Õ´Ï´Ù. ´ÜÁö ±×³É ¿ì¸®°¡ Àбâ ÆíÇÏ°Ô ¸¸µç°Í ÀÔ´Ï´Ù.À§¿Í °°Àº PatternÀº 2°³°¡ Á¸Àç ÇÕ´Ï´Ù.
\def\jstoday{2004-12-17 16:12:00} \input htex \input onmouseover.4ht  <js><footnote>fn1x0=<div class="js"><span class="footnote-mark"><a
 id="fn1x0">    <sup >1</sup></a></span>°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¢°¡°¡¼ÕÀ̳ª ±â±¸¸¦ ÀÌ¿ëÇؼ­ °ñ¹ÝÀÇ »óųª »êµµÀÇ ÀÔ±¸µîÀ» »ìÆ캸´Â
ÇàÀ§</div></footnote>
<footnote>fn2x0=<div class="js"><span class="footnote-mark"><a
 id="fn2x0">    <sup >2</sup></a></span>°¡²û¾¿ **********************ÀÔ´Ï´Ù</div></footnote>

   <>    ol_hauto = 1;                                                                                                            </></js>

#!/usr/bin/perl
open(RFH,$ARGV[0]) || die $!;
while(<RFH>){
        $tex_content .= $_;
        }
close RFH; #¿ì¼± ÇÊ¿äÇÑ È­ÀÏ¿¡¼­ Àüü¸¦ ½ºÄ®¶ó data·Î ºÒ·¯ µéÀÔ´Ï´Ù.
while ($tex_content =~ m{<sup >(\d)</sup></a></span>(.*?)</div></footnote>}gms) #¿©±â°¡ °¡Àå Áß¿äÇÑ pointÀä.¹Ø¿¡ ¼³¸íÇÏ°Ú½À´Ï´Ù.
{
print "\n\n$1\n $2\n";
}
À§¿Í °°ÀÌ ÇÏ¸é µË´Ï´Ù. * À§ÀÇ °æ¿ì¿¡ À־ º¯°æÀÚ modifierºÎÅÍ »ìÆ캸¸é msº¯°æÀÚ´Â ¿©·¯ line¸¦ ó¸®Çϱâ À§Çؼ­ ºÙ¿©Áø °ÍÀ̸ç, g¿É¼ÇÀº dataÀÇ ³¡±îÁö °¡¼­ match¸¦ Ç϶ó´Â ¸»ÀÔ´Ï´Ù. ¿©±â¼­ $2¿¡ ÇØ´çÇÏ´Â (.*?)°¡ Àִµ¥, ÀÌ°ÍÀÇ Àǹ̴ .*¿¡ ´À½¼ÇÑ ¼ö·®ÀÚ(Á¤±Ô½Ä ¿ÏÀüÇØºÎ¿Í ½Ç½ÀÀÇ ÀúÀÚÀÎ Á¦ÇÁ¸® ÇÁ¸®µ¹ÀÌ ¾´ Ç¥ÇöÀÔ´Ï´Ù.)À» ¾¸À¸·Î Çؼ­ 2¹ø° matchµÈ °Í ±îÁö °¡Áö ¾Ê°Ô Çϱâ À§ÇÑ °Í ÀÔ´Ï´Ù.(?) ±×¸®°í whileÀ» ÇØÁØ ÀÌÀ¯´Â match°¡ dataÀÇ ³¡±îÁö °¡Áö ¾Ê¾ÒÀ¸¸é, ¸¶Áö¸· match°¡ µÈ ºÎºÐºÎÅÍ ´Ù½Ã match¸¦ ½Ãµµ Ç϶ó´Â ÀǹÌÀÔ´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº °ü·Ã¼­ÀûÀ̳ª TutorialÀ» º¸½Ã±â ¹Ù¶ø´Ï´Ù.

2 °ü·Ã ¼­Àû

[ISBN-8979142269]
  • ¼­Æò
    • :) :) :) :) :) ÁöÇýÀÇ ¿©½Å ¹Ì³×¸£¹ÙÀÇ »ó¡ÀÎ ºÎ¾ûÀÌ°¡ Ç¥Áö¸¦ Àå½ÄÇÏ°í ÀÖ½À´Ï´Ù. °³ÀÎÀûÀ¸·Î Àß ¸Â´Â ±×¸²À̶ó°í »ý°¢ÇÕ´Ï´Ù. ¹ø¿ªÆÇÀº »óÈ£ÂüÁ¶ ¿ÀŸ°¡ ¸¹Áö¸¸ ±×·°Àú·° º¼¸¸ÇÕ´Ï´Ù. Ã¥ ³»¿ëÀº ¾ÆÁÖ ÁÁ½À´Ï´Ù. (¾ÆÁ÷µµ º¸´Ù ¸»´Ù ÇÏ´Â ÁßÀÔ´Ï´Ù.) °­Ãß -- hermian
[ISBN-0321112547]
  • Python À¸·Î Regular Expression À» ºñ·ÔÇÑ ±âŸ ¹®ÀÚ¿­ 󸮹æ¹ýÀÌ Àß ¼³¸íµÇ¾î ÀÖ½À´Ï´Ù.
  • [http]http://gnosis.cx/TPiP/ ¿¡ Text°¡ °ø°³µÇ¾î ÀÖ½À´Ï´Ù.
  • LaTeXÀ¸·Î ¸¸µç Ã¥ÀÔ´Ï´Ù.
-- smcho

4 Tips


5 Utility

Regular Expression Coach, Regular Expression À» ÇнÀÇϴµ¥ À־ ÁÁÀº µµ±¸ÀÔ´Ï´Ù. Lisp ·Î ¸¸µé¾ú°í, ½ÇÇàÆÄÀÏÀÌ Á¦°øµË´Ï´Ù.
½ÇÇàÆÄÀÏÀ» ¾îµð¼­ ´Ù¿î ¹ÞÀ» ¼ö ÀÖ³ª¿ä? mailing¿¡ µç´ÙÀ½ ¹«¾ð°¡ ÇÏ´Â °Ç°¡¿ä? --hermian
ÇÁ·Î±×·¥ ´Ù¿î·Îµå Àå¼Ò¸¦ Ãß°¡ÇÏ¿´½À´Ï´Ù. -- smcho

ÇÁ·Î±×·¥ ´Ù¿î·Îµå [http]http://weitz.de/regex-coach/ ¸ÞÀϸµ ¸®½ºÆ® [http]http://common-lisp.net/mailman/listinfo/regex-coach

ÇѱÛWindowsȯ°æ¿¡¼­´Â ÆùÆ® ¹®Á¦¶§¹®¿¡ displayÇϴµ¥ ´ÙÀ½ÀÇ Á¶Ã³°¡ ÇÊ¿äÇÕ´Ï´Ù. regedtÇؼ­ HKEY_CURRENT_CONFIG/software/fonts º¯°æ. hgvafix.fon -> vgafix.fon hvgasys.fon -> vgasys.fon vga949.fon -> vgaoem.fon

-- smcho


Contributors : smcho,hermian

SeeAlso. Nsmk:Á¤±Ô½Ä


^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-01-28 10:50:55
Processing time 0.0458 sec