I'm looking in our code for something that looks very much like:
#$foo="bar";
$foo="baz";
Problems:
My initial attempt was ack /\$(.\*)=.\*$\$($1)=/
I prefer ack usually for code grepping, but I don't mind using grep either. JWZ probably thinks I have way more than 2 problems by now.
grep is a command line text searching utility that is able to find patterns and strings in files and other types of input. Most matches will match on one line only, but it's often useful to match across multiple new lines.
Let's break this command down: The -P option enables the PCRE add-on for grep. The -z option treats the matched text as a sequence of lines by adding the NUL character to each line's ending. The -o option enables grep to print only the matched text and ignore trailing spaces.
Neither grep nor ack will handle more than one line at a time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With