Possible to do regex search in file *contents*?
-
- Posts: 79
- Joined: Sun Jul 13, 2014 12:20 am
Possible to do regex search in file *contents*?
I'm trying to find some particular text in a folder full of log files, but it seems that the "contents:" ability isn't using regex or wildcards. Is it possible to do this?
Re: Possible to do regex search in file *contents*?
prefix the content: search function with the regex: modifier:
For example:
regex:content:"^foo bar$"
For example:
regex:content:"^foo bar$"
Re: Possible to do regex search in file *contents*?
I would have never guessed to try this!
What other functions can be stacked this way??
What other functions can be stacked this way??
Re: Possible to do regex search in file *contents*?
Here is a list of all the search modifiers:
Some modifiers can be mixed together, eg: case:path:regex:^foo, while
other modifiers cannot, eg: the regex: search modifier does not support the diacritics: search modifier.
These search functions support all the search modifiers:
- ascii:, utf8:, noascii: - Enable or disable fast ASCII case comparisons.
- case:, nocase: - Match or ignore case.
- diacritics:, nodiacritics: - Match or ignore accent marks.
- file:, files:, nofileonly: - Match files only.
- folder:, folders:, nofolderonly: - Match folders only.
- path:, nopath: - Match the full path and file name or just the filename.
- regex:, noregex: - Enable or disable regex.
- wfn:, wholefilename:, nowfn:, nowholefilename:, exact: - Match the whole filename or match anywhere in the filename.
- wholeword:, ww:, nowholeword:, noww: - Match whole words or match anywhere in the filename.
- wildcards:, nowildcards: - Enable or disable wildcards.
Some modifiers can be mixed together, eg: case:path:regex:^foo, while
other modifiers cannot, eg: the regex: search modifier does not support the diacritics: search modifier.
These search functions support all the search modifiers:
- album:
- artist:
- child:
- comment:
- content:, ansicontent:, utf8content:, utf16content:, utf16becontent:
- filelistfilename:
- genre:
- parent:, infolder:, nosubfolders:
- title:
- type:
- endwith: -supports case:/diacritics:/path: modifiers
- ext: -supports case: modifier
- filelist: -supports case:/path: modifiers
- startwith: -supports case:/diacritics:/path: modifiers
Re: Possible to do regex search in file *contents*?
Very cool, and I'll definitely be using this.
If I might suggest, the option for `dbcscontent:`, or `unicodecontent:` as it were to contrast `ansicontent:`, which is simply 16 bit plain 0 BMP unicode strings in windows, ie, usually found in compiled 32 bit software and resources. Easily recognizable in a hex editor as mainly ansi characters separated by null characters most of the time.
If I might suggest, the option for `dbcscontent:`, or `unicodecontent:` as it were to contrast `ansicontent:`, which is simply 16 bit plain 0 BMP unicode strings in windows, ie, usually found in compiled 32 bit software and resources. Easily recognizable in a hex editor as mainly ansi characters separated by null characters most of the time.
Re: Possible to do regex search in file *contents*?
I hope someone will find a way and introduce a wonderful idea on how to make syntax more intuitive.
viewtopic.php?f=4&t=6057
viewtopic.php?f=5&t=6417#p19658
Re: Possible to do regex search in file *contents*?
Here's a list of all the aliases for utf16content:
wcharcontent:
unicodecontent:
contentw:
utf16content:
utf16lecontent:
I hope to add a new function in future releases called textcontent: which will treat files as text/plain and use the BOM to determine encoding.
wcharcontent:
unicodecontent:
contentw:
utf16content:
utf16lecontent:
I hope to add a new function in future releases called textcontent: which will treat files as text/plain and use the BOM to determine encoding.