|< 1 2 >| | 14 Einträge, 2 Seiten |
my $s = "bla bla and table.column like 'inhalt' and bla bla bla";
my $s = "bla bla and table.column like 'in''ha''lt' and bla bla bla";
1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use warnings;
my $a = "bla bla and table.column like 'inhalt' and bla bla bla";
my $b = "bla bla and table.column like 'in''ha''lt' and bla bla bla";
my @a = $a =~ /^(.*?)([\w.]*) like ('.*')(.*)$/;
print join("\n", @a), "\n";
print "-------------------------------------------\n";
my @b = $b =~ /^(.*?)([\w.]*) like ('.*')(.*)$/;
print join("\n", @b), "\n";
/^(.*?)([\w.]*) like ('.*')(\s*and.*)$/
@a = $a =~ /^(.+? and )(\w+\.\w+) like ('.*?')( and .*)$/;
/^(.*?)([\w.]*) like ('.*')(\s*and.*)$/
QuoteCode: (dl )/^(.*?)([\w.]*) like ('.*')(\s*and.*)$/
some.col = 4 and my.col like 'a''b''c' and another.col = 'xy' and a.b = 3
some.col like 'ab'' cd.ef like ' and my.col like 'xyz'
@a = $a =~ /^(.+? and )(\w+\.\w+) like ('.*?')( and .*)?$/;
@a = $a =~ /^(.+? and )?(\w+\.\w+) like ('.*?')( and .*)?$/;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use strict;
use warnings 'all';
my $a = "my.col like 'xyz'";
# oder "irgendwas and table.column like 'irgendwas' and irgendwas"
# oder "table.column like 'irgendwas' and irgendwas"
# oder "irgendwas and table.column like 'irgendwas'"
@a = $a =~ /^(.+? and )?(\w+\.\w+) like ('.*?')( and .*)?$/;
for (1..@a)
{
print "$_: ". ($a[$_-1] or "(undef)") ."\n";
}
/^(.*?)([\w.]+) like ('(?:''|[^'])*')(.*)$/
|< 1 2 >| | 14 Einträge, 2 Seiten |