regex - Using powershell to delete the middle of a string -
i have text file contains text
data collate unknown null, or data collate unknown not null,
i need delete collate , unknown text file, i'm thinking -replace form of regex way go in way shape or form, can't figure out how keep null or not null.
also note every line in file not contain collate , unknown
i suppose unknown
placeholder number of characters?
then try
$result = $subject -creplace 'data collate .*?((?:not )?null,)', 'data $1'
Comments
Post a Comment