Jump to content

Search the Community

Showing results for tags '(?i) or (?s)'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hallo forum members, Question in example below "StringRegExpReplace" and pattern (?i) works well but (see the info.xml examples) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Global $info = @ScriptDir & "\info.xml" Local $Gui = GUICreate("Info URL", 615, 229, 192, 124) Local $Input1 = GUICtrlCreateInput("", 32, 48, 481, 21) Local $Button1 = GUICtrlCreateButton("Ok", 544, 46, 33, 25) GUISetState(@SW_SHOW) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 changeUrl() EndSwitch WEnd Func changeUrl() Local $info_url = GUICtrlRead($Input1) Local $File = FileOpen($info, 0) If $File <> -1 Then Local $info_container = FileRead($File) FileClose($File) If StringRegExp($info_container, "(?i)<url>(.*)</url>") Then $info_container = StringRegExpReplace($info_container, "(?i)<url>(.*)</url>", "<url>" & $info_url & "</url>") Local $hFile = FileOpen($info, 130) ; Open file for writing in unicode UTF8 mode FileWrite($hFile, $info_container) FileClose($hFile) EndIf EndIf EndFunc ;==>changeUrl info.xml (created by new installation) -> (?i) does not change the url (?s) will change the url <?xml version="1.0" encoding="utf-8"?> <document> <address>51.49079, -0.116844</address> <name>Info</name> <city>London</city> <style id="sn_subway"> <hotSpot x="0" y="0" xunits="pixels" yunits="pixels" /> <balloonStyle> <bgColor>FFFFFFFF</bgColor> <textColor>FF000000</textColor> </balloonStyle> </style> <url> </url> </document> info.xml (after editing) in this case (?i) or (?s) will work both <?xml version="1.0" encoding="utf-8"?> <document> <address>51.49079, -0.116844</address> <name>Info</name> <city>London</city> <style id="sn_subway"> <hotSpot x="0" y="0" xunits="pixels" yunits="pixels" /> <balloonStyle> <bgColor>FFFFFFFF</bgColor> <textColor>FF000000</textColor> </balloonStyle> </style> <url>http://www.justaurl.com/</url> </document> Using (?s) Is this the right way to do it? Patterns are still a for me
×
×
  • Create New...