Consider:
"\[|\(phone\)\]"
We are constructing a metadata field, and need to flag filenames that contain the term “phone“. Case standards don’t exist, so I could see any variation of mixed or single case (phone Phone PHONE etc.) There may or may not be spaces to delineate the words; sometimes there are underscores–so I can’t use word boundaries. In ALL cases, the word phone is included in either brackets [] or parentheses ().
The regex I’m trying to construct for a Powershell script will look for a pattern of [ or ( followed by case-insensitive photo and ending with ] or ).
"\[|\(phone\)\]" <– Is that what I’ve got here?
I’d do it by accepting one of two possible solutions,
This way you match either (phone) or [phone], but not [phone) and (photo].
You would have to set a flag to match case insensitive, though. in Javascript for example, you would add an i behind the delimiters, like /[phone]|(phone)/i