Click here to Skip to main content
15,038,345 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
AnswerRe: Cannot extract end of line data Pin
jsc4211-Apr-20 8:48
professionaljsc4211-Apr-20 8:48 
QuestionRegex code to check textfield is working until a 'enter' is given Pin
Member 1255403315-Mar-18 6:10
MemberMember 1255403315-Mar-18 6:10 
AnswerRe: Regex code to check textfield is working until a 'enter' is given Pin
Gerry Schmitz15-Mar-18 6:27
mveGerry Schmitz15-Mar-18 6:27 
QuestionRe: Regex code to check textfield is working until a 'enter' is given Pin
User 1013254615-Mar-18 6:42
MemberUser 1013254615-Mar-18 6:42 
AnswerRe: Regex code to check textfield is working until a 'enter' is given Pin
Member 1255403315-Mar-18 6:53
MemberMember 1255403315-Mar-18 6:53 
GeneralRe: Regex code to check textfield is working until a 'enter' is given Pin
User 1013254616-Mar-18 3:07
MemberUser 1013254616-Mar-18 3:07 
GeneralRe: Regex code to check textfield is working until a 'enter' is given Pin
Member 1255403316-Mar-18 4:51
MemberMember 1255403316-Mar-18 4:51 
Questionregular expression to find tax file numbers Pin
Copalol3-Dec-17 19:08
MemberCopalol3-Dec-17 19:08 
Hi all,

I'm new to regular expressions and what I want to do seems a bit advanced for me.

I'd like to create a regular expression to locate valid Australian tax file numbers.

Here's the regular expression I've come up with so far:
(\d{8,9})|(\d\d\d[ ]\d\d\d[ ]\d\d\d)|(\d\d\d[-]\d\d\d[-]\d\d\d)

Tax file numbers can be either 8 or 9 digits and this string successfully finds them, however, it also picks up numbers like mobile phone numbers.
I also tried to incorporate a few different ways people generally type out tax file numbers which is why I've added in a - and also white space.

There is a formula to detect if a tax file number is valid and this is what id like to add to the string to remove the false positives.

From wikipedia:
Tax file number - Wikipedia[^]

As is the case with many identification numbers, the TFN includes a check digit for detecting erroneous numbers. The algorithm is based on simple modulo 11 arithmetic per many other digit checksum schemes.

Example[edit]
The validity of the example TFN '123456782' can be checked by the following process

The sum of the numbers is 253 (1 + 8 + 9 + 28 + 25 + 48 + 42 + 72 + 20 = 253). 253 is a multiple of 11 (11 × 23 = 253). Therefore, the number is valid.

Can it be done?
Can someone assist?
AnswerRe: regular expression to find tax file numbers Pin
Peter_in_27803-Dec-17 19:48
professionalPeter_in_27803-Dec-17 19:48 
GeneralRe: regular expression to find tax file numbers Pin
jschell5-Dec-17 12:06
Memberjschell5-Dec-17 12:06 
AnswerRe: regular expression to find tax file numbers Pin
George Jonsson4-Dec-17 23:25
professionalGeorge Jonsson4-Dec-17 23:25 
GeneralRe: regular expression to find tax file numbers Pin
Copalol5-Dec-17 13:05
MemberCopalol5-Dec-17 13:05 
GeneralRe: regular expression to find tax file numbers Pin
jschell8-Dec-17 6:51
Memberjschell8-Dec-17 6:51 
AnswerRe: regular expression to find tax file numbers Pin
jschell5-Dec-17 12:22
Memberjschell5-Dec-17 12:22 
GeneralRe: regular expression to find tax file numbers Pin
Copalol5-Dec-17 13:32
MemberCopalol5-Dec-17 13:32 
QuestionCorrect Expression For 'Any Character Including Whitespace' Pin
Sonhospa7-May-17 9:23
MemberSonhospa7-May-17 9:23 
SuggestionRe: Correct Expression For 'Any Character Including Whitespace' Pin
Richard MacCutchan7-May-17 21:22
mveRichard MacCutchan7-May-17 21:22 
GeneralRe: Correct Expression For 'Any Character Including Whitespace' Pin
Sonhospa7-May-17 23:12
MemberSonhospa7-May-17 23:12 
GeneralRe: Correct Expression For 'Any Character Including Whitespace' Pin
Richard MacCutchan7-May-17 23:30
mveRichard MacCutchan7-May-17 23:30 
AnswerRe: Correct Expression For 'Any Character Including Whitespace' Pin
Bernhard Hiller7-May-17 23:13
MemberBernhard Hiller7-May-17 23:13 
AnswerRe: Correct Expression For 'Any Character Including Whitespace' Pin
Sonhospa8-May-17 0:24
MemberSonhospa8-May-17 0:24 
GeneralRe: Correct Expression For 'Any Character Including Whitespace' Pin
Richard MacCutchan8-May-17 2:25
mveRichard MacCutchan8-May-17 2:25 
QuestionHow to retain characters preceding a match? Pin
Member 1297660431-Jan-17 15:44
MemberMember 1297660431-Jan-17 15:44 
AnswerRe: How to retain characters preceding a match? Pin
Peter_in_278031-Jan-17 19:27
professionalPeter_in_278031-Jan-17 19:27 
GeneralRe: How to retain characters preceding a match? Pin
Member 1297660431-Jan-17 20:50
MemberMember 1297660431-Jan-17 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.