Join Us!

Using Regex/GREP in...
 
Notifications
Clear all

Using Regex/GREP in Axiom  

  RSS
jamesvogel
(@jamesvogel)
New Member

I am interested in filtering columns in Magnet Axiom by excluding a word. I read that you can use the GREP expression "grep -v" to exclude a word, but I have tried this every which way with no success. Has anyone else found a way to do this?

Quote
Posted : 22/05/2019 4:02 pm
mcman
(@mcman)
Active Member

Hey James,

AXIOM uses .NET regex which is a little different than a Unix GREP.

Here's some common regexes I use that should work for your scenario (hopefully the formatting carries over to FF)
Not null
[^()]

Not a single word - this one should work for you
^(?(?!word).)*$

Not a word at very end
^(?(?!Word$).)*$

Not a Word at the start of line
^(?(?

Contains a number
[^(\D)]

Either blue or red or black
(blue|red|black)

CASE SENSITIVE
Find two words separate by X words
John\W+(?\w+\W+){1,3}?Smith
Find two words separate by X singles
John(?.){1,3}?Smith

CASE INSENSITIVE
Find two words separate by X words
(?i)John\W+(?\w+\W+){1,3}?Smith
Find two words separate by X singles
(?i)John(?.){1,3}?Smith

Hope that helps,
Jamie McQuaid
Magnet Forensics

ReplyQuote
Posted : 22/05/2019 4:18 pm
jamesvogel
(@jamesvogel)
New Member

That helps tremendously. Thank you!

ReplyQuote
Posted : 22/05/2019 4:23 pm
kastajamah
(@kastajamah)
Member

If you want to test your expressions before loading them into AXIOM, you can go to https://rextester.com/tester.

ReplyQuote
Posted : 22/05/2019 6:06 pm
Share: