![]() |
| ||
| Regex for re.match not working as expected. I have the following code: import rethe problem I am having is that this is always evaluating to false. |
| ||
| Re: Regex for re.match not working as expected. The substring "\t" in string is evaluated as a tab character. The re method match only matches at the beginning of a string. Try this: import re |
| ||
| Re: Regex for re.match not working as expected. Ok, I'm not used to that yet, in PHP if I encased the string in ' it would have not evaluated the \t, or any other special character. Thanks. |
| ||
| Re: Regex for re.match not working as expected. you could just as easily do s = 'c:\\test.doc' |
| ||
| Re: Regex for re.match not working as expected. If the file name is a variable returned from some source: >>> s = "c:\test.doc" |
| All times are GMT -4. The time now is 11:38 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC