What is "[+]" in xemacs regular expression?

757 views Asked by At

In (my) XEmacs 21.4, describe-variable for gdb-prompt-pattern gives:

Value: "^>\\|^(.*gdb[+]?) *\\|^---Type <return> to.*--- *"

What is the "[+]" in there? Does it just mean "the + character"? If so, why not use "\+"?

2

There are 2 answers

1
burning_LEGION On

in regular expression [+] is symbol +

any symbol in [] is symbol except -

0
Basile Starynkevitch On

In your context, [+] is the same as \+, that is matching the + character, and I imagine the original writer of that regexp either did so for readability reasons, or perhaps because [+] used to be in the past some set of chars like [-+]