I am currently facing a challenge passing a regex query to the FromSqlRaw method in EF Core >=3.1.
The FromSqlRaw treats the query as string interpolation. I want it to ignore this and accept the query as it is.
Sample regex to test with
^.*([a-z]\\s*){3,4}([0-9]\\s*){3}([a-z]?){1}[^$].*$
Example 2
this.context.Mudal.FromSqlRaw(@"SELECT * FROM Mudal WHERE replace(BillRefNumber, ' ', '') regexp '^.*([a-z]\\s*){3,4}([0-9]\\s*){3}([a-z]?){1}[^$].*$';").ToList()