nikolay has asked for the wisdom of the Perl Monks concerning the following question:
$z='Web-developer, perl-program, explicit-element, function-call, 2-x +speed.'; print "|$z|\n---\n"; $vrm='(?^ui:(\W)([^(\d|web)]+)-([^(proramm|call)]+)) "1>$1<3>$3< 2> +$2<"'; @bz=split "\t", $vrm; for( $i=0; $i<$#bz; $i+=2 ){ while( $z=~s#$bz[$i]#$bz[$i+1]#g ){ print "|$z|\n"; # <STDIN>; } }
i want that each part in the 2-word combination, except 'explicit-element', will remain the same, and only 'explicit-element' be turned to 'element explicit' -- because their parts are listed in lists: 'Web-developer' remains the same because its first part 'Web' is in the regular expression, before the sign '-', same for '2-x', whereas 'perl-program' and 'function-call' second parts ('program' and 'call') are listed in the regular expression after sign '-'.
So, what to do in PERL w/ the exception list for words? Thank you for any advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RegExp: words exceptions list similar to characters' one.
by Athanasius (Cardinal) on Jun 29, 2016 at 07:37 UTC | |
by AnomalousMonk (Archbishop) on Jun 29, 2016 at 18:12 UTC | |
by Anonymous Monk on Jun 29, 2016 at 19:38 UTC | |
|
Re: RegExp: words excepstions list similar to characters' one.
by AnomalousMonk (Archbishop) on Jun 29, 2016 at 20:35 UTC | |
|
Re: RegExp: words excepstions list similar to characters' one.
by Anonymous Monk on Jun 29, 2016 at 08:37 UTC | |
by nikolay (Beadle) on Sep 14, 2016 at 09:04 UTC |