Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $txt_original="Arkarmit ithaaatokkk ide? aaaztamindenit. tokkkal-vonoval";
- $txt_replaced=$txt_original;
- # megkeressuk a szukseges mintat
- $txt_replaced =~ s/aaa(\w{5})/aaa12345/g;
- # Ami a $1-be kerul. Onnan atmentjuk $text_to_replace -be
- $text_to_replace=$1;
- $txt_replaced =~ s/$text_to_replace/12345/g;
- print("Original: ${txt_original}\n");
- print("Replaced: ${txt_replaced}\n");
- # output:
- # Original: Arkarmit ithaaatokkk ide? aaaztamindenit. tokkkal-vonoval
- # Replaced: Arkarmit ithaaa12345 ide? aaa12345ndenit. tokkkal-vonoval
Advertisement
Add Comment
Please, Sign In to add comment