• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2448)  |  Call(2412)  |  Derive(0)  |  Import(36)
Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings.

        def split(pattern, string, maxsplit=0, flags=0):
    """Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings."""
    return _compile(pattern, flags).split(string, maxsplit)
        


src/s/h/shedskin-HEAD/examples/mm/mastermind.py   shedskin(Download)
 
        inputOk = False
        while not inputOk:
            colours = re.split("\\s", raw_input("> "), 4)
            for c in colours:
                peg = self.__parseColour(c)
                if peg is not None:

src/n/l/nltk-HEAD/nltk/examples/school/words.py   nltk(Download)
def read_words(filename):
    "Get the words out of the file, ignoring case and punctuation."
    text = open(filename).read().lower()
    return re.split('\W+', text)
 
def read_text(filename):
    "Load the file into a text string, normalising whitespace."

src/t/e/Tenjin-0.9.0/test/test_examples.py   Tenjin(Download)
    def _test(self):
        for fname in glob('*.result'):
            sys.stdout.write(' %s' % fname)
            result = open(fname).read()
            command, expected = re.split(r'\n', result, 1)
            command = re.sub('^\$ ', '', command)
            actual = os.popen(command).read()

src/l/a/Langtangen-HEAD/src/py/examples/q4w/q4w-generate.py   Langtangen(Download)
               answer_type == 'one-line-text':
                answers = []
            else:
                answers = re.split(r'\s*\|\s*',
                                   string.strip(answer_line.group(2)))
            #print 'DEBUG: found an answer of type',answer_type,'list=',answers
            if not last_tag == 'Q':

src/f/r/freebase-1.0.6/examples/freebase-images-appengine/freebase/api/httpclients.py   freebase(Download)
 
        for header in resp.info().headers:
            self.log.debug('HTTP HEADER %s', header)
            name, value = re.split("[:\n\r]", header, 1)
            if name.lower() == 'x-metaweb-tid':
                self.tid = value.strip()
 

src/s/c/scribus-HEAD/gsoc2009/odtsxwplugin/working/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py   scribus(Download)
def wordsplit(text):
    word_pattern = "([A-Za-zäöüÄÖÜß]+)"
    words = []
    for x in re.split(word_pattern, text):
        if re.match(word_pattern, x):
            words.append(x)
    return words

src/s/c/scribus-HEAD/gsoc2009/odtsxwplugin/upstream/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py   scribus(Download)
def wordsplit(text):
    word_pattern = "([A-Za-zäöüÄÖÜß]+)"
    words = []
    for x in re.split(word_pattern, text):
        if re.match(word_pattern, x):
            words.append(x)
    return words

src/e/c/ecell-HEAD/ecell4/trunk/doc/sample/ga/ga.py   ecell(Download)
				aNGNumber += 1
			else:
				aFullID = aMatch.group(1)        # ex. aFullID = "/CELL/CYTOPLASM/R:Km"
				aList = re.split(':',aFullID)    # ex. aList = ['/CELL/CYTOPLASM/R','Km']
 
				# check the number of ':'. It must be 3.
				#if len(aList) != 3:

src/e/c/ecell-HEAD/ecell3/trunk/doc/samples/ga/ga.py   ecell(Download)
                aNGNumber += 1
            else:
                aFullID = aMatch.group(1)        # ex. aFullID = "/CELL/CYTOPLASM/R:Km"
                aList = re.split(':',aFullID)    # ex. aList = ['/CELL/CYTOPLASM/R','Km']
 
                # check the number of ':'. It must be 3.
                #if len(aList) != 3:

src/s/c/scribus-HEAD/gsoc2009/textfilter/scribus/plugins/scriptplugin/samples/wordcount.py   scribus(Download)
def wordsplit(text):
    word_pattern = "([A-Za-zäöüÄÖÜß]+)"
    words = []
    for x in re.split(word_pattern, text):
        if re.match(word_pattern, x):
            words.append(x)
    return words

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next