regex - Need fresh eyes on Python assertRegexpMatches -


my regex using :

ur"^[\s\s]*ticket price (including £0.50 booking fees)[\s\s]£5.50[\s\s]*$" 

and string comparing :

"ticket price (including £0.50 booking fees) £5.50" 

i have been messing around on regex101.com no avail. logic seems right me, not matching (i trying use assertregexpmatches() test code). or tips appreciated.

you need escape paranthesis , dots (decimal). in regex (..) called capturing group used capture chars. match literal (, ) brackets, must escape them in regex.

ur"^[\s\s]*ticket price \(including £0\.50 booking fees\)[\s\s]£5\.50[\s\s]*$" 

demo


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -