Jump to content

Search the Community

Showing results for tags 'RegExp pattern'.

  • 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 2 results

  1. I have a regular expression that I use in a StringRegExpReplace() function that replaces CRLFs if the matching text is the last text on a line. Here is my example script: test() Exit (1) Func test() Local $sfor, $pat, $sTextBefore = "", $sTextFixed $sTextBefore &= "Line 1 MF Midget vs NE Midget" & @CR $sTextBefore &= "Line 2 Midget 1 vs VYY Stars" & @CR $sfor = "Midget" $pat = "(?i)Midget\s{0,}[s]{0,1}\s{0,}[0-9]?+" $sTextFixed = StringRegExpReplace($sTextBefore, $pat, "+++") ConsoleWrite("+++: $pat ====>" & $pat & "<==" & @CRLF) ConsoleWrite("+++: $sTextBefore ==>" & @CRLF & $sTextBefore & @CRLF) ConsoleWrite("+++: $sTextFixed ===>" & @CRLF & $sTextFixed & @CRLF) EndFunc The output looks like this (I can't figure out how to remove the strikeout in this example):
  2. I have got text file and I want to find two words with exact number of lines between them #include <Array.au3> ; first text $txt = '111' & @CRLF & '222' & @CRLF & '333' & @CRLF & '444' & @CRLF & '555' ; second text ;$txt = '111' & @CRLF & '222' & @CRLF & 'x' & @CRLF & 'y' & @CRLF & '333' & @CRLF & '444' & @CRLF & '555' $txt = StringRegExp($txt, '(?s)111(.*n{1,2}.*)333', 3) ;~ _ArrayDisplay($txt) For $i = 0 To UBound($txt) - 1 ConsoleWrite($i & ': ' & $txt[$i] & @CRLF) Next Here I try to find 111 and 333 and all between them but only in case when there are 1 or 2 @CRLF (rn) between them. So in first text it should find it and in second text (uncomment it) it shouldn't. But I'm not RegExp guru so my RegExp pattern is not OK and it finds my text no matter of number of @CRLFs. Of course I tried many combinations like (?s)111(.*)n{1,2}(.*)333 (?s)111.*n{1,2}.*333 (?s)111(.*rn{1,2}.*)333 ... but I need help from some RegExp guru with this ...
×
×
  • Create New...