Regular Expressions

  • Thread starter Thread starter Ken Kast
  • Start date Start date
K

Ken Kast

I have 3 pattern sets (P1, P2, P3). I want to match the following (sort
of): (P1|P2)(P1|P2|P3)+ The sort of is that if a matchee begins with a P2,
then there has to be at least 1 P1 following it. Simple example (in this
case P3 is void): I want to find all (longest) sequences of letters and
numbers, where the first character is a letter.

Is this doable with regexp?
 
Could you explicit what you really want ?
This regex is maybe what you are looking for : all sequence of letter and
digits that starts with a letter : "\b[a-zA-Z]\w*\b"
(or "\b[a-zA-Z]\w+\b" if you do not want sequences with only one char).
Then, use group fields to check the length of your sequences....

Hope it helps,

Ludovic SOEUR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top