Thanks to a lot of help here, I'm getting better at regexp, but I have a problem where I'm not even sure where to start.
I want to check a string that contains one or more of the following comma seperated values (in any order): -config,-files,-params,-driverPath,-appPath,-batchPath. I do not want to allow duplicates or the string could match: NONE. So, following are some examples:
Any help would be greatly appreciated.$s = "-config,-files" VALID $s = "-files,-batchPath" VALID $s = "-files,-batch-driverPath" NOT VALID, not comma seperated. $s = "NONE" VALID $s = "NONE,-params" NOT VALID, can not mix [NONE] with other values +. $s = " -config, -files " NOT VALID, spaces not allowed (beginning, m +iddle or end) $s = "-test" NOT VALID, not a valid parameter $s = "-files,-test,-batchPath" NOT VALID, valid parameters mixed wit +h invalid parameters. $s = "-files,files" NOT VALID, same valid listed 2x $s = "-config,-files,-params,-driverPath,-appPath,-batchPath" VALI +D
In reply to Regular expression question by TASdvlper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |