#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^(?!\s*"name":.*).*\n?|^\s*"
Local $sString = "{" & @CRLF & _
" "country_codes": [" & @CRLF & _
" "GB"" & @CRLF & _
" ]," & @CRLF & _
" "institution_id": "ins_118309"," & @CRLF & _
" "name": "Barclaycard (UK) - Online Banking: Personal", // I want to extract this line only" & @CRLF & _
" "oauth": true," & @CRLF & _
" "products": [" & @CRLF & _
" "assets"," & @CRLF & _
" "auth"," & @CRLF & _
" "balance"," & @CRLF & _
" "transactions"," & @CRLF & _
" "identity"," & @CRLF & _
" "standing_orders"" & @CRLF & _
" ]," & @CRLF & _
" "routing_numbers": []" & @CRLF & _
" }," & @CRLF & _
" "institution_id": "ins_118309"," & @CRLF & _
" "name": "Metro Bank - Commercial and Business Online Plus"," & @CRLF & _
" "oauth": true," & @CRLF & _
" "products": [" & @CRLF & _
" "assets"," & @CRLF & _
" "auth"," & @CRLF & _
" "balance"," & @CRLF & _
" "transactions"," & @CRLF & _
" "identity"," & @CRLF & _
" "standing_orders"" & @CRLF & _
" ]," & @CRLF & _
" "routing_numbers": []" & @CRLF & _
" }"
Local $sSubst = ""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm