Regex replace pattern - advanced find plugin for Gedit

Andreas Larsson picture Andreas Larsson · Feb 16, 2012 · Viewed 9.9k times · Source

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

Answer

Alex picture Alex · Feb 23, 2012

Find what:

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

Replace with:

$offer['\1']

Make sure to have Regular expression checkbox checked.