Enabling multiline search with pcre:yes
Stay organized with collections
Save and categorize content based on your preferences.
You can also search using the
PCRE subset supported by RE2
by adding pcre:yes
to your search. When you use pcre:yes
, the entire
search expression is treated as a perl-compatible regular expression.
This is particularly useful when you want to do a search across line breaks.
A search for {\s+generate_java pcre:yes
finds
mojom("mojom") {
generate_java = true
while the search {\s+generate_java
will not because {
is not on the same line as generate_java
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-03 UTC."],[[["Searching with `pcre:yes` enables the use of Perl-compatible regular expressions (PCRE) supported by RE2, allowing for more complex search patterns."],["PCRE searches are particularly useful for finding patterns across line breaks, which standard searches may not capture."],["For example, using `pcre:yes` enables searches like `{\\s+generate_java` to find instances where the opening bracket and `generate_java` are on separate lines."]]],[]]