Find string within range
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Find string within range
To find rows with '684556' between positions 718 and 1198, I'm using this regular expression:
^.{717,1198}684556
But a dialog box is displayed saying "The complexity of matching the regular expression exceeded the predefined bounds. Try refactoring the regular expression to make each choice made by the state machine unambiguous. This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate."
What would be a better expression?
^.{717,1198}684556
But a dialog box is displayed saying "The complexity of matching the regular expression exceeded the predefined bounds. Try refactoring the regular expression to make each choice made by the state machine unambiguous. This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate."
What would be a better expression?
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Except for the string and the range, it has the same syntax as your previous reply; see:
http://forums.textpad.com/viewtopic.php ... ght=068345
In my file, each row has 1,274 characters; in some of the rows, the string is located within the bounds specified.
http://forums.textpad.com/viewtopic.php ... ght=068345
In my file, each row has 1,274 characters; in some of the rows, the string is located within the bounds specified.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
I'm using Textpad 7.2.0 (32-bit edition)
The exact and entire regex I'm using is: ^.{717,1198}684556
The "Regular Expression" box is ticked.
My file contains 985,945 rows and each row contains 1,274 characters.
The search string ('684556') exists in 175,296 rows within the specified range.
Here is one line:
00961805522013UNIT 1 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004210COPPER CANYON RD PALM SPRINGS 000092262LND000090270STR000206550 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002968200351280000003847103900100000005921045121000000296826826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210986000000000000002109860000000000000UNPAID UNPAID 00000905200000000000000000000000000UNPAID
[color=yellow]However, Textpad finds thousands of lines containing the string before the dialog box with the "The complexity..." message is displayed.[/color]
The exact and entire regex I'm using is: ^.{717,1198}684556
The "Regular Expression" box is ticked.
My file contains 985,945 rows and each row contains 1,274 characters.
The search string ('684556') exists in 175,296 rows within the specified range.
Here is one line:
00961805522013UNIT 1 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004210COPPER CANYON RD PALM SPRINGS 000092262LND000090270STR000206550 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002968200351280000003847103900100000005921045121000000296826826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210986000000000000002109860000000000000UNPAID UNPAID 00000905200000000000000000000000000UNPAID
[color=yellow]However, Textpad finds thousands of lines containing the string before the dialog box with the "The complexity..." message is displayed.[/color]
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
How many rows below the 22nd marked row is the first row that the regex should match?
If it's not too many, post all those lines from, but not including, the 22nd marked row up to and including the next one that the regex should match.
Enclose them in a[/color][/b] block.
If it's not too many, post all those lines from, but not including, the 22nd marked row up to and including the next one that the regex should match.
Enclose them in a
Code: Select all
[/color][/b]...[b][color=blue]-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
I still can't reproduce your problem.
Which line is the cursor on when the error message is displayed?
Please post that line and (if it's a different line) the next line on which the regex should match. Enclose them in[/color][/b] blocks.
As I suggested earlier, the issue might arise only with the 32-bit version of TextPad.
Which line is the cursor on when the error message is displayed?
Please post that line and (if it's a different line) the next line on which the regex should match. Enclose them in
Code: Select all
[/color][/b]...[b][color=blue]As I suggested earlier, the issue might arise only with the 32-bit version of TextPad.
The cursor is on line 13810 (the first line that contains the search string).
Here is line 13810 and line 13811 (both containing the regex):
[code]00961805522013UNIT 1 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004210COPPER CANYON RD PALM SPRINGS 000092262LND000090270STR000206550 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002968200351280000003847103900100000005921045121000000296826826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210986000000000000002109860000000000000UNPAID UNPAID 00000905200000000000000000000000000UNPAID
00961805632013UNIT 2 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004230COPPER CANYON RD PALM SPRINGS 000092262LND000094000STR000159000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002530000351280000003279103900100000005047045121000000253006826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000183608000000000000001836080000000000000UNPAID UNPAID 00000905300000000000000000000000000UNPAID
[/code]
Here is line 13810 and line 13811 (both containing the regex):
[code]00961805522013UNIT 1 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004210COPPER CANYON RD PALM SPRINGS 000092262LND000090270STR000206550 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002968200351280000003847103900100000005921045121000000296826826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210986000000000000002109860000000000000UNPAID UNPAID 00000905200000000000000000000000000UNPAID
00961805632013UNIT 2 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004230COPPER CANYON RD PALM SPRINGS 000092262LND000094000STR000159000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002530000351280000003279103900100000005047045121000000253006826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000183608000000000000001836080000000000000UNPAID UNPAID 00000905300000000000000000000000000UNPAID
[/code]
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Here you go:
The cursor is on line 13810 (the first line that contains the search string).
Here is line 13810 and line 13811 (both containing the regex):
The cursor is on line 13810 (the first line that contains the search string).
Here is line 13810 and line 13811 (both containing the regex):
Code: Select all
00961805522013UNIT 1 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004210COPPER CANYON RD PALM SPRINGS 000092262LND000090270STR000206550 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002968200351280000003847103900100000005921045121000000296826826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000210986000000000000002109860000000000000UNPAID UNPAID 00000905200000000000000000000000000UNPAID
00961805632013UNIT 2 CM 181/073 INT. IN COMM IN LOT 1-P OF TR 33576 MB 407/001 Y01105201249560004230COPPER CANYON RD PALM SPRINGS 000092262LND000094000STR000159000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000010000000002530000351280000003279103900100000005047045121000000253006826170000001680068263700000033946684556000000003320000009999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000183608000000000000001836080000000000000UNPAID UNPAID 00000905300000000000000000000000000UNPAID
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm