Filter on UUID
Hi!
I have an array of keys, some of which are UUID's, others some other type (ex.: md5).
What would be the best method to filter out / retain only the UUID's in that array?
Thank you
Best Answer
-
It's weird…for some reason, my comment got erased. Here we go again !
Did you try the UUID regexp ?
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/Results
Note : You MUST store your regexp in a variable. including the regexp directly in the condition's input doesn't seem to work.
Hope it helps!
Answers
-
I've found a temporary workaround (not solution):
Array, find all elements, length=36
However, this is not the cleanest/best way to do it.
Any better ideas?
-
Did you try using the UUID regexp pattern ?
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/Result
my_array :
Note : You MUST store your regexp expression in a variable. Using directly in the condition won't work.
Hope it helps!
-
Thank you @MattLaro , this worked perfectly!🙌
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback