最近学习正则,来做个练习.
;-------------------------------
;找出宜:后的中文
;找出忌:后的中文
;-------------------------------
#include <array.au3>
Local $a = _
'<td class="table001"> <BR>' & @CRLF & _
' <table width="75%" border="0" align="center" class="table001">' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>农历:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">冬月(小)廿八 星期四 射手座</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>干支:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">戊子年 生肖属鼠 甲子月 己亥日</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b><FONT COLOR=red>宜:</FONT></b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">出行 沐浴 理发 补垣 塞穴</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b><FONT COLOR=green>忌:</FONT></b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">入宅 安葬</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>吉神宜趋:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">玉堂 </td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>凶神宜忌:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">游祸 血支 重日 朱雀 </td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>每日胎神占方:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">占门床房内南</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>五行:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">平第木 闭执位</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>冲:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">冲蛇(癸已)煞西</td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td width="26%" bgcolor="#FFAA00" height="30"> ' & @CRLF & _
' <div align="right"><b>彭祖百忌:</b></div>' & @CRLF & _
' </td>' & @CRLF & _
' <td width="74%" bgcolor="#FFD680">己不破券二比并亡 亥不嫁娶不利新郎</td>' & @CRLF & _
' </tr>' & @CRLF & _
' </table>' & @CRLF & _
' ' & @CRLF & _
' </td>' & @CRLF & _
' </tr>' & @CRLF
Local $b = StringRegExp($a,'(?si)(?:>宜|>忌)[^\x{4e00}-\x{9fa5}]+([^<>]*?)</td>',3)
If Not @error Then _ArrayDisplay($b,UBound($b))
|