Ok, the penny finally dropped for the  -sep=>','  -group=>3 stuff. Is this more like what you're after? (This still needs Perl version 5.10+.)

c:\@Work\Perl\monks\justrajdeep>perl -wMstrict -MRegexp::Common=number + -le "my $str = '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,1 +11'; ;; my $bin_int = qr{ $RE{num}{int} {-keep}{-sep=>','}{-group=>3}{-base= +>2} }xms; my $bin_real = qr{ $RE{num}{real}{-keep}{-sep=>','}{-group=>3}{-base= +>2} }xms; ;; my $binary = qr{ (?| $bin_int | $bin_real) }xms; ;; while ($str =~ m{ \b $binary \b }xmsg) { ;; my $entire = $1; my $fraction = $6; my $exponential = $8; my ($start, $end) = ($-[1], $+[1]); ;; my $type = (defined $exponential && length $exponential) ? 'exponen +tial' : (defined $fraction && length $fraction) ? 'real' + : 'integer' ; ;; print qq{matched $type}; my $ruler = (' ' x $start) . '^' . ('-' x ($end - $start - 2)) . '^ +'; print qq{'$str'}; print qq{ $ruler \n}; ;; } " matched integer '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,111' ^-^ matched integer '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,111' ^--------^ matched real '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,111' ^-----------------^ matched exponential '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,111' ^--------------^ matched integer '100,11,111,111,10,101,110.11010110,10,101,010.0E-01,123,111' ^-^
(The  'exponential' 'real' 'integer' type classification may be a bit wobbly. Perhaps an exercise for the reader?)


Give a man a fish:  <%-{-{-{-<


In reply to Re^3: Using Regexp::Common by AnomalousMonk
in thread Using Regexp::Common by justrajdeep

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.