Hi @ all,
I have a problem using a regular expression against some values. In most cases it works fine, but I have to skip some values, which isn't working.
See, I have this array with different possible combinations:
and i check with this regular expression:$in[0]="TFS100"; $in[1]="TFS 100"; $in[2]="TFS-CR100"; $in[3]="TFS-CR 100"; $in[4]="TFS_100"; $in[5]="TFS ID 100"; $in[6]="TFS CR 100"; $in[7]="TFS ID100"; $in[8]="TFS-ID 100"; $in[9]="TFS ID:100"; $in[10]="TFS-ID: 100"; $in[11]="- TFS CR634: STRESS: H 17326,21600,"; $in[12]="CR0080588"; $in[13]="TFS0080588";
to also parse the numbers as I need them later in my code. This works fine for nearly all cases, but I have to "skip" or return false for the both last cases ([12] and [13]), if after some characters like "cr" or "tfs" the next value is a zero or double zero. Interesting is, that the number in [12] isn't recognized, but it is in [13]. I tried a lot of things but couldn't get it to work.$pattern = '[Tt]?[Ff]?[Ss]?[-_\s]?[Cc]?[Rr]?[\']?[Ii]?[Dd]?:?\s?(\d+)' +;
In reply to Problem with regular expression by MARVion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |