Using Regex() function, how do I match the end of the string?

francisbarton
Tue, 10 Dec 2024 12:58:48 +0000
General Usage

I am using the Regex() function to create a regular expression pattern, instead of just using r"", because I need to interpolate a variable.

If I write Regex("$(f)$") - interpolating the variable f and wanting to match where it is at the end of a string - I get the error

identifier or parenthesized expression expected after $ in string

OK - but then how do I represent the end of the string?

Searching the web for “Julia Regex end of string” just gives me various lectures on how to write regular expressions.

5 posts - 2 participants