This should work if you just need to extract the number at the beginning of the string (i.e. it's not multiple items).
^[0-9]+
Hi Mark,
thanks for your reply. It is possible to choose multiple items. I get a string like "95;#Title1;#96;#title2". The best for me would be to have 2 collections, collection1 with the IDs and collection2 with the corresponding titles at the same position. Is there any way to accomplish this?
Thanks a lot.
Patrick
Hmmm, that's a bit trickier because the titles themselves could contain numbers, making it harder to identify them with a RegEx.
I'd try the following:
- RegEx to split the string by ;#. This would go into a collection variable, with the values alternating between IDs and titles.
- Loop through the collection, using a number variable as an index.
- For each item check whether the index number is odd or even (using a mod maths action).
- If odd, add the item to your ID collection. If even, add the item to your title collection.
I haven't tested this, but I think it would work, though there may be a more efficient method.
Hi Mark,
thanks again for your efforts. I now solved it by a workflow on item-creation that builds a string of Title_ID and following workflows compare with this definitely unique string. It's not the best way, because people now have to choose their items with that "_ID"-Suffix, but it works perfectly. Next time when i come across a similar problem, i will try your suggestion, sounds like it will work.
Cheers