Why do I get the same result with two regexes?

I have this string:
[100Abcd]Some Words

I want to use a regex to match the characters between the [ ] (and the [ ] themselves) so I need to make it literal.

\Q[100Abcd] gives the same result as \Q[100Abcd]\E

Is \E not necessary? Or necessary only sometimes?

Thanks.

why not simply:

=REGEX(A1; "(\[\w+\])" )

Because I’m a novice, and (afaict) \w doesn’t appear on the List of regular expressions


Regular Expressions | ICU Documentation

and soon here : Using Regular Expressions in Text Searches

1 Like

=REGEX(X1, "\[[^]]+\]")
or
=REGEX(X1, "\[.+?\]")

worth the read (even non extensive) : books/Mastering Regular Expressions 3rd (Friedl-2006).pdf at master · pengbo-learn/books · GitHub

1 Like

I’ve also found this, which is excellent for teaching the basics: