mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 01:43:57 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
19 lines
950 B
HTML
19 lines
950 B
HTML
<html>
|
|
<body>
|
|
Reports <code>\s</code> escape sequences anywhere except at text-block line endings or within a series of several escaped spaces.
|
|
Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression.
|
|
The <code>\s</code> escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed.
|
|
In other locations, as well as in regular string or char literals, <code>\s</code> is identical to an ordinary space character (<code>" "</code>).
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
if (str.matches("\s+")) {...}
|
|
</code></pre>
|
|
Here it's likely that <code>"\\s+"</code> was intended (to match any whitespace character). If not, using <code>str.matches(" +")</code>
|
|
would be less confusing.
|
|
<p>
|
|
A quick-fix is provided that replaces <code>\s</code> escapes with space characters.
|
|
</p>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2022.3</small></p>
|
|
</body>
|
|
</html> |