my string looks like this,

<place id="opt1"><data>data 1-data2 ! data3</data></place>

I'd like to remove space, -, ! from only data element (data 1-data2 ! data3) using regex. Rest of stuff should be as it is (<place id="opt1"><data></data></place>). Any idea?

Recommended Answers

All 3 Replies

Hi,

For your example I assume that you whatn to remove everything between <data></data> or the result would look like this
<place id="opt1"><data>data1data2data3</place> Am I right?.

Regards,
Camilo

yes sir

no result ???
I try

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.