hi,
Ive a problem with a regular expression..
Ill use it, to..
match a bank account line, so accept the complete line
and filter two 6-digit-numbers out of the string to put it in reference 1 and 2
(or only one, thats the problem)
(for later use with coldfusions REreplace function ..
:select all text and replace it with the numbers, found in the text, separated by kommas )
heres the regEx:
^(?:.*?)(\d{6,6})(?:-\d{2,2}|)(?:.*?)(?\d{6,6})(?:-\d{2,2}|))?
now, you can see the problem in the result of example 2 (using regexTester).
where is the second number,
the regex doesnt find it, but why does it succed in searching in example 3?
thank you
example rows:
1: hans meier rechnung nr.04-123456-04 fa any
2: hans meier rechnung nr.04-123456 777777-04 fa any
3: hans meier rechnung nr.04-123456777777-04 fa any
results:
1: ok, data in ref. 1
2: not ok (data in ref.1 ok, but 2 is empty)
3: ok data in ref. 1+2 (removed whitespace between the numbers)
Ive a problem with a regular expression..
Ill use it, to..
match a bank account line, so accept the complete line
and filter two 6-digit-numbers out of the string to put it in reference 1 and 2
(or only one, thats the problem)
(for later use with coldfusions REreplace function ..
:select all text and replace it with the numbers, found in the text, separated by kommas )
heres the regEx:
^(?:.*?)(\d{6,6})(?:-\d{2,2}|)(?:.*?)(?\d{6,6})(?:-\d{2,2}|))?
now, you can see the problem in the result of example 2 (using regexTester).
where is the second number,
the regex doesnt find it, but why does it succed in searching in example 3?
thank you
example rows:
1: hans meier rechnung nr.04-123456-04 fa any
2: hans meier rechnung nr.04-123456 777777-04 fa any
3: hans meier rechnung nr.04-123456777777-04 fa any
results:
1: ok, data in ref. 1
2: not ok (data in ref.1 ok, but 2 is empty)
3: ok data in ref. 1+2 (removed whitespace between the numbers)