Skip to content

perlop: clarify \U, \L, \F behaviour #19999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pod/perlop.pod
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,9 @@ X<\l> X<\u> X<\L> X<\U> X<\E> X<\Q> X<\F>

\l lowercase next character only
\u titlecase (not uppercase!) next character only
\L lowercase all characters till \E or end of string
\U uppercase all characters till \E or end of string
\F foldcase all characters till \E or end of string
\L lowercase all characters till \U, \F, \E or end of string
\U uppercase all characters till \L, \F, \E or end of string
\F foldcase all characters till \U, \L, \E or end of string
\Q quote (disable) pattern metacharacters till \E or
end of string
\E end either case modification or quoted section
Expand Down
5 changes: 4 additions & 1 deletion t/op/lc.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BEGIN {

use feature qw( fc );

plan tests => 139 + 2 * (5 * 256) + 17;
plan tests => 139 + 2 + 2 * (5 * 256) + 17;

is(lc(undef), "", "lc(undef) is ''");
is(lcfirst(undef), "", "lcfirst(undef) is ''");
Expand Down Expand Up @@ -72,6 +72,9 @@ is(uc($b) , "HELLO\.\* WORLD", 'uc');
is(lc($b) , "hello\.\* world", 'lc');
is(fc($b) , "hello\.\* world", 'fc');

is("\L$a\U$b", 'hello.* worldHELLO.* WORLD', '\L$a\U$b');
is("\U$a\L$b", 'HELLO.* WORLDhello.* world', '\U$a\L$b');

# \x{100} is LATIN CAPITAL LETTER A WITH MACRON; its bijective lowercase is
# \x{101}, LATIN SMALL LETTER A WITH MACRON.
# Which is also its foldcase.
Expand Down