Having an issue with strings. I have a long string like this:
"Other title of some text here name of file Date: 01/01/2011 Picture ID: UYT-2011-01 Company My company"
What I need to do is extract just the picture id , the UYT-2011-01 part. The text before and after is not a set size, could be an entire paragraph, the text after can be any length, and in fact the Picture ID itself could be anywhere from 15-20 characters long.
For my purposes, I want to extract the 15 characters in the string after the Picture ID:.
I am using Selenium IDE, so it would need to be a javascript or regexp method.
Assuming your picture IDs don’t have spaces in them, and will always have a space after them, this regex solution should work in JavaScript:
Matching like this means that the picture ID can be any length, as long as it is delimited by space characters.