Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Extracting Words from a sentence that contain a sequence of letters

Suppose I have this sentence:

"Peter Piper Picked a Peck of Picked Peppers"

and I wanted to extract out all the words that contained the letters "Pi"

is there a simple way to do it with regular expressions?

2 Solutions
Gurvinder Pal SinghCommented:
from your comments' history, it seems your platform is .net
the regular expression is

you can test it here
Patrick MatthewsCommented:
Try a pattern like this, assuming you are setting RegExp to not be case sensitive:


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now