Unexpected Regex Outcomes
Posted: Sun Jan 30, 2011 11:21 pm
After trying to figure out why TextPad does the below, I searched the known issues of TextPad, but failed to find anything about REGEX. Could the Regex that TextPad doesn't recognize be documented in the known issues forum?
This likely has been true since March 2010.
Code: Select all
Find what: [ \t\r\n]
Replace with: #
Original Text:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Outcome:
ABCDEFGHIJKLM#OPQ#STUVWXYZ
Expected:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Code: Select all
Find what: [ \t\r\n]
Replace with: #
Original Text:
SELECT ANID, Column1, COUNT(*) AS Count
FROM Table
WHERE (ANID = 1)
GROUP BY ANID, Column1
ORDER BY Column1
Outcome:
SELECT#####A#ID,#Colum#1,#COU#T(*)#AS#Cou#t
F#OM#########Table
WHE#E#####(A#ID#=#1)
G#OUP#BY#A#ID,#Colum#1
O#DE##BY#Colum#1
Expected:
SELECT#####ANID,#Column1,#COUNT(*)#AS#Count#FROM#########Table#WHERE#####(ANID#=#1)#GROUP#BY#ANID,#Column1#ORDER#BY#Column1
Edit: Corrected escape char and retested to be sure.ben_josephs wrote:TextPad's regex engine is old and tired, and it doesn't support non-greedy repetitions. And it doesn't recognise the notation \s as representing a white space character. Source