Split a buffer into multiple buffers by different criteria (regular expressions)
We will use a feature of regular expressions to split a buffer into multiple buffers
Let's say you have a buffer like "INHSBC02134567" and you want to split said buffer into the following parts:
first should always be "IN" (buffer1), then any number of characters before the number starts (buffer2), then the first 3 digits of the number (buffer3), then the rest of the number (buffer4).
The regular expression to identify each chunk and assign it to a Named Capture Group (which will be translated into a buffer) looks like below:
Used in a TBox Set Buffer teststep where we initially create the buffer and then verify it against the above regular expression, the scenario looks like this:
After executing this testcase there should be 4 buffers, each with the desired value.