Tough reg exp problem

Results 1 to 2 of 2

Thread: Tough reg exp problem

  1. #1
    Join Date
    Dec 1969

    Default Tough reg exp problem

    I have to convert the following string:<BR>1T1234<BR>into <BR>1-T-1234<BR><BR>The first number can be infinitley big (always integer), The letter can be any letter (just one), and the last set of numbers can also be infinitely big (integers).<BR><BR>What kind of pattern would I use to accomplish this? (I find regEXP patterns very difficult to understand.)

  2. #2
    Join Date
    Dec 1969

    Default RE: Tough reg exp problem

    set o = new regexp<BR>o.pattern = "^([0-9]+)([A-Z])([0-9]+)$"<BR>o.ignorcecase = true &#039;?<BR>s = "1T214"<BR>s = o.replace(s,"$1-$2-$3")

Posting Permissions

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