9 Einträge, 1 Seite |
1 2 3 4 5 6 7 8
$TMP = "asdf"; $search = 'command'; $string = '`command -option $TMP`'; $string =~ /(`$search([^`]*)`)/ ; $match = $1; print "erkannter String: $match \n"; print (($string =~ m/($match)/ ) ? "Regexp-Match: $1\n" : "kein Match\n");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /usr/bin/perl
use strict;
use warnings;
my $TMP = "asdf";
my $search = 'command';
my $string = '`command -option $TMP`';
$string =~ /(`$search([^`]*)`)/;
my $match = $1;
print "erkannter String: $match ";
print (($string =~ m/(\Q$match\E)/ ) ? "Regexp-Match: $match " : "kein Match ");
QuoteCompiling REx ``command -option $TMP`'
size 10 first at 1
1: EXACT <`command -option >(7)
7: EOL(8)
8: EXACT <TMP`>(10)
10: END(0)
9 Einträge, 1 Seite |