°ª¤âÌÀ°À° regexp ¨D±Ð §ä¯S©w¼Æ¶qªº¼Æ¦r
- ©«¤l
- 79
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 148
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-5-21
- ³Ì«áµn¿ý
- 2023-3-13
|
°ª¤âÌÀ°À° 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
½Ð°ª¤âÀ°À° |
|
|
|
|
|
|
- ©«¤l
- 121
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 170
- ÂI¦W
- 62
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2021-1-21
- ³Ì«áµn¿ý
- 2024-8-20
|
¦^´_ 1# adrian_9832
¼Ó¥D¸Õ¸Õ.Pattern = "(2|3)\d{5,7}" ³o¼Ë¤£ª¾¥i§_? |
|
|
|
|
|
|
- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
\b[23](\d{5}|\d{7})(?![\d\.]) |
|
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥hþ¡H
|
|
|
|
|
- ©«¤l
- 79
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 148
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW7
- ³nÅ骩¥»
- EXCEL 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-5-21
- ³Ì«áµn¿ý
- 2023-3-13
|
|
|
|
|
|
|
- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 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
|
|
|
|
|