Describe the issue that you're seeing.
I'm trying to use this ^(?!content\/blog).* in my query
query {
allMdx(
filter: { fileAbsolutePath: { regex: "^(?!content\/blog).*" } }
) {
edges {
node {
id
frontmatter {
slug
}
}
}
}
}
but it gives me this error
Invalid flags supplied to RegExp constructor 'blog).*'
I have tested the regex on https://regex101.com and it seems to work well there:

I don't know Regex not sure how the regex that I have can be made valid.
Thanks.
I am also using a filter and have put slashes around the regex, which is working fine. So try:
filter: { fileAbsolutePath: { regex: "/^(?!content\/blog).*/" } }
I am not sure, but maybe this helps.
@nisarhassan12 yes, you need to wrap it in slashes, almost like a fully formed javascript regex.
Thanks @karland!