
Oct. 2, 2015
4:52 p.m.
On Sat, Oct 3, 2015 at 12:48 AM, João Bernardo <jbvsmo@gmail.com> wrote:
But some of the other arguments are making me think bf'' is a bad idea, so now I'm leaning towards not implementing it.
What about rf''? (sorry for being off topic here)
Regex could benefit from it:
my_regex = rf"ˆ\w+\s*({'|'.join(expected_words)})$"
Works fine: rosuav@sikorsky:~$ python3 Python 3.6.0a0 (default:48943533965e, Sep 28 2015, 11:27:38) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information.
expected_words = ["foo", "bar"] my_regex = rf"ˆ\w+\s*({'|'.join(expected_words)})$" print(my_regex) ˆ\w+\s*(foo|bar)$
ChrisA