#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.

"""
stringio.py

Provides subroutines to extract numbers from string
"""
import sys, os, time
import numpy as np
import matplotlib.pyplot as plt
import logging
import re


#logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


numRe = re.compile(r"[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?")


def getNumber(string, mapfun=None):
    """Parse all numbers from a string"""
    if mapfun is None:
        return numRe.findall(string)
    else:
        return map(mapfun, numRe.findall(string))

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.

"""
stringio.py

Provides subroutines to extract numbers from string
"""
import sys, os, time
import numpy as np
import matplotlib.pyplot as plt
import logging
import re


#logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


numRe = re.compile(r"[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?")


def getNumber(string, mapfun=None):
    """Parse all numbers from a string"""
    if mapfun is None:
        return numRe.findall(string)
    else:
        return map(mapfun, numRe.findall(string))

#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2018 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. stringio.py  Provides subroutines to extract numbers from string #logging.basicConfig(level=logging.INFO) Parse all numbers from a string