Using Regex/GREP in...
 
Notifications
Clear all

Using Regex/GREP in Axiom

4 Posts
3 Users
0 Likes
2,859 Views
(@kossuth)
Posts: 22
Eminent Member
Topic starter
 

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?

 
Posted : 22/05/2019 3:02 pm
(@mcman)
Posts: 189
Estimable 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
^(?(?<!Word).)*$

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

 
Posted : 22/05/2019 3:18 pm
(@kossuth)
Posts: 22
Eminent Member
Topic starter
 

That helps tremendously. Thank you!

 
Posted : 22/05/2019 3:23 pm
kastajamah
(@kastajamah)
Posts: 109
Estimable Member
 

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

 
Posted : 22/05/2019 5:06 pm
Share: