I am reading data from a MongoDB collection, and part of the output looks like this:
InternalFileNameFileBYIndex,Sex - Main
How would I use RegEx to extract all text after the "Index" text (including this word). I have tried to extract the text after ¿ but I get weird results, and don't understand RegEx enough to know the syntax needed.
Thanks in advance!
Solved! Go to Solution.
Hey @ashley_harris, is this pattern consistent? Just wondering as, if not, that's maybe why you're getting weird results and if so it'd be great if you could provide some other examples of possible strings so we can set up a more specific expression.
The following works for your example (I've added 'Index' to the capture group to make it a bit more specific in case there are other instances of '¿...', but if it's only ever '¿' followed by what you want then you can just remove 'Index' from inside the brackets so it's solely '.*'):
¿(Index.*)
That works perfectly, thank you so much! I think you are right, some of the data in the collection is a weird format, which must have been why I was getting weird results.