#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; print m/\d(?:(?:\d| (?!\d))){19}/ ? "$_ matches\n" : "$_ does not match\n"; } __DATA__ "01234567890123456789" "123" "123 123 " "123c " " " "11232424525252423 "
enlil
In reply to Re: Regex to match 20 chars of some digits followed by some spaces
by Enlil
in thread Regex to match 20 chars of some digits followed by some spaces
by leriksen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |