View difference between Paste ID: 2rSyyYJt and yWrLRFd6
SHOW: | | - or go back to the newest paste.
1
$txt_original="Arkarmit ithaaatokkk ide? aaaztamindenit. tokkkal-vonoval";
2
$txt_replaced=$txt_original;
3
# megkeressuk a szukseges mintat
4
$txt_replaced =~ /aaa(\w{5})/;
5-
$txt_replaced =~ s/aaa(\w{5})/aaa12345/g;
5+
6
$text_to_replace=$1;
7
$txt_replaced =~ s/$text_to_replace/12345/g;
8
9
print("To replace: ${text_to_replace}\n");
10
print("Original: ${txt_original}\n");
11
print("Replaced: ${txt_replaced}\n");
12
13
# output:
14
# To replace: tokkk
15
# Original: Arkarmit ithaaatokkk ide? aaaztamindenit. tokkkal-vonoval
16
# Replaced: Arkarmit ithaaa12345 ide? aaa12345ndenit. tokkkal-vonoval