Regular Expressions

Options
I would like to be able to loop through an array, and if the array contains certain characters I want to replace them. The string is complex, like a JWT, but it will always be started with the same 6 characters. Is there any way in Xano to match using regex? This is pretty much the only option  I can currently think of- since the information is coming in an array and therefore is a string, I can't use object keys to sort and replace. 

I have searched the docs, the old forum and the current community but to no avail.

Thanks in advance!

Comments

  • Kiran Marshall
    Options
    Actually I have found this - there's a version of regex matching under Data Manipulation > Text > Contains (there are other options here also). It has done what I need it to do. 

    If I may - to the developers of Xano - your tool is undoubtedly what no code should strive to look like and it's fantastically powerful, but the naming of stuff can be confusing at times for those of us coming from a background where we are familiar with writing code and the terms we would expect to find things under. This regex thing, for example, and the 'filters' under the input section handling data - these are more conditionals in my mind. I can see what you're going for but it can be a bit unintuitive at times. I hope this feedback is useful for you.

    In any case, having genuine regex capability would be fantastic, and there's definitely a good chance for community developed patterns to be used by many. 
  • Daniel Rjeili
    Options
    Hi Kiran, also you have a function named "split" ... if you take an string and split it returns and array of each character of the string and as a array you can do a "for each loop" and check one by one and do another custom logic.... 
    about "having genuine regex capability would be fantastic", I agree, so far you can call api or webhook... to "outside" run some code like regex and take the response as you wish, but whats is amazing is that xano team day-by-day releases new features and functions that provide good and/or perfect solutions for our need like your case above. 
  • Regex would be essential. Any news about the possibility of using a filter with regex?  
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     we definitely are going to be adding regular expression support. To both the query engine and the filters. I don't have an exact date but it is definitely in queue.
  •  Perfect. Keep us informed when this happens.
  • wtzr
    wtzr Member
    Options
     also interested in Regexp for text. Currently trying to replace specific TXT. Regexp would make things far more easier. 
  • mohan ramanujam
    Options
     can you provide some examples of how to use regex in DB all query?