troubleshooting Question

Regex.match to trim leading and trailing whitespaces while preserving line count

Avatar of Thomas PAIK
Thomas PAIK asked on
Regular Expressions
5 Comments1 Solution19 ViewsLast Modified:
https://regex101.com/r/C0nQGn/1

Please kindly provide a line-by-line trimming needle for a regex.Matches scheme (not regex.Replace) such that the matched results preserve the original line count (which is 22 lines), i.e. regex.Matches(text,needle,RegexOptions.Multiline).count = 22

Thank you.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros