找回密码
 加入
搜索
查看: 1937|回复: 3

[AU3基础] 正则表达式求助

[复制链接]
发表于 2020-7-23 14:32:00 | 显示全部楼层 |阅读模式
# dmidecode 2.10
SMBIOS 3.0 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
        Manufacturer: ASUSTeK COMPUTER INC.
        Product Name: H110M-F
        Version: Rev X.0x
        Serial Number: 170502630721219
        Asset Tag: Default string
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: Default string
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0

Handle 0x0036, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: None
        Maximum Capacity: 32 GB
        Error Information Handle: Not Provided
        Number Of Devices: 2

Handle 0x0037, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0036
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: ChannelA-DIMM1
        Bank Locator: BANK 0
        Type: <OUT OF SPEC>
        Type Detail: Synchronous
        Speed: 2133 MHz
        Manufacturer: 0875
        Serial Number: C314000A
        Asset Tag: 9876543210
        Part Number: JHD2133U1504JY      
        Rank: 1

Handle 0x0038, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0036
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: ChannelB-DIMM1
        Bank Locator: BANK 2
        Type: <OUT OF SPEC>
        Type Detail: Synchronous
        Speed: 2133 MHz
        Manufacturer: GEIL
        Serial Number: 00000000
        Asset Tag: 9876543210
        Part Number: CL17-17-17 D4-2400  
        Rank: 1

Handle 0x003D, DMI type 4, 48 bytes
Processor Information
        Socket Designation: LGA1151
        Type: Central Processor
        Family: Celeron
        Manufacturer: Intel(R) Corporation
        ID: E9 06 09 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 158, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (Fast floating-point save and restore)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Hyper-threading technology)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Celeron(R) CPU G3930 @ 2.90GHz
        Voltage: 0.9 V
        External Clock: 100 MHz
        Max Speed: 8300 MHz
        Current Speed: 2900 MHz
        Status: Populated, Enabled
        Upgrade: Other
        L1 Cache Handle: 0x003A
        L2 Cache Handle: 0x003B
        L3 Cache Handle: 0x003C
        Serial Number: To Be Filled By O.E.M.
        Asset Tag: To Be Filled By O.E.M.
        Part Number: To Be Filled By O.E.M.
        Core Count: 2
        Core Enabled: 2
        Thread Count: 2
        Characteristics:
                64-bit capable




正则要取的内容 ASUSTeK COMPUTER INC.
H110M-F
32 GB
Number Of Devices: 2 这里的2
ChannelA-DIMM1
0875
4096 MB
2133 MHz
ChannelB-DIMM1
4096 MB
GEIL
4096 MB
2133 MHz

Intel(R) Celeron(R) CPU G3930 @ 2.90GHz
LGA1151

Core Enabled: 2 这里的2

希望大神帮下忙,谢谢了








 楼主| 发表于 2020-7-23 15:21:35 | 显示全部楼层
自己搞定了,代码如下

(?m)Manufacturer:(.+?)\r

[0] ASUSTeK COMPUTER INC.
[1] 0875
[2] GEIL
[3] Intel(R) Corporation
[完毕]
---------------------------------------
(?m)Size:(.+?)\r
[0] 4096 MB
[1] 4096 MB
[完毕]
---------------------
(?m)Locator: (.+?)\r

[0]ChannelA-DIMM1
[1]BANK 0
[2]ChannelB-DIMM1
[3]BANK 2
[完毕]
--------------------
(?m)Speed: (.+?)\r
[0]2133 MHz
[1]2133 MHz
[2]8300 MHz
[3]2900 MHz
[完毕]
-------------------------
(?m)Maximum Capacity:(.+?)\r
[0] 32 GB
[完毕]
------------------------
(?m)Product Name:(.+?)\r
[0] H110M-F
[完毕]
------------------------------
(?m)Socket Designation:(.+?)\r
[0] LGA1151
[完毕]
---------------------------
(?m)Thread Count:(.+?)\r
[0] 2
[完毕]
发表于 2020-7-23 17:21:15 | 显示全部楼层
这个的确自己解决最好,因为关键字相同的太多,也只有你自己知道要获取的内容~
分步操作是对的,容易修改。
解决了请修改标题。
 楼主| 发表于 2020-7-24 14:10:58 | 显示全部楼层
afan 发表于 2020-7-23 17:21
这个的确自己解决最好,因为关键字相同的太多,也只有你自己知道要获取的内容~
分步操作是对的,容易修改 ...

这还得感谢A版分享的工具哦!Au3.REHelper
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-18 09:54 , Processed in 0.071021 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表