JeffQOOQAAA Posted March 29, 2017 Posted March 29, 2017 Dear All. I have as below strings in .txt file +---------------------------------------------------------------------------+ | AMIDEWIN32 Utility v5.19.0015 | | Copyright (C)2017 American Megatrends Inc. All Rights Reserved. | +---------------------------------------------------------------------------+ Initializing the SMBIOS interface. Please wait a moment...... Name R/W Status Information -------------------------- --- ------ ---------------------------------- (/BP)Baseboard product R Done "36E0" And I want to get "36E0" String with StringRegExp($String, '"[A-Za-z0-9\"]+' , 3) But can't get this string , someone can help me?
jdelaney Posted March 29, 2017 Posted March 29, 2017 welp...given that, the easiest way is: $s = '+---------------------------------------------------------------------------+' & @CRLF & _ ' | AMIDEWIN32 Utility v5.19.0015 |' & @CRLF & _ ' | Copyright (C)2017 American Megatrends Inc. All Rights Reserved. |' & @CRLF & _ ' +---------------------------------------------------------------------------+ ' & @CRLF & _ '' & @CRLF & _ 'Initializing the SMBIOS interface. Please wait a moment......' & @CRLF & _ ' Name R/W Status Information' & @CRLF & _ '-------------------------- --- ------ ----------------------------------' & @CRLF & _ '(/BP)Baseboard product R Done "36E0"' $a = StringRegExp($s,'\"(.*)\"',3) But I would think you want to get the value based on the name...so maybe $a = StringRegExp($s,'Baseboard product.*\"(.*)\"',3) ?? IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
ViciousXUSMC Posted March 29, 2017 Posted March 29, 2017 My go at it: #Include <Array.au3> $s = '+---------------------------------------------------------------------------+' & @CRLF & _ ' | AMIDEWIN32 Utility v5.19.0015 |' & @CRLF & _ ' | Copyright (C)2017 American Megatrends Inc. All Rights Reserved. |' & @CRLF & _ ' +---------------------------------------------------------------------------+ ' & @CRLF & _ '' & @CRLF & _ 'Initializing the SMBIOS interface. Please wait a moment......' & @CRLF & _ ' Name R/W Status Information' & @CRLF & _ '-------------------------- --- ------ ----------------------------------' & @CRLF & _ '(/BP)Baseboard product R Done "36E0"' $a = StringRegExp($s, '(?i)Done\s*\x22([^\x22]*)', 3) _ArrayDisplay($a)
jguinch Posted March 29, 2017 Posted March 29, 2017 Extract all occurences of strings beetween double quotes : $a = StringRegExp($s,'"([^"]+)"',3) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now