views:

18

answers:

2

I am trying to make a global search/replace in Eclipse.

I have lines as follow:

<MED:Student id=
<MED:Course id=
<MED:Marks id=
<MED:Attendance id=

Now I need to insert a VAL so it would become:

<MED:Student VAL id=
<MED:Course VAL id=
<MED:Marks VAL id=
<MED:Attendance VAL id=

What would be the proper regular expression that would cover all cases for this kind of search, the part that is always the same is the <MED: and the id=.

Thank you all for your time. All help is appreciated.

+2  A: 

Find:

^(<MED:\w+)\s+(id=)

Replace with:

$1 VAL $2
BoltClock
+1  A: 
Find: (<MED:\w+\s+)(id=)

Replace with: $1VAL $2
mdrg