def copy_segmentation(source, target, sep=' ', validate=True):
    """Copy the segmentation from a source string to the target string
    
    ```
    >> copy_segmentation('ab cde', '12345')
    '12 345'
    >> copy_segmentation('ab|cd|e', '12345', sep='|')
    '12|34|5'
    >> copy_segmentation('ab cd', '123456')
    ValueError: source and target should have the same number of (non-sep) characters
    ```
    """
    # Test input
    source_chars = source.replace(sep, "")
    if not len(source_chars) == len(target):
        raise ValueError('source and target should have the same number of (non-sep) characters')
    
    # Copy segmentation
    start = 0
    target_units = []
    source_units = source.split(sep)
    for i, source_unit in enumerate(source_units):
        target_unit = target[start:start+len(source_unit)]
        target_units.append(target_unit)
        start += len(source_unit)
    
    # Validate result
    if validate:
        assert "".join(target_units) == target
    return sep.join(target_units)