-2

Just a simple question. Lets say i have a very long regex.

regex = "(foo|foo|foo|foo|bar|bar|bar)"

Now i want to split this regex into multiple lines. I tried

regex = "(foo|foo|foo|foo|\
          bar|bar|bar)"

but this doesnt seems to work. I get different outputs. Any ideas?

kxell2001
  • 131
  • 1
  • 1
  • 9

1 Answers1

2

Just do it like this

regex = "(foo|foo|foo|foo" \
            "|bar|bar|bar)"
Logovskii Dmitrii
  • 2,629
  • 4
  • 27
  • 44