If you are experiencing problems with "Everything", post here for assistance.
klark1kent
Posts: 24 Joined: Thu Aug 11, 2022 1:26 am
Post
by klark1kent » Wed Dec 04, 2024 2:05 am
I have to be missing something - Not understanding why I can't get this regex match to return each instance of the match:
Code: Select all
twrp_3.0.1_v10 (2016_07_16 00_50_42 UTC) (2022_01_31 02_32_11 UTC) regex:name:(\d{4}\_\d{2}\_\d{2})
I only included the file name to narrow down the search result to take the screenshot. In this case I have the date string that should match twice. I've added the regex match columns for 0, 1, 2 and Regex 1-9 just in case.
Each method solely returns the first match.
image.png
I've even tried using REGEX_MATCH, which only shows 1 match.
Code: Select all
twrp_3.0.1_v10 (2016_07_16 00_50_42 UTC) (2022_01_31 02_32_11 UTC) a=REGEX_MATCH($Name:,"\d{4}\_\d{2}\_\d{2}") add-column:a
image.png
And REGEX_EXTRACT
Code: Select all
twrp_3.0.1_v10 (2016_07_16 00_50_42 UTC) (2022_01_31 02_32_11 UTC) a=REGEX_EXTRACT($Name:,"\d{4}\_\d{2}\_\d{2}") add-column:a
image.png
You do not have the required permissions to view the files attached to this post.
void
Developer
Posts: 19903 Joined: Fri Oct 16, 2009 11:31 pm
Post
by void » Wed Dec 04, 2024 2:31 am
Are you trying to capture the year, month and day in separate groups?
-If so, please try:
regex:name:(\d{4})\_(\d{2})\_(\d{2})
( ) = define a capture group.
Only the first occurrence is matched by default.
Please try the
global: search modifier to match all occurrences:
global:regex:name:(\d{4}\_\d{2}\_\d{2})
REGEX_MATCH() and REGEX_EXTRACT() do not support the global modifier. (PCRE doesn't have a global modifier
)
klark1kent
Posts: 24 Joined: Thu Aug 11, 2022 1:26 am
Post
by klark1kent » Wed Dec 04, 2024 2:47 am
Ah okay I had used parenthesis for capture groups but that also wasn't working, the part I was missing was the global flag. thanks
klark1kent
Posts: 24 Joined: Thu Aug 11, 2022 1:26 am
Post
by klark1kent » Wed Dec 04, 2024 6:33 pm
Confirming this worked as expected for anyone that comes across this post later.
image.png
You do not have the required permissions to view the files attached to this post.