in reply to Using Regexp::Common

Each refrence to Regexp::Common matches one field. You can use it as part of a more complicated regex. If you tell us exactly what matches you expect from your example, I believe we can help you code the regexp using Regexp::Common.
Bill

Replies are listed 'Best First'.
Re^2: Using Regexp::Common
by justrajdeep (Novice) on Sep 19, 2015 at 13:30 UTC

    Hi Bill

    I wanted to extract all the numbers from a string that may be separated by any delimiter. Then divide them into floats/integer etc. I thought Regexp::Common would be simple to use. But looks like it is not so :(

      I do not know what you mean by 'number' in your example. Is the period a decimal point or a separator? Do the commas separate numbers or do they separate fields within a number to make them easier to read? Are your numbers binary numbers or are they decimal numbers that just happen to consist of only ones and zeros? Do you want to parse the string more than once, using different criteria? Lets get you example working. We can generalize later. Please tell us exactly what results you expect from your single example.
      Bill

        Hi Bill

        in my requirement the example:

        10,101,110.11010110
        the numbers can be separated by , or space or tab or ; .

        . is a decimal and that particular number should be considered a float. I do not have any requirement to extract out the exponent and the mantissa part.