0

In buffer I has text

"ADA-SGD"
"ADT-SGD"
"ADX-SGD"
"AID-SGD"
"AMP-SGD"
"ANT-SGD"
"ARDR-SGD"
"ARK-SGD"

M-x regexp-builder

Input regexp:

"\([A-Z]+\)-\([A-Z]+\)"

But I get message:

No match.

enter image description here

Why?

a_subscriber
  • 3,854
  • 1
  • 17
  • 47

2 Answers2

2

Two (2) backslashes are sufficient to get the job done:

"\\([A-Z]+\\)-\\([A-Z]+\\)"
lawlist
  • 18,826
  • 5
  • 37
  • 118
2

Probably you want to select the string syntax.

  (setq reb-re-syntax 'string)

re-syntax

phils
  • 48,657
  • 3
  • 76
  • 115
gigiair
  • 2,124
  • 1
  • 8
  • 14
  • @Alexei see also the comments to your [basically-a-duplicate](https://emacs.stackexchange.com/q/46900) question from a few days ago. – phils Jan 09 '19 at 20:25