Help with Regex patterns -


I need some help with regex.

  1. I have a pattern AB *, this pattern must be matched for the wire like AB.CD AB.CDX (AB.whatever). And so on .. but it's AB , ABBCDCD, ABCCD should not match the stars. ABCDDCD, which faces the second dot in the string. What is regex for this?

  2. I have a pattern AB. **, this pattern is AB, AB. Cords like CDDCD, ABCCD should match. ABCDDCD but AB CD, AB No wire like CDX, AB What is Reggae for this?

Thanks a lot.

It seems that you do not have a globe, the dot matches any characters, and * Matches the previous element any time 0 times.

1) AB [.] * Avoid the first dot, dot, and then matches any character except dot, the number of any time

2) "^ (AB) | (AB \. [^.] * \. ^ ^] * $" This match is AB or AB followed by . & Lt; stuff & gt ;. & lt; luggage & gt;


Comments