Search code examples
pythonregexpywinauto

Regular expression not working in pywinauto unless I give full text


Here is the code snippet that I am using:

browserWin = application.Application()
browserWin.Start(<FirefoxPath>)
# This starts the Firefox browser. 
browserWin.Window_(title_re="\.* Firefox \.*")

If I use the expression: ".* Mozilla Firefox Start Page .*", it works. However, if I only use a partial text, it doesn't work.

What am I doing wrong here?


Solution

  • Escaped . with "\" means real dot symbol should be at the start of the text. Just remove "\".