Java regex expression to match at least one of Scandinavian alphabets -


i want evaluate text if contains @ least 1 scandinavian alphabet , ok no whitespace or more that. did wrong? tested string:

string nor = " d f ø ø å æ ";   if(s.matches("[a-za-zæøåÆØÅ]+[\\s]*")) 

matcher#matches matches whole string. therefore regular expression should match entire string. can use .* prefix match characters outside character classes:

if (s.matches(".*[a-za-zæøåÆØÅ]+[\\s]*") {    // functionality related scandinavian expression } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -