Find and replace with pattern matching/tokens

I was trying to do the following was wondering if it even possible with hazel? (?pattern match and custom token)?
Edit: replaced the test files and setup environment.
ex.
3232 The ddafddfdd, 6666 the brave123.txt
files 4324 abce addfsaa, 6666 the brave343.txt
Tddfdsadahe feddfdw, 6666 the 3439 brave234.txt
desired:
(3232) The ddafddfdd, 6666 the brave123.txt
files (4324) abce addfsaa, 6666 the brave343.txt
Tddfdsadahe feddfdw, 6666 the (3439) brave234.txt
setup: Open terminal and add the following
touch "3232 The ddafddfdd, 6666 the brave123.txt"
touch "files 4324 abce addfsaa, 6666 the brave343.txt"
touch "Tddfdsadahe feddfdw, 6666 the 3439 brave234.txt"
Overview
- match any 4 digit number except 6666.
- do not match 6666
- add "(" ")" around the matched 4 digit number.
Issue:
- Even with setting up a pattern match and token it renames the entire filename not just the pattern that is matched.
Or would I have to use a script and embed it in hazel?
-
Edit: replaced the test files and setup environment.
ex.
3232 The ddafddfdd, 6666 the brave123.txt
files 4324 abce addfsaa, 6666 the brave343.txt
Tddfdsadahe feddfdw, 6666 the 3439 brave234.txt
desired:
(3232) The ddafddfdd, 6666 the brave123.txt
files (4324) abce addfsaa, 6666 the brave343.txt
Tddfdsadahe feddfdw, 6666 the (3439) brave234.txt
setup: Open terminal and add the following
touch "3232 The ddafddfdd, 6666 the brave123.txt"
touch "files 4324 abce addfsaa, 6666 the brave343.txt"
touch "Tddfdsadahe feddfdw, 6666 the 3439 brave234.txt"
Overview
- match any 4 digit number except 6666.
- do not match 6666
- add "(" ")" around the matched 4 digit number.
Issue:
- Even with setting up a pattern match and token it renames the entire filename not just the pattern that is matched.
Or would I have to use a script and embed it in hazel?
-