Ted
Ted

Reputation: 3885

Searching my code with regex

It happens all the time, I would need to scan my code for places where I have two or more of the same keywords. For example $json["VALID"] So, I would need to find json, and VALID.

Some places in the code may contain:

//    a = $json['VALID']; // (note the apostrophes)

(I am using EditPlus which is a great text editor, letting me use regex in my searches)

What would be the string in the regex to find json and VALID (in this example) ? Thanks in advance!

Upvotes: 0

Views: 86

Answers (2)

rauschen
rauschen

Reputation: 3996

wound find $json<2 character>VALID

\$json.{2}VALID

Upvotes: 4

Kirill Polishchuk
Kirill Polishchuk

Reputation: 56202

Use this regex:

\$json\[["']VALID['"]\]

Upvotes: 4

Related Questions