Forum Discussion
Kai_Wilke
Mar 08, 2017MVP
Hi Steph,
the
[
and ]
chars are used by RegEx to define "bracket expression", which can cover multiple chars at once (e.g. [a-zA-Z0-9]
or [ABab01]
).
If you need to specify the
[
and ]
chars literally (aka. "as is"), within a regex pattern, without creating a "bracket expression", then you have to escape these chars by using a leading \
char as shown below...
Input String:
items[0][varone] items[1][varone] items[1][vartwo]
RegEx Pattern:
items\[\d+\]\[\w+\] items\[\d+\]\[\w+\] items\[\d+\]\[\w+\]
Note: You may tweak your RegEx pattern further, with this lovely online RegEx tester as required.
Cheers, Kai