Regular Expression - Bill

Results 1 to 2 of 2

Thread: Regular Expression - Bill

  1. #1
    Join Date
    Dec 1969

    Default Regular Expression - Bill

    Hi Bill,<BR><BR>Thanks for your help. I was thinking the same thing however how do I "disallow" say for instance @ in the front of the word but allow it in the middle e.g. Test @ This. Also how do i allow for the such an instances<BR><BR>1)Disallow in the front of the word<BR>2)Disallow at the end of the word/sentence <BR> E.g. Disallow Test@<BR> E.g. Allow Test & Test & Test<BR> E.g. Disallow Test & Test &<BR>3) Replace ceratin "signs" e.g. Replace & with And<BR><BR>Post Ref:

  2. #2
    Join Date
    Dec 1969

    Default RE: Regular Expression - Bill

    You could probably do something simple like this:<BR><BR> ^[a-zA-Z0-9][wW]+[a-zA-Z0-9]$<BR><BR>As you can see, this pattern forces the first and last character in the string to be a letter or number. You could just as easily alter it to a negated character class if you wanted to do it the other way around:<BR><BR> ^[^&@][wW]+[^&@]$

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts