如何使用正则表达式替换NetBeans中的文本?

How can I replace text in NetBeans using regular expressions?

For instance,

I want to replace these texts below,

$item->article_id
$item->title
$item->content
...

with

$item['article_id']
$item['title']
$item['content']
...

I tried with this below in the input field of 'Containing Text:'

$item->(.*)

But no match found.

Any ideas?

If you write special characters, like $ sign in the Find what input, you must escape it with \ (backslash). But you don't need replace the $ sign with another $ sign.

In Find what:

item->(.*)

In Replace with:

item['$1'];

Then press replace all. That's all.

You can try this to match the content.

item->([a-z]*...)

Use this

item->([a-z]*)

or

item->(.*)