troubleshooting Question

Using RegExp to find all occurrences of a word in a string.

Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)Flag for United States of America asked on
Regular Expressions
10 Comments1 Solution17 ViewsLast Modified:
Find all occurrences of a word in a string where the word can be at the start of the string, the end of the string, or anywhere in the middle, and the word must not be part of any other word.

This works outside of Windows:

(?<=^|[^A-Za-z])(Word)(?=[^A-Za-z]|$)

But does not produce any results inside Windows. I think it has something to do with look-behind logic but, when I remove that part, it still fails:

(?=^|[^A-Za-z])(Word)(?=[^A-Za-z]|$)

Kevin
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 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 10 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