drls
1
var text = ‘tt-text-tt’;
var key = /(?<=tt-).*(?=-tt)/g;
var output = text.match(key);
I can run it in any javascript enviorment but got failure warning with Drafts5.
Looking forward to your help.
Thx.
- Remember to put your code in code blocks to stop the forum formatting it.
- That code does not work in Scriptable either same error.
- Pretty sure the JavaScript engine used on i*OS doesn’t support the assertions you are trying to use.
https://stackoverflow.com/questions/64410005/equivalent-regex-unsupported-lookbehind-assertion-ios-safari
drls
3
Thank you so much!
I am going to try other ways.
Non-capturing groups could accomplish what you need, something like:
(?:tt-)(.*)(?=-tt)
drls
5
That’s what I did. Thank you very much! It works.