Using Regex/GREP in...
 
Notifications
Clear all

Using Regex/GREP in Axiom

4 Posts
3 Users
0 Reactions
4,222 Views
(@kossuth)
Eminent Member
Joined: 7 years ago
Posts: 22
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?


   
Quote
(@mcman)
Estimable Member
Joined: 15 years ago
Posts: 189
 

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


   
ReplyQuote
(@kossuth)
Eminent Member
Joined: 7 years ago
Posts: 22
Topic starter  

That helps tremendously. Thank you!


   
ReplyQuote
kastajamah
(@kastajamah)
Estimable Member
Joined: 8 years ago
Posts: 113
 

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


   
ReplyQuote
Share: