ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

°ª¤â­ÌÀ°À° regexp ¨D±Ð §ä¯S©w¼Æ¶qªº¼Æ¦r

°ª¤â­ÌÀ°À° regexp ¨D±Ð §ä¯S©w¼Æ¶qªº¼Æ¦r

¤j¤j­Ì¦n ·Q½Ð°Ý¥Î regexp «ç»ò§ä6­Ó¦ì ©Î8­Ó¦ìªº¼Æ¦r  , ¦Ó¥B¥H2 ©Î 3 ¶}ÀY?
¥H¤U¬O§Úªº¥¼§¹¦¨½d¨Ò ¥u¯à§ä¨ì¼Æ¦r

Private Function format_dn(ByVal DN As String) As String


Set oregexp = CreateObject("vbscript.regexp")
With oregexp
    .Global = True
    .IgnoreCase = True
    .Pattern = "[0-9]+"
    .MultiLine = True
   
    Set omatch = .Execute(DN)
    'MsgBox (omatch(0))
   
    For Each m In omatch
        returntext = returntext & m & vbCrLf
    Next
    format_dn = returntext
   
    'replace the number then exist a-z
    'MsgBox .Replace(DN, "")


   
End With

End Function

½Ð°ª¤âÀ°À°

¦^´_ 1# adrian_9832
¼Ó¥D¸Õ¸Õ.Pattern = "(2|3)\d{5,7}" ³o¼Ë¤£ª¾¥i§_?

TOP

\b[23](\d{5}|\d{7})(?![\d\.])
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

ÁÂÁ¨â¦ì¤j¤jªºÀ°§U

TOP

¦^´_ 1# adrian_9832

    ÁÂÁ«e½úµoªí¦¹¥DÃD
«á¾Ç½m²ß¦r¨åªº¸Ñ¨M¤è®×,½Ð«e½ú°Ñ¦Ò

[A1]="asd1234567890,f0987654321,c3567890,d2456789012,0.34567890132,-0.2547896543,S234,000,F25533.000,G33366666,000000"


Option Explicit
Private Function format_dn(ByVal DN As String) As String
Dim T$, N&, Y, i
Set Y = CreateObject("Scripting.Dictionary")
For i = 1 To Len(DN) - 5
   T = Mid(DN, i, 8): N = Val(T): T = N
   If T Like "2#######" Or T Like "3#######" Then Y(T & "") = ""
   T = Mid(T, 1, 6)
   If T Like "2#####" Or T Like "3#####" Then Y(T & "") = ""
Next
If Y.Count = 0 Then
   format_dn = ""
   Else
      format_dn = Join(Y.KEYS, vbCrLf)
End If
Set Y = Nothing
End Function
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD