By using a regular expression I want to get all indexes where the following character sequence appears:
FORALL ... in ... :
// between "FORALL" and "in" might be whitespaces and non-word characters like ","
example: find these 3 ones:
- FORALL i<=j in a1,x,y:
- FORALL i,j in a1,x,y:
- FORALL i <= j in a1:
replace with this one:
FORALL i,j in a1:
part of the idea:
the substring has to start with the word FORALL
the "in" respectively the ":" has to appear exactly one time - therefore do not get by mistake the "in" from the actual next independent match
inside of the substring is no "in" allowed but the first part should end with one
My last trying is the following regular expression
"(^FORALL[<=|>=|<|>|==|!=](?!.*in).*in$)((?!.*\\:).*\\:$ )"
according: Regular expression that doesn't contain certain string