Create a split pattern for a given delimiter
962229
private static Pattern[] createSplitPatterns(String pEscape, String pDel) {
        return new Pattern[] {
                // Escape ($1: Everything before the delimiter, $2: Trailing escaped values (optional)
                Pattern.compile("(.*?)" + // Any chars
                                "(?:" +
                                   // The delimiter not preceded by an escape (but pairs of escape & value can be in
                                   // are allowed before nevertheless). A negative-look-before (?<!) is used for this
                                   // purpose
                                   "(?<!" + pEscape  + ")((?:" + pEscape + ".)*)" + pDel + "|" +
                                   "$" +    // or end-of-line
                                 ")",Pattern.DOTALL),

                // Unescape, group must match unescaped value
                Pattern.compile(pEscape + "(.)",Pattern.DOTALL)
        };
    }
16997
def _split_after_delimiter(self, item, indent_amt):
        """"""
        self._delete_whitespace()

        if self.fits_on_current_line(item.size):
            return

        last_space = None
        for item in reversed(self._lines):
            if (
                last_space and
                (not isinstance(item, Atom) or not item.is_colon)
            ):
                break
            else:
                last_space = None
            if isinstance(item, self._Space):
                last_space = item
            if isinstance(item, (self._LineBreak, self._Indent)):
                return

        if not last_space:
            return

        self.add_line_break_at(self._lines.index(last_space), indent_amt)
135733
def split(encoded):
    
    algorithm, iterations, salt, h = encoded.split('$', 3)
    return algorithm, iterations, salt, h
579904
def grep_split(pattern, text):
    '''

    '''
    lines = text.splitlines()
    indices = [i for i, line in enumerate(lines)
               if re.search(pattern, line)]
    
    return ['\n'.join(part) for part in partition(lines, indices)]
1033430
private String [] split (final String string, final String delim)
  {
    final List <String> result = new ArrayList <> ();

    final StringTokenizer stringTokenizer = new StringTokenizer (string, delim);
    while (stringTokenizer.hasMoreTokens ())
    {
      result.add (stringTokenizer.nextToken ());
    }

    return result.toArray (new String [result.size ()]);
  }
752850
public static function split(string $string, string $delimiter = ','): array
    {
        return preg_split('/\s*' . preg_quote($delimiter, '/') . '\s*/', $string, -1, PREG_SPLIT_NO_EMPTY);
    }
45375
def split(object, pattern = /,\s*/)
      object ? (object.is_a?(Array) ? object : object.split(pattern)) : []
    end
1256052
def _split_span(self, span, index, length=0):
        """"""
        offset = span[1] + index if index < 0 else span[0] + index
        # log.debug([(span[0], offset), (offset, offset + length), (offset + length, span[1])])
        return [(span[0], offset), (offset, offset + length), (offset + length, span[1])]
1053123
def split(self, s):
        """"""

        normalized = "".join(map(lambda c: " " if c.isspace() else c, s))

        string = False
        quote = False
        v = []
        for col, char in enumerate(normalized.rstrip(), 1):
            if char == '\\':
                quote = True
            if char == '"' and not quote:
                if string:
                    v[-1] = (v[-1][0], v[-1][1] + '"')
                string = not string

            if char.isspace() and not string:
                v.append((col, ""))
            else:
                if len(v) == 0:
                    v.append((col, char))
                else:
                    col, part = v[-1]
                    v[-1] = (col, part + char)

            if char != '\\' and quote:
                quote = False

        return [t_p for t_p in v if t_p[1] != ""]
1013857
private String[] splitIntoPlusMinusPatterns(AmountFormatContext amountFormatContext, String pattern) {
        DecimalFormatSymbols decimalFormatSymbols = amountFormatContext.get(DecimalFormatSymbols.class);
        char patternSeparator = decimalFormatSymbols != null ? decimalFormatSymbols.getPatternSeparator() : SUBPATTERN_BOUNDARY;
        return pattern.split(String.valueOf(patternSeparator));
    }
1022541
public static Tuple<String, String> split(String strColumn, String pattern, String valueName) {
        String name = "split_" + random();
        if (valueName == null) {
            return new Tuple(name, "def " + name + " = doc['" + strColumn + "'].value.split('" + pattern + "')" );
        } else {
            return new Tuple(name, strColumn + "; def " + name + " = " + valueName + ".split('" + pattern + "')");
        }

    }
734736
def split(self, text):
        '''
        
        '''
        # nesting character -> count
        counters = {"'": False, '(': 0}

        def reverse(char):

            def wrapped():
                counters[char] = not counters[char]
            return wrapped

        def increase(char):

            def wrapped():
                counters[char] += 1
            return wrapped

        def decrease(char):

            def wrapped():
                counters[char] -= 1
            return wrapped

        def is_top_level():
            return all([not x for x in counters.values()])

        def fail():
            raise BadSyntax('Syntax error processing line: %s' %\
                            self._last_line)


        temp = ""
        # end of field flag indicates that we expect next character to be
        # either whitespace of split
        eof_flag = False

        def append_char(temp, char):
            if eof_flag:
                fail()
            temp += char
            return temp

        # dictionary char -> handler
        nesters = {"'": reverse("'"), "(": increase('('), ")": decrease('(')}
        # chars to split on
        split = (',', )
        # chars to swallow
        consume = (' ', '\n')

        result = list()

        self.log("spliting: %s", text)

        for char in text:
            if char in nesters:
                nesters[char]()
                temp = append_char(temp, char)
            elif not is_top_level():
                temp = append_char(temp, char)
            elif char in consume:
                if len(temp) > 0:
                    eof_flag = True
                continue
            elif char in split:
                result.append(temp)
                temp = ""
                eof_flag = False
            else:
                temp = append_char(temp, char)
        if len(temp) > 0:
            result.append(temp)

        if not is_top_level():
            fail()
        self.log('Split returns %r', result)
        return result
1205378
function split(str, separator) {
    separator = separator || '';
    if (_.isString(str)) {
        return str.split(separator);
    } else {
        return str;
    }
}
876997
public static String[] split(String string, char delimiter) {
        int delimeterCount = 0;
        int start = 0;
        int end;
        while ((end = string.indexOf(delimiter, start)) != -1) {
            delimeterCount++;
            start = end + 1;
        }

        String[] result = new String[delimeterCount + 1];
        start = 0;
        for (int i = 0; i < delimeterCount; i++) {
            end = string.indexOf(delimiter, start);
            result[i] = string.substring(start, end);
            start = end + 1;
        }
        result[delimeterCount] = string.substring(start, string.length());
        return result;
    }
1053271
function splitter(target, splitExp) {
		var mw = core.base();
		mw.enabled = true;
		mw.splitExp = (splitExp || /\r?\n/g);
		mw.target = target;
		mw.writeln = function (str) {
			if (mw.enabled) {
				str = String(str);
				var start = 0;
				var match;

				mw.splitExp.lastIndex = 0;
				while ((match = mw.splitExp.exec(str))) {
					var line = str.substring(start, match.index);
					start = match.index + match[0].length;
					mw.splitExp.lastIndex = start;
					mw.target.writeln(line);
				}
				// append piece after final linebreak (or final blank line)
				if (start < str.length || start === str.length) {
					mw.target.writeln(str.substr(start));
				}
			}
		};
		mw.toString = function () {
			return '<miniwrite-splitter>';
		};
		return mw;
	}
376258
public static Iterable<String> split(String separator, String stringToSplit) {

    String[] StringArray = stringToSplit.split(separator);

    Iterable<String> iterable = Arrays.asList(StringArray);

    return iterable;
  }
997634
def multi_split(s, split):
    # type: (S, Iterable[S]) -> List[S]
    """"""
    for r in split:
        s = s.replace(r, "|")
    return [i for i in s.split("|") if len(i) > 0]