title: escape " regexp in dart
body: <p>I'm trying to catch symbols in a dart Regexp. My regexp looks like this: </p>
  
  <pre><code>  RegExp containsSymbolRegExp = RegExp(r"[-!$%^&amp;*()_+|~=`{}\[\]:;'&lt;&gt;?,.\/]");
  </code></pre>
  
  <p>However, I also need to make it catch the symbol "
  I can't stick " in there though, since it messes with the string. Any ideas how to do this?
  Thanks.</p>
  
  <p>edit: jamesdlin's answer works great for dart. But it doesn't work for my flutter app, so I'm thinking it has something to do with flutter. Here's the code I'm applying this to:</p>
  
  <pre><code>TextEditingController _passwordController = TextEditingController();
  bool containsSymbol;
  
  RegExp containsSymbolRegExp = RegExp(r"[-!$%^&amp;*()_+|~=`{}#@\[\]:;'&lt;&gt;?,.\/"
        '"'
        "]");
  
  void _handleChange(text) {
      setState(() {
          containsSymbol = containsSymbolRegExp.hasMatch(_passwordController.text);
      });
      print(containsSymbol); // always prints false for " ' \ but works for all other symbols
    }
  
  Widget _textField(controller, labelText) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: &lt;Widget&gt;[
        Text(labelText, style: TextStyle(fontSize: 11)),
        Container(
          width: MediaQuery.of(context).size.width * 0.9,
          height: 35,
          child: TextField(
            onChanged: _handleChange,
            style: TextStyle(fontSize: 20),
            keyboardType: TextInputType.text,
            controller: _passwordController,
            cursorColor: Colors.grey,
            decoration: InputDecoration(
                focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.grey))),
          ),
        ),
      ],
    );
  }
  </code></pre>