Regexp Help
Posted: Sun Nov 22, 2009 12:34 pm
Hi,
Someone can help me?
I would like to create a regexp to get "class" definition of this text:
My regexp should find this:
So far my regexp looks like this:
Someone can help me?
I would like to create a regexp to get "class" definition of this text:
Code: Select all
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
Code: Select all
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')Code: Select all
class (.*?)\(models\.Model\):[\n\t\r\s]+[\w\d\.]+[\s]*=[\s]*[\x20\d\w().=',]+