regex - JAVA: replaceAll reg pattern -


considering following string:

string s = "/static/201105-3805-somerandom/images/optional-folder/filename.gif"; 

how can remove "static/201105-3805-somerandom/" part? "201105-3805-somerandom" part random composed of: - 6 digits - "-" char - {1, n} digit chars - "-" char - {1, n} digit , letter chars

if use "/static/[0-9]*-[0-9]*-*/";, replaces last / instead of 1 after "{1, n} digit , letter chars", missing?

s = s.replaceall("^/static/\\d{6}-\\d{1,}-.*?/","") 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -