About this question
I want to use the below regex string: private final String regex = '^.*s(d+)s.*$'; In a Pattern: private Pattern pattern = Pattern.compile(regex); But I am getting this error: Illegal string literal: Invalid string literal '^.s(d+)s.$'. Illegal character sequence s' in string literal. What do I need to do to fix this? Top keywords - *