php - Remove all spaces after last character and before final dot -


i have rar files im using php extract contents, of files have space before extension , can't figure out how remove it.

example:

this file.name (testing) .rar 

i want remove space after ) , .rar don't want remove other 1 in file.name

is possible ?

you can use following regex match:

\s*(?=(?:\.[^.]+)?$) 

and replace '' (empty string)

see demo


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -