RegEx Trapping Methods (\r \n)
------------------------------
Jordan Matusik
------------------------------
Answers
-
The short answer: No. When using regex traps, all white spaces (line breaks, tabs, carriage returns, etc.) are converted to spaces in the trap window. That means the regex characters like \n, \r, \t will not work but the \s character will.
If you do trap multiple lines, you can split the data in the table view using the \n regex character.
Can you distinguish the alpha letter "I" from the roman numeral "I" in your data? The onscreen presentation makes them look the same.
I know you said you did not want to break up the lines, but one possible workaround would be to capture those lines as a detail and then with some transformations and a merge statement you can join them together with line breaks to be one column.
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
------------------------------
-------------------------------------------
Original Message:
Sent: 09-17-2019 03:05 PM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
I was wondering if there is a way to leverage the RegEx characters \r or \n while trapping data from a PDF source. I have been unsuccessful up this point and am not sure if anyone out there has figured it out. The first line I want to trap starts with an (H) and the second line starts with an (I), however I do not want to split up the detail trap to also capture (I) and I also do not want to only trap the (H) line and then set the trap to multiple lines. I need it to be all in one (this way will decipher between an alphabet (I) and a roman numeral (I) with the data I'm using)
------------------------------
Jordan Matusik
------------------------------
"0 -
Thank you for getting back to me. There really is no way to distinguish a letter "I" from a roman "I" unfortunately. I had a solution if I was able to use carriage returns in the trap window. While I have you here, when using regex patterns within DPS, is there a way I can reference a quotation (")? Given you open and close a regex pattern using quotes, I have had trouble using a quote within the pattern itself. I have found some workarounds, though it would be easier and more efficient to just reference quotes as they appear.Chris Porthouse said:The short answer: No. When using regex traps, all white spaces (line breaks, tabs, carriage returns, etc.) are converted to spaces in the trap window. That means the regex characters like \n, \r, \t will not work but the \s character will.
If you do trap multiple lines, you can split the data in the table view using the \n regex character.
Can you distinguish the alpha letter "I" from the roman numeral "I" in your data? The onscreen presentation makes them look the same.
I know you said you did not want to break up the lines, but one possible workaround would be to capture those lines as a detail and then with some transformations and a merge statement you can join them together with line breaks to be one column.
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
------------------------------
-------------------------------------------
Original Message:
Sent: 09-17-2019 03:05 PM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
I was wondering if there is a way to leverage the RegEx characters \r or \n while trapping data from a PDF source. I have been unsuccessful up this point and am not sure if anyone out there has figured it out. The first line I want to trap starts with an (H) and the second line starts with an (I), however I do not want to split up the detail trap to also capture (I) and I also do not want to only trap the (H) line and then set the trap to multiple lines. I need it to be all in one (this way will decipher between an alphabet (I) and a roman numeral (I) with the data I'm using)
------------------------------
Jordan Matusik
------------------------------
"
------------------------------
Jordan Matusik
Financial Consultant
Immersion Consulting LLC
MD
440-622-1202
------------------------------
-------------------------------------------
Original Message:
Sent: 09-18-2019 07:50 AM
From: Chris Porthouse
Subject: RegEx Trapping Methods (\r \n)
The short answer: No. When using regex traps, all white spaces (line breaks, tabs, carriage returns, etc.) are converted to spaces in the trap window. That means the regex characters like \n, \r, \t will not work but the \s character will.
If you do trap multiple lines, you can split the data in the table view using the \n regex character.
Can you distinguish the alpha letter "I" from the roman numeral "I" in your data? The onscreen presentation makes them look the same.
I know you said you did not want to break up the lines, but one possible workaround would be to capture those lines as a detail and then with some transformations and a merge statement you can join them together with line breaks to be one column.
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
------------------------------
Original Message:
Sent: 09-17-2019 03:05 PM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
I was wondering if there is a way to leverage the RegEx characters \r or \n while trapping data from a PDF source. I have been unsuccessful up this point and am not sure if anyone out there has figured it out. The first line I want to trap starts with an (H) and the second line starts with an (I), however I do not want to split up the detail trap to also capture (I) and I also do not want to only trap the (H) line and then set the trap to multiple lines. I need it to be all in one (this way will decipher between an alphabet (I) and a roman numeral (I) with the data I'm using)
------------------------------
Jordan Matusik
------------------------------
"0 -
If you are talking about a regex trap (report design) you should be able to just use the double quote or you can also use the backslash (\) as an escape character. If you are talking about within a formula/calculated field using one of the regex functions, i.e. RegexIsMatch, you should include your regular expression inside of single quotes (' '). Again, you can either use '"' (single, double, single) or escape it '\"' (single, backslash, double, single). Hope that helps.Jordan_22422 said:Thank you for getting back to me. There really is no way to distinguish a letter "I" from a roman "I" unfortunately. I had a solution if I was able to use carriage returns in the trap window. While I have you here, when using regex patterns within DPS, is there a way I can reference a quotation (")? Given you open and close a regex pattern using quotes, I have had trouble using a quote within the pattern itself. I have found some workarounds, though it would be easier and more efficient to just reference quotes as they appear.
------------------------------
Jordan Matusik
Financial Consultant
Immersion Consulting LLC
MD
440-622-1202
------------------------------
-------------------------------------------
Original Message:
Sent: 09-18-2019 07:50 AM
From: Chris Porthouse
Subject: RegEx Trapping Methods (\r \n)
The short answer: No. When using regex traps, all white spaces (line breaks, tabs, carriage returns, etc.) are converted to spaces in the trap window. That means the regex characters like \n, \r, \t will not work but the \s character will.
If you do trap multiple lines, you can split the data in the table view using the \n regex character.
Can you distinguish the alpha letter "I" from the roman numeral "I" in your data? The onscreen presentation makes them look the same.
I know you said you did not want to break up the lines, but one possible workaround would be to capture those lines as a detail and then with some transformations and a merge statement you can join them together with line breaks to be one column.
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
------------------------------
Original Message:
Sent: 09-17-2019 03:05 PM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
I was wondering if there is a way to leverage the RegEx characters \r or \n while trapping data from a PDF source. I have been unsuccessful up this point and am not sure if anyone out there has figured it out. The first line I want to trap starts with an (H) and the second line starts with an (I), however I do not want to split up the detail trap to also capture (I) and I also do not want to only trap the (H) line and then set the trap to multiple lines. I need it to be all in one (this way will decipher between an alphabet (I) and a roman numeral (I) with the data I'm using)
------------------------------
Jordan Matusik
------------------------------
"
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
------------------------------
-------------------------------------------
Original Message:
Sent: 09-18-2019 10:26 AM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
Thank you for getting back to me. There really is no way to distinguish a letter "I" from a roman "I" unfortunately. I had a solution if I was able to use carriage returns in the trap window. While I have you here, when using regex patterns within DPS, is there a way I can reference a quotation (")? Given you open and close a regex pattern using quotes, I have had trouble using a quote within the pattern itself. I have found some workarounds, though it would be easier and more efficient to just reference quotes as they appear.
------------------------------
Jordan Matusik
Financial Consultant
Immersion Consulting LLC
MD
440-622-1202
------------------------------
Original Message:
Sent: 09-18-2019 07:50 AM
From: Chris Porthouse
Subject: RegEx Trapping Methods (\r \n)
The short answer: No. When using regex traps, all white spaces (line breaks, tabs, carriage returns, etc.) are converted to spaces in the trap window. That means the regex characters like \n, \r, \t will not work but the \s character will.
If you do trap multiple lines, you can split the data in the table view using the \n regex character.
Can you distinguish the alpha letter "I" from the roman numeral "I" in your data? The onscreen presentation makes them look the same.
I know you said you did not want to break up the lines, but one possible workaround would be to capture those lines as a detail and then with some transformations and a merge statement you can join them together with line breaks to be one column.
------------------------------
Chris Porthouse
Senior Implementation & Integration Engineer
Altair
Original Message:
Sent: 09-17-2019 03:05 PM
From: Jordan Matusik
Subject: RegEx Trapping Methods (\r \n)
I was wondering if there is a way to leverage the RegEx characters \r or \n while trapping data from a PDF source. I have been unsuccessful up this point and am not sure if anyone out there has figured it out. The first line I want to trap starts with an (H) and the second line starts with an (I), however I do not want to split up the detail trap to also capture (I) and I also do not want to only trap the (H) line and then set the trap to multiple lines. I need it to be all in one (this way will decipher between an alphabet (I) and a roman numeral (I) with the data I'm using)
------------------------------
Jordan Matusik
------------------------------
"0