Is there a way to check for a character in a specific position in a string? For
example, say I want to make sure that the 10th
character in a string is an X.
This would be a match: 123456789X12345
Would I have to use a pattern like ?X
or is there something more elegant? Using
how about
/^[a-z0-9]{n}X/i
where n is the index of the character and X is the character?
Howie Hamlin [EMAIL PROTECTED] on 02/22/2002 11:50:58 AM
Please respond to [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
cc:
Subject: RegEx rookie question
Is there a way to check
-
From: Howie Hamlin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 12:51 PM
To: CF-Talk
Subject: RegEx rookie question
Is there a way to check for a character in a specific position in a
string? For example, say I want to make sure that the 10th
character in a string is an X
How about:
mid(string,10,1) eq 'X'
- Matt Small
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 1:01 PM
To: CF-Talk
Subject: Re: RegEx rookie question
how about
/^[a-z0-9]{n}X/i
where n is the index of the character and X
Thanks, I appreciate it.
Regards,
Howie
- Original Message -
From: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, February 22, 2002 1:00 PM
Subject: Re: RegEx rookie question
how about
/^[a-z0-9]{n}X/i
where n is the index of the character and X
5 matches
Mail list logo