Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

sorry for the bad explanation, i try to explain it better
the following regex will produce this

s/(?<=\d{2})0*(?<=\d{4})0+// output 215000007801 -> 2157801 300000324002 -> 30324002 890000457651 -> 89457651 210004563401 -> 214563401 201045139158 -> 201045139158

these 2 outputs are wrong
201045139158 -> 201045139158
215000007801 -> 2157801
shoud be
215000007801 -> 21507801
201045139158 -> 20145139158

now i try to explain the rule better,counting starts at 0
the 0 , 1 digits shoud be untouched
if the 2 digit is a 0 and the next digit is a 0 remove all 0 untill first non 0
if the 2 digit a 0 and the next is a non 0 remove the 0
if the 3 digit is a 0 and follows by a 0 then remove all 0 except the 0 at 3 digit
if the 3 digit is a 0 and the next digit is a non 0 remove only the 0
if the 4 digit is a 0 remove it and all following 0 untill non 0

i hope that makes it a bit clearer, i know its kinda confusing

kd ultibuzz

i will test the help u all already given tomorrow at office,thx alot

In reply to Re: Stuck in komplexer regex, at least for me by ultibuzz
in thread Stuck in komplexer regex, at least for me by ultibuzz

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (5)
    As of 2018-12-14 19:32 GMT
    Find Nodes?
      Voting Booth?
      How many stories does it take before you've heard them all?

      Results (69 votes). Check out past polls.