Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Extract String parts Via Regex

 I have the following data in one cell. (The length of the data varies not a fixed width format)

Measurement: Ring Head Width: 6.8 Ring Height: 5.5 Ring Shank Width: 1.1 Band Width: 2.5

I want to extract part of the above string.
Ring Head Width: 6.8


I am using the function "Extract string parts" with the following regex code to extract to the new column.
\bRing Head Width: (\d+(\.\d+)?)

I have also tried.
Ring Head Width: (\d+(\.\d+)?)

But when I Submit to execute it a new column gets created but it has no data matching the regex ?

What am I doing wrong. I tried to look for examples in help documentation but could not find any.
Any help is appreciated.
Labels (2)
1 Reply
Anonymous
Not applicable

Hi,

This one should do the trick:

: ([a-zA-Z ]*: \d\.\d)


A quick explanation. What you want to capture is after the first occurence of ": " and is compound by the following elements, in that order:
[list=1]
  • A mix of uppercase, lowercase and spaces.

  • A colon

  • A space

  • A digit

  • A dot

  • A digit

  • 0683p000009MFyW.png

    Regards,

    Gwendal