Following on from @vitesse post which showed keepcharranges using a-z as a regex range, I wondered what other regex functionality exists.
So looking through the docs I see a few like StringTheory Complete Documentation
https://www.capesoft.com/docs/stringtheory/StringTheory.htm#Match
https://www.capesoft.com/docs/stringtheory/StringTheory.htm#FindMatch
But I wondered if the methods could be grouped so they stand out as ‘these are the regex/strpos methods & properties’?
Reason I ask is Im just currently merging a couple of regex functions into one and if the functionality it provides exists in StringTheory already, no point in reinventing the egg.
My function
StrPosProcess (**? pSearchString, ? pRegEx, Long pMode=0, Long pStrPosBitmaskOptions=0, Long pInstance, <? pReturnValue>), Long !Long = Returned Errorcode
Pertinent Bitmask equates, so not all.
!Just started adding this yesterday.
RegExLeftToRightProcessing
RegExRighToLeftProcessing
!alters the passed regex pattern match string
RexExMatchNoLeadingSpaces
RegExMatchNoTrailingSpaces
RegExMatchNoLeadingTrailingSpaces
!
ReturnLen !len of the regex match
ReturnMatch !returns the matched string
ReturnLeading !returns leading string before match start
ReturnTrailing !returns trailing string after match end
! Works with above returnlen and returnmatch
ReturnMinSize !returns the smallest matched string size found
ReturnMaxSize !returns the largest matched string size found
Theres other bitmask options, but this function also lets you specify the pInstance number so 1st or Nth match in a string.
It works well in their StrPosLen/StrPosMatch forms but theres so much code overlap Im merging these two functions back into one.
But if StringTheory does this for me, I might just get that, hence the question?
Im using these function(s) to parse txa’s and other programming language source files, and it generally works.
The hardest part is getting the regexes right, but when it works its so easy to validate source code but returning the matched string is key to making progress with regex pattern matches.