Regex replace pattern - advanced find plugin for Gedit
Asked Answered
L

2

5

I'm trying to replace all instances of

$offer->variablenames

with

$offer['variablenames']

Is this possible? I'm using advanced find plugin for gedit.

It's just heiroglyphs to me... Would very much appreciate help.
Thanks

Lagerkvist answered 16/2, 2012 at 17:28 Comment(0)
P
13

Find what:

\$offer\-\>([a-zA-Z0-9_]*)

Replace with:

$offer['\1']

Make sure to have Regular expression checkbox checked.

Parcae answered 23/2, 2012 at 18:36 Comment(1)
It's strange, some other app using $1 instead of \1. Thank you!Dilapidate
H
1

I'm not sure what advanced find plugin syntax is. In vim I would use s/$offer->\(.*\)/$offer['\1']/g

Haemoid answered 16/2, 2012 at 17:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.