niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
regular expression - matches
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
codecraig
*nix forums Guru Wannabe


Joined: 14 Apr 2005
Posts: 201

PostPosted: Fri Jul 21, 2006 1:36 pm    Post subject: regular expression - matches Reply with 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?
Back to top
Tim Chase
*nix forums Guru Wannabe


Joined: 12 Jan 2006
Posts: 156

PostPosted: Fri Jul 21, 2006 1:48 pm    Post subject: Re: regular expression - matches Reply with quote

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

PostPosted: Fri Jul 21, 2006 1:57 pm    Post subject: Re: regular expression - matches Reply with quote

yea i saw that....guess I was trusting that my regex was accurate Smile
....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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 9:10 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Regular Expression Aliases in Postfix attila2008 Postfix 0 Fri Mar 07, 2008 1:03 am
No new posts Aliases with regular expression attila2008 Postfix 0 Fri Mar 07, 2008 1:01 am
No new posts regular expression and not form caiqian@gmail.com shell 0 Fri Jul 21, 2006 2:06 pm
No new posts Regular Expressions crash course elyob PHP 1 Thu Jul 20, 2006 8:07 pm
No new posts Regular expression issue dumbkiwi python 1 Wed Jul 19, 2006 10:28 am

Gas Suppliers | Blog5 Game Cheats | Credit Counseling | Bad Credit Mortgages | Gas Suppliers
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
[ Time: 0.3319s ][ Queries: 16 (0.2607s) ][ GZIP on - Debug on ]