in reply to Re^2: Regex Help
in thread Regex Help

Replace \D? with a more explicit character class. \D will match anything that is not a numeric digit. Newlines (\n) are included in "anything that is not a numeric digit".


Dave

Replies are listed 'Best First'.
Re^4: Regex Help
by gautamparimoo (Beadle) on Mar 25, 2013 at 09:29 UTC

    Exactly what i was trying to say.. How to do tell it to \D except \n ?

        I may be misunderstanding the specification, but I believe he wants to include non-digits but exclude newlines. I think the easiest way is [^\d\n], but I would prefer to explicitly include what is allowed. He mentioned in his OP the following separators: .-:. That being the case, the character class would be [.:-].


        Dave