Page 1 of 1

Can Someone Help?

Posted: Mon Jan 19, 2009 12:05 am
by BASHERS33
Can someone please help me figure out how to replace all cases of:

Code: Select all

$this->something['word']
with

Code: Select all

$this->somethingelse('word')
where word is ANYTHING between the single quotes?

Someone made directions for doing it in another text editor. For that editor it worked, but that editor keeps freezing and apparently even gave me a virus. When I try the same expressions with textpade they don't work. They come up as having no results found.

Here is an example of what they have:
Search:

Code: Select all

 \$this->ipsclass->vars\[\'(.+?)\'\]
Replace:

Code: Select all

\$this->settings->getSetting('$1')
That does not work in textpad. What do I need to change?

Thanks

Posted: Mon Jan 19, 2009 8:13 am
by ben_josephs
Find what: \$this->something\['([^']+)'\]
Replace with: $this->somethingelse('\1')

[X] Regular expression

Replace All
For example,
Find what: \$this->ipsclass->vars\['([^']+)'\]
Replace with: $this->settings->getSetting('\1')

[X] Regular expression

Replace All
These assume you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
TextPad does not give you viruses.