0

I'm trying to build a regex with a raw f-string in a Sublime Text 3.2.2 plugin:

operatorSymbols = "==|!="
print(fr'\s*({operatorSymbols})\s*')

Desired output:

\s*(==|!=)\s*

I get the error:

    print(fr'\s*({operatorSymbols})\s*')
                                      ^
SyntaxError: invalid syntax

What is wrong with it?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Adamarla
  • 739
  • 9
  • 20

0 Answers0