Pretty easy with regex lookaround:
(?<=\=%7)[A-Z]+(?=%)
Try it on online.
If you use a more open pattern in the middle you should add an ungreedy flag:
(?<=\=%7).+?(?=%)
Use it like this:
$str="onething=%7BABCDEFGHIJKLM%something=%7BNOPQRSTUVWXYZ%"
$ret = [Regex]::Matches($str, "(?<=\=%7).+?(?=%)")
for($i = 0; $i -lt $ret.Count; $i++) {
$ret[0].Value
}
You do not need to use a capturing group since my pattern gives a full match.
Explanation:
Positive Lookbehind (?<=%7)
Assert that the Regex matches the characters %7 literally (case sensitive)
Match a single character present in the list below [A-Z]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
A-Z a single character in the range between A and Z (case sensitive)
Positive Lookahead (?=%)
Assert that the Regex below matches: matches the character % literally
Global pattern flags
g modifier: global. All matches (don't return after first match)
U modifier: Ungreedy. The match becomes lazy by default. Now a ? following a quantifier makes it greedy