Can Someone Help?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
BASHERS33
Posts: 1
Joined: Sun Jan 18, 2009 11:59 pm

Can Someone Help?

Post 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
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
Post Reply