Jump to content

Search the Community

Showing results for tags 'regular expressions'.

  • 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. This code works perfectly fine for my purposes. However, it's a little ugly because there is obvious duplication. I've been playing with this and regular expressions for about an hour and could not seem to merge the check into a single expression. But I'm quite certain it must be possible to have optional matches... Any tips, even if it is simply a suggestion of what keywords I should be Googling? Func GetNthValueFromStatubar($n) ; Get status text as string. $Status = StatusbarGetText($MainWindowTitle) ; Find value based on N. If $n = 1 Then $Result = StringRegExp( $Status, "[A-Za-z: ]+\$([A-Z0-9]+)", 1 ) ElseIf $n = 2 Then $Result = StringRegExp( $Status, "[A-Za-z: ]+\$([A-Z0-9]+)[\s]*[A-Za-z: ]+\$([A-Z0-9]+)", 1 ) ElseIf $n = 3 Then $Result = StringRegExp( $Status, "[A-Za-z: ]+\$([A-Z0-9]+)[\s]*[A-Za-z: ]+\$([A-Z0-9]+)[\s]*[A-Za-z: ]+\$([A-Z0-9]+)", 1 ) EndIf Return $Result[$n - 1] EndFunc
×
×
  • Create New...