firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

Terraform Flavor #2059

Closed aRustyDev closed 1 year ago

aRustyDev commented 1 year ago

Flavor Request - Terraform

Terraform has a few regex related functions built in, but they are not entirely friendly with standard regex (like PCRE).

In general they conform to the standard, but they also introduce some confusion with the way that terraform has to process the inputs, and so far as I can tell they have very limited match replacement patterns (looks like only capture group $n referencing)

My Use Case

I have been trying to jerry-rig a solution to an issue with their yamlencode() function, which outputs yaml format but with every value treated as a string and wrapped with \". My goal has been to remove the \"'s from the Keys as well as selectively from the Values depending on if they are INT values or STR values. I have an issue submitted to TF right now trying to point out part of the issue. (https://github.com/hashicorp/terraform/issues/33167) but it would be nice if there was a flavor in Regex101 that could help either debug this quicker or could show the limitations of TF regex.