regex to exctract informations

B

Bob

Dears,

I am trying to search and replace strings with regex.

The string is identified by a keyword :

IDImage("1M234567");
DescriptionImage("Desc of the Image 1");

I want to exctract the IDImage (1M234567 ) and the Description.

The ID are characters and numbers, the description too.

Thx,

Bertrand
 
C

Colin Gillespie

Bob said:
Dears,

I am trying to search and replace strings with regex.

The string is identified by a keyword :

IDImage("1M234567");
DescriptionImage("Desc of the Image 1");

I want to exctract the IDImage (1M234567 ) and the Description.

The ID are characters and numbers, the description too.

Thx,

Bertrand
If the string is always in IDImage("#####");

Then what about

x='IDImage("#####");'
print x[9:-3]

Likewise for the Description.

HTH

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,206
Latest member
EpifaniaMc

Latest Threads

Top