--- TWiki/Render.pm~ 2004-09-19 18:57:23.000000000 +0200 +++ TWiki/Render.pm 2004-10-09 21:39:25.000000000 +0200 @@ -483,7 +483,7 @@ { my( $anchorName, $compatibilityMode ) = @_; - if ( ! $compatibilityMode && $anchorName =~ /^$regex{anchorRegex}$/ ) { + if ( ! $compatibilityMode && $anchorName =~ /^$regex{anchorRegex}$/o ) { # accept, already valid -- just remove leading # return substr($anchorName, 1); } @@ -500,7 +500,7 @@ $anchorName =~ s/^(.+?)\s*$regex{headerPatternNoTOC}.*/$1/o; # filter TOC excludes if not at beginning $anchorName =~ s/$regex{headerPatternNoTOC}//o; # filter '!!', '%NOTOC%' # FIXME: More efficient to match with '+' on next line: - $anchorName =~ s/$regex{singleMixedNonAlphaNumRegex}/_/g; # only allowed chars + $anchorName =~ s/$regex{singleMixedNonAlphaNumRegex}/_/go; # only allowed chars $anchorName =~ s/__+/_/g; # remove excessive '_' if ( !$compatibilityMode ) { $anchorName =~ s/^[\s\#\_]*//; # no leading space nor '#', '_' @@ -681,7 +681,7 @@ $theLink =~ s/^\s*//; $theLink =~ s/\s*$//; - if( $theLink =~ /^$regex{linkProtocolPattern}\:/ ) { + if( $theLink =~ /^$regex{linkProtocolPattern}\:/o ) { # External link: add before WikiWord and ABBREV # inside link text, to prevent double links @@ -691,14 +691,14 @@ } else { # Internal link: get any 'Web.' prefix, or use current web - $theLink =~ s/^($regex{webNameRegex}|$regex{defaultWebNameRegex})\.//; + $theLink =~ s/^($regex{webNameRegex}|$regex{defaultWebNameRegex})\.//o; my $web = $1 || $theWeb; (my $baz = "foo") =~ s/foo//; # reset $1, defensive coding # Extract '#anchor' # FIXME and NOTE: Had '-' as valid anchor character, removed # $theLink =~ s/(\#[a-zA-Z_0-9\-]*$)//; - $theLink =~ s/($regex{anchorRegex}$)//; + $theLink =~ s/($regex{anchorRegex}$)//o; my $anchor = $1 || ""; # Get the topic name @@ -1032,7 +1032,7 @@ } # '#WikiName' anchors - s/^(\#)($regex{wikiWordRegex})/ '<\/a>'/ge; + s/^(\#)($regex{wikiWordRegex})/ '<\/a>'/geo; # enclose in white space for the regex that follow s/(.*)/\n$1\n/;