Hi,
Please help me with regex to capture only highlighted data
Hi @Ashwini008,
Great to hear it is working. Let me try to explain.
\w\+\w\.(in_)?(?<data>(?:\w{2,}(?:\.)){1,}\w{3})
\w\+\w\.(in_)? --> Skips first letter+letter pattern and _in (if any)
Start Capturing
(?:\w{2,}(?:\.)){1,} --> Finds pattern that has a word with 2 or more chars and a dot. Find this pattern 1 or more times.
\w{3} --> A word with 3 chars.
End Capture
Hi @Ashwini008,
Great to hear it is working. Let me try to explain.
\w\+\w\.(in_)?(?<data>(?:\w{2,}(?:\.)){1,}\w{3})
\w\+\w\.(in_)? --> Skips first letter+letter pattern and _in (if any)
Start Capturing
(?:\w{2,}(?:\.)){1,} --> Finds pattern that has a word with 2 or more chars and a dot. Find this pattern 1 or more times.
\w{3} --> A word with 3 chars.
End Capture
Hi @Ashwini008,
Please try below rex command;
| rex "\w\+\w\.(in_)?(?<data>(?:\w{2,}(?:\.)){1,}\w{3})"
@scelikok Can you please explain me the regex expression on how it is capturing only the highlighted data?btw the regex is working fine Thank you!
| rex "\w\+\w\.(in_)?(?<data>(?:\w{2,}(?:\.)){1,}\w{3})"
Hi @richgalloway I highlighted the data to indicate on what data to capture from each of the given example.
As it turns out, regex does not have the ability to match on highlighting and it's unlikely the data will have highlighting. 🙂
Can you describe how the desired data should be matched?