<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[TNF : Tatter Network Foundation forum - 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
	<link rel="self" href="http://forum.tattersite.com/ko/extern.php?action=feed&amp;tid=2736&amp;type=atom"/>
	<updated>2007-01-29T07:45:42Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.tattersite.com/ko/viewtopic.php?id=2736</id>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16106#p16106"/>
			<content type="html"><![CDATA[<p>도움에 감사드립니다.</p><p>모두들 평안한 하루 보내시길... ^^</p>]]></content>
			<author>
				<name><![CDATA[Tyburn]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=319</uri>
			</author>
			<updated>2007-01-29T07:45:42Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16106#p16106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16092#p16092"/>
			<content type="html"><![CDATA[<p>아 그리고, 함수 link는 linux, unix 쪽에서 사용되는 것이므로 다른 이름으로 바꿔야할 듯합니다.</p>]]></content>
			<author>
				<name><![CDATA[coolengineer]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=318</uri>
			</author>
			<updated>2007-01-29T01:39:04Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16092#p16092</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16091#p16091"/>
			<content type="html"><![CDATA[<p>$pattern = &quot;/(&lt;a[^&gt;]*href=[&#039;\&quot;]*([^&#039;\&quot;]+)[&#039;\&quot;]*[^&gt;]*&gt;(.+?)&lt;\/a&gt;?)/&quot;;</p><p>로 바꾸시면 될 것 같습니다. (.+?) 는 최소 매치를 수행하므로, 한 줄에 여러 a 태그가 나와도 최소한의 매치만 하므로 원하는 값이 나옵니다.</p><p>그리고, 아래는 \\3 을 없애고 \\0을 맨 앞에 넣은 것인데, 이것이 의도한 것 아니었나요?</p><p>&nbsp; &nbsp; $target = preg_replace($pattern, &quot;<strong>\\0</strong>&lt;a href=\&quot;\\2\&quot; target=\&quot;_blank\&quot;&gt;&lt;img src=\&quot;./images/newwindow.gif\&quot; style=\&quot;margin-left:0<br />.1em; margin-right:0.1em; vertical-align:middle;\&quot; alt=\&quot;HyperLink\&quot;&gt;&lt;/a&gt;&quot;, $target);</p>]]></content>
			<author>
				<name><![CDATA[coolengineer]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=318</uri>
			</author>
			<updated>2007-01-29T01:38:04Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16091#p16091</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16038#p16038"/>
			<content type="html"><![CDATA[<p>네...<br />&lt;a href=&quot;....&quot;&gt; 에서 &lt;a href=&quot; 부터 &quot;&gt; 정도 까지만 찾으셔도 될듯 싶습니다...<br />아니면 href= ~ &gt; 까지만 해도 충분할듯 싶습니다.</p>]]></content>
			<author>
				<name><![CDATA[Ohyung]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=608</uri>
			</author>
			<updated>2007-01-28T00:51:34Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16038#p16038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RSS 답글: 정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16026#p16026"/>
			<content type="html"><![CDATA[<p>굳이 &lt;/a&gt;까지 찾을 필요가 없지 않을까요?</p>]]></content>
			<author>
				<name><![CDATA[ditto]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=522</uri>
			</author>
			<updated>2007-01-27T10:27:19Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16026#p16026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[정규 표현식 고수님들께 도움을 요청합니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=16025#p16025"/>
			<content type="html"><![CDATA[<p>안녕하세요.</p><p>제가 태터툴즈의 포스트에 참조 링크가 걸려 있으면 링크 오른쪽에 아이콘을 표시하고 링크는 새창으로 열리도록 하기 위해 플러그인을 제작하고 있습니다.</p><p>소스는 다음과 같습니다.</p><div class="quotebox"><blockquote><p>function link($target) {<br />&nbsp; &nbsp; &nbsp; &nbsp; $pattern = &quot;/(&lt;a[^&gt;]*href=[&#039;\&quot;]*([^&#039;\&quot;]+)[&#039;\&quot;]*[^&gt;]*&gt;([^&lt;]+)&lt;\/a&gt;?)/&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $target = preg_replace($pattern, &quot;&lt;a href=\&quot;\\2\&quot; target=\&quot;_blank\&quot;&gt;\\3&lt;img src=\&quot;./images/newwindow.gif\&quot; style=\&quot;margin-left:0.1em; margin-right:0.1em; vertical-align:middle;\&quot; alt=\&quot;HyperLink\&quot;&gt;&lt;/a&gt;&quot;, $str);<br />&nbsp; &nbsp; &nbsp; &nbsp; return $target;<br />&nbsp; &nbsp; }</p></blockquote></div><p>그런데 이 함수가</p><div class="quotebox"><blockquote><p>&lt;a href=&quot;주소&quot;&gt;어쩌구 저쩌구 재잘재잘&lt;/a&gt;</p></blockquote></div><p>와 같은 형식으로 되어 있으면 제대로 동작합니다. 하지만,</p><div class="quotebox"><blockquote><p>&lt;a href=&quot;주소&quot;&gt;어쩌구 &lt;span style=&quot;color:#000000;&quot;&gt;저쩌구&lt;/span&gt; 재잘재잘&lt;/a&gt;</p></blockquote></div><p>이렇게 보다시피 &lt;a&gt;&lt;/a&gt; 태그 중간에 &lt;span&gt; 과 같은 코드가 들어가 버리면 위에서 작성한 link 함수가 동작하지 않습니다.</p><p>웹에서 정규식 메뉴얼들을 찾아서 이리저리 수정해 보고는 있습니다만, 잘 안되더군요.. ㅠㅠ</p><p>그래서 정규식 고수분들께 도움을 요청드립니다. 어떻게 하면 좋을까요?</p>]]></content>
			<author>
				<name><![CDATA[Tyburn]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=319</uri>
			</author>
			<updated>2007-01-27T09:27:46Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=16025#p16025</id>
		</entry>
</feed>
