-6

I am trying do that but it keeps give me error invalid escape format. I was trying to remove some backslash but didn't work

private string chars = "(lP+" (\\w+)/\\d{3} \\d+ \\w+ \\S+\\s?\"?($|-|[\\w\\\\\.@]+)\"?")";
user3438838
  • 476
  • 1
  • 5
  • 10

2 Answers2

6
  • String should have a capital 'S'
  • You've missed esacaping a couple of the quotation marks.
  • You have a run of five backslashes, which should either be 4 or 6.

You probably want something like this instead...

private String chars = "(lP+\" (\\w+)/\\d{3} \\d+ \\w+ \\S+\\s?\"?($|-|[\\w\\\\\\.@]+)\"?\")";
Phil Anderson
  • 3,146
  • 13
  • 24
0
private String chars = "(lP+\" (\\w+)/\\d{3} \\d+ \\w+ \\S+\\s?\"?(\\$|-|[\\w\\\\.@]+)\"?\")";
Roel Strolenberg
  • 2,922
  • 1
  • 15
  • 29