Anti-Fun
Anti-Fun

Reputation: 15

Regex How to find exact word between " and /

So I build the regex below that does it job well.

"item_name\/": \/"[a-zA-Z1-9 ]{1,}\/ 

This will successfully find all text below:

"item_name/": /"Legendary Frost Armor/
"item_name/": /"Branch/
"item_name/": /"Tier 5 Legendary Stick/
"item_name/": /"Potato/
"item_name/": /"Seaweed/
"item_name/": /"Mage Legendary Rune/

However, I only interested in selecting those that contain Legendary so it should end up like this:

"item_name/": /"Legendary Frost Armor/
"item_name/": /"Tier 5 Legendary Stick/
"item_name/": /"Mage Legendary Rune/

Do note that they are not separated by line.

Upvotes: 0

Views: 36

Answers (1)

Saqib Ali
Saqib Ali

Reputation: 12585

"item_name\/": \/"[a-zA-Z1-9 ]*Legendary[a-zA-Z1-9 ]*\/ 

Upvotes: 1

Related Questions