Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/01/2019 in all areas

  1. And jchd, of course. The adjective, as in “you really jchd’d the shit out of that regex”.
    3 points
  2. Is that what you're after? Local $string = "*** gzno(uà 156+ more garbage *** i'm would've O'Malley o'malley can't they'VE chance!" Local $string2 = Execute('"' & StringRegExpReplace($string, "(?ix) (?| (O'[[:alpha:]]+) () | ([[:alpha:]]+'?) ([[:alpha:]]*))", '" & _StringProper("$1") & StringLower("$2") & "') & '"') MsgBox(0, "", $string & @LF & $string2) A little addition even handles McDonald's and even more McO'Tool's friend correctly(*): Local $string = "*** gzno(uà mcdonald mco'tool mco'tool's friend mcdONald'S junk food 156+ more garbage *** i'm would've O'Malley o'malley can't they'VE chance!" Local $string2 = Execute('"' & StringRegExpReplace($string, "(?ix) (?| (O'[[:alpha:]']+) () | (Mc) () (?=[[:alpha:]]+) | (?<=Mc) ([[:alpha:]]+) () | ([[:alpha:]]+'?) ([[:alpha:]]*))", '" & StringUpper(StringLeft("$1", 1)) & StringLower(StringTrimLeft("$1", 1)) & StringLower("$2") & "') & '"') MsgBox(0, "", $string & @LF & @LF & $string2) (*) Until a non-intuitive counter-example surfaces...
    2 points
  3. Why don't you just use one of the numerous GREP for Windows command line programs? Most have a switch that will provide just a count of matches. That would be much faster than any grep-like logic that you could create in AutoIt.
    1 point
×
×
  • Create New...