mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

15K
active users

David Bureš

Are there any macOS Shortcut experts?

I’m trying to do a REGEX replace, to replace decimal commas in a CSV with periods. I have this REGEX in the replace action:

(?<=[0-9]+),(?=[0-9]+)

I have set the action to be case insensitive

Here’s the shortcut: icloud.com/shortcuts/6f9acd95a

In VSCode, it correctly finds the occurrences, but the Shortcut action doesn’t do anything

Anyone knows what’s up? 🤔

www.icloud.comShortcuts

@davidbures Try
(?<=[0-9]),(?=[0-9])
or
(?<=\d),(?=\d)
because using + or * is not allowed in lookbehind in Shortcuts. And it works the same without the +’s anyway

@gluebyte Thank you, `(?<=\d),(?=\d)` worked. I wish there was documentation about what the REGEX engine supports.

@davidbures if I had to make a wild guess, I’d guess the shortcuts regex engine may not support look-behind assertions. Maybe try switching to a capturing group and replace both numbers (before and after) instead of trying to replace just the punctuation?

@gregatron5 It was a problem with the REGEX engine; I changed it to `(?<=\d),(?=\d)` and it worked.