in reply to [CLOSED] RegExp: words excepstions list similar to characters' one.
#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1166843 use strict; use warnings; my $z = 'Web-developer, perl-program, explicit-element, function-call, + 2-x speed.'; print $z; $z =~ s/\b (?!(?:web|2)-) (\w+)- (?!(?:program|call)\b) (\w+)\b /$2 $1/gix; print $z;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RegExp: words excepstions list similar to characters' one.
by nikolay (Beadle) on Sep 14, 2016 at 09:04 UTC |