Click here to Skip to main content
13,195,170 members (67,930 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi,

I've a system which validates a string (a mail subject line) based on a regular expression pattern.

I provide - Input string and Pattern and it validates yes or no.

I've NO ACCESS to code which does that (or worse, I don't even know what it's coded upon). Just the Regular Expression pattern!

Case 1:
Input: FW: 12334-123-412 my-name test mail
Pattern: \bmy-name\b
Validation: Successful


Case 2:
Input: FW: 12334-123-412 my-name test mail
Pattern: \bMy-name\b
Validation: Failed


I need to make it case insensitive, hence I tried the pattern (?i)(\bmy-name\b)
Input: FW: 12334-123-412 my-name test mail
Pattern: (?i)(\bMy-name\b)
Validation: Failed


Can you help me with the proper pattern, having no knowledge of the comparison code?
or give me a set of possible patterns that I might use to test out?
Posted 1-Feb-12 20:34pm
Updated 1-Feb-12 20:35pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Jyothikarthik_N 2-Feb-12 3:48am
   
/regexp/i -did not work
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Brute force?

\b[Mm][Yy]-[Nn][Aa][Mm][Ee]\b


Andi
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.171019.1 | Last Updated 2 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100