0

I have the following piece of regex which works in an online regex tester:

  assetName">([^"]+)</span>

I want to use this in a Beanshell Script like this:

  Pattern p = Pattern.compile("assetName">([^"]+)</span>");

How do I handle the double quotes here? Thanks

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
ratsstack
  • 1,012
  • 4
  • 13
  • 32

1 Answers1

5

As in Java, just use a slash in front of the double quotation mark:

Pattern p = Pattern.compile("assetName\">([^\"]+)</span>");
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563