#!/usr/bin/perl
#
# test.pl
#
# Developed by Lubomir Host 'rajo' <rajo AT platon.sk>
# Copyright (c) 2004 Platon SDG, http://platon.sk/
# Licensed under terms of GNU General Public License.
# All rights reserved.
#
# Changelog:
# 2004-10-14 - created
#
# $Platon$
use strict;
$| = 1;
$\ = "\n";
my @strings = (
qw!
asdfadf
1341234E45
134.1234
NULL
null
''
'xxxxxxx'asdfad
'xx\\xxx'asdfad
'\\'asdfad
'\\\\'asdfad
'\\\\\\'asdfad
'\\\\\\\\'asdfad
'xxx\\\\\\'yyyy'asdfad
'xxx\\\\\\\'yyyy'asdfad
'xxx\\\\\\\\'yyyy'asdfad
'xxx\\\\\\\\\'yyyy'asdfad
!
);
foreach my $str (@strings) {
#while (my $str = <STDIN>) {
chomp $str;
# OK: if ($str =~ m/([^']+|'(?:[^'\\]*(?:\\.)*(?:\\\\)*)*')/) {
if ($str =~ m/([^']+|'(?:[^'\\]|(?:\\.)|(?:\\\\))*')/) {
print "MATCH str = \"$str\"\t$1";
}
else {
print "----- str = \"$str\"";
}
}
# vim: ts=4
# vim600: fdm=marker fdl=0 fdc=3
Platon Group <platon@platon.org> http://platon.org/
|