|
|
|
|
|
|
| Author |
Message |
codecraig *nix forums Guru Wannabe
Joined: 14 Apr 2005
Posts: 201
|
Posted: Fri Jul 21, 2006 1:36 pm Post subject:
regular expression - matches
|
|
|
how can i determine if a given character sequence matches my regex,
completely?
in java for example I can do,
Pattern.compile(regex).matcher(input).matches()
this returns True/False whether or not input matches the regex
completely.
is there a matches in python? |
|
| Back to top |
|
 |
Tim Chase *nix forums Guru Wannabe
Joined: 12 Jan 2006
Posts: 156
|
Posted: Fri Jul 21, 2006 1:48 pm Post subject:
Re: regular expression - matches
|
|
|
abcd wrote:
| Quote: | how can i determine if a given character sequence matches my regex,
completely?
in java for example I can do,
Pattern.compile(regex).matcher(input).matches()
this returns True/False whether or not input matches the regex
completely.
is there a matches in python?
import re
'match' in dir(re)
True
help(re.match)
Help on function match in module sre: |
match(pattern, string, flags=0)
Try to apply the pattern at the start of the string, returning
a match object, or None if no match was found.
For more info, see
http://docs.python.org/lib/module-re.html
-tkc |
|
| Back to top |
|
 |
codecraig *nix forums Guru Wannabe
Joined: 14 Apr 2005
Posts: 201
|
Posted: Fri Jul 21, 2006 1:57 pm Post subject:
Re: regular expression - matches
|
|
|
yea i saw that....guess I was trusting that my regex was accurate
....b/c i was getting a Matcher when I shouldnt have, but i found that
it must be the regex. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 9:14 pm | All times are GMT
|
|
Mortgages | Bad Credit Mortgages | Libro de autoayuda | Low Interest Credit Card | Credit Reports
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|