Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Stumped by StringRegExp that matches delimited strings which contain a substring

$
0
0

Is there a StringRegExp pattern where you can match strings from within a delimited string (e.g. | delimited) that contain a substring being searched for.

#include <array.au3> $text="|aaa|kcde|fff|akcde|aak|rpf|k|lir|" local $allPipedContent = StringRegExp($text,"\|?(.*?)\|",3) _ArrayDisplay($allPipedContent) local $allPipedContentThatContainsK = StringRegExp($text,no idea :(,3) _ArrayDisplay($allPipedContentThatContainsK) #cs result needs to be     kcde     akcde     aak     k #ce    

Additionally as the substring is not always k ... it can be any string ...

is there an easy way to convert characters that StringRegExp interprets as control characters into literals that can be searched for (e.g. the "(" in the example below).

|aaa|kcde|fff|(akcde|aak|rpf|k|lir|

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>