Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. AWS
  3. Question
AWS

Invalid string literal '^.*\s(\d+)\s.*$'. Illegal character sequence \s' in string literal [duplicate]

Asked by Felica Laplaca Apr 24, 2021 1.5K views 1 answer
Share

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 - *

Your answer

1 Answer

More AWS discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest AWS Blogs

Guides, tips and career advice on AWS from JanBask experts.