I'm trying to fill a parametric field defined as SET datatype from HTML Meta tag containing multiple values via the 'Data from Field' option
As an added difficulty, the values i have to extract contain ','.
I have figured out a REX that works and returns the correct set members, but i haven't figured a way to tell to put that result into the parametric field as separate set members
Ex.:
<meta name="m1" content="item1=a,b,item2=c">
The retrieved set should be : ('a,b','c') i.e. two items.
In the replace part i have tried the following syntaxes but i always end up with one set member :
!!\2,!!\5!! ==> ('!!a,b!!,c!!')
I expected this one to work or berhaps give me 3 set members
I tried the followin as well just in case
!!\2|!!\5!! ==> ('!!a,b!!|c!!')
!!\2 !!\5!! ==> ('!!a,b!! c!!')
You don't need a replace expression; you can make a search expression that just returns what is needed:
>>item=\digit+\=\P=!,item+'
i.e. look for everything after an `itemN=' tag, up to (but not including) the next `,item' tag (if any). This assumes no space separation in the list (remove the comma if so, or use a replace expression to remove trailing space/commas).
I modified your rex a little bit to get at the "itemN" parts : >>item=[A-Z\-]+[a-zA-Z0-9\-]+\=\F=!, item+
Given the same example : <meta name="m1" content="itemToto=a,b, itemMachin=c">
It works fine with a field of type SET where i get a set of (itemToto,itemMachin)
but with a field of type TEXT, i only get the first 'item' ie. 'itemToto'
I could not figure out one that gives me all of them
Can you help a bit more?
How would i get "item1,item2,...,itemN" into a parametric field of type TEXT
There isn't a way to pull multiple items out and string them back together.
The data from field should work with the DataLoad if you specify "RawData" to be parsed. If you give it Body instead then it is assumed to be pre-parsed and you are providing all the fields as you want them.