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:
$in="TFS ID 100";
$in="TFS CR 100";
$in="- TFS CR634: STRESS: H 17326,21600,";
and i check with this regular expression:
$pattern = '[Tt]?[Ff]?[Ss]?[-_\s]?[Cc]?[Rr]?[\']?[Ii]?[Dd]?:?\s?(\d+)'
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 (
), if after some characters like "cr" or "tfs" the next value is a zero or double zero.
Interesting is, that the number in 
isn't recognized, but it is in 
I tried a lot of things but couldn't get it to work.
Maybe you can help me fixing my problem? This would be great!
Greetz from Germany
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||