Help using Base SAS procedures

Perl Regular Expression

Accepted Solution Solved
Reply
Super Contributor
Posts: 358
Accepted Solution

Perl Regular Expression

Hi All:

Having a bit of trouble with a Perl regular expression.

I'm looking for the following in a string:

- Upper case character A

- 6 upper case characters (no more, no less)

- 1 numeric digit

- an underscore.

as in:    AXXXXXX5_

I just can't seem to get the expression.

Thanks in advance.


Accepted Solutions
Solution
‎03-26-2013 09:32 AM
Respected Advisor
Posts: 3,156

Re: Perl Regular Expression

"/A[A-Z]{6}(\d|[A-Z])_/"

Haikuo

View solution in original post


All Replies
Respected Advisor
Posts: 4,922

Re: Perl Regular Expression

"/A[A-Z]{6}?\d_/"

PG

PG
Super Contributor
Posts: 358

Re: Perl Regular Expression

Thanks.

That works perfectly - but it looks like my requirements have changed a bit.

How would I code  the same expression of the last character (the number) could also be a uppercase alpha character?

Solution
‎03-26-2013 09:32 AM
Respected Advisor
Posts: 3,156

Re: Perl Regular Expression

"/A[A-Z]{6}(\d|[A-Z])_/"

Haikuo

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 208 views
  • 3 likes
  • 3 in conversation