Click here to Skip to main content
15,885,216 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
AnswerRe: Regex search to find and remove consecutive lines which end with same characters Pin
jschell14-Nov-22 6:43
jschell14-Nov-22 6:43 
You cannot do what you are asking with a regular expression.
(There is in fact a very wrong way to attempt this which is ridiculous and would lead to nothing but a maintenance nightmare.)

However in a programming language that uses regexes the algorithm that you would create would look like the following
1. Read a line
2. Parse the line to remove the timestamp.
3. Does it match the previous one? (Do whatever you want)
4. Otherwise save it for the next time
5. Go back to step 1 until there are no more lines to read.
QuestionRemoving + - chars if lines are starting with them only Pin
montaigne gremo2-Nov-22 2:32
montaigne gremo2-Nov-22 2:32 
AnswerRe: Removing + - chars if lines are starting with them only Pin
jschell14-Nov-22 6:39
jschell14-Nov-22 6:39 
QuestionFind the 4th last object in this campaign Pin
Michael Oct202220-Oct-22 3:05
Michael Oct202220-Oct-22 3:05 
AnswerRe: Find the 4th last object in this campaign Pin
Richard Deeming20-Oct-22 4:28
mveRichard Deeming20-Oct-22 4:28 
GeneralRe: Find the 4th last object in this campaign Pin
Michael Oct202220-Oct-22 5:04
Michael Oct202220-Oct-22 5:04 
QuestionSplitting with optionally second line Pin
G-Team2329-Sep-22 2:47
G-Team2329-Sep-22 2:47 
AnswerRe: Splitting with optionally second line Pin
Richard Deeming29-Sep-22 3:11
mveRichard Deeming29-Sep-22 3:11 
GeneralRe: Splitting with optionally second line Pin
G-Team2330-Sep-22 0:19
G-Team2330-Sep-22 0:19 
QuestionIs there a way to come up with a regular expression for this? Pin
fame_crane23-Sep-22 4:28
fame_crane23-Sep-22 4:28 
AnswerRe: Is there a way to come up with a regular expression for this? Pin
Gerry Schmitz23-Sep-22 5:56
mveGerry Schmitz23-Sep-22 5:56 
Questionremove parenthese from function like string Pin
Michael Eckstein17-Sep-22 8:56
Michael Eckstein17-Sep-22 8:56 
AnswerRe: remove parenthese from function like string Pin
moxol17-Sep-22 10:43
moxol17-Sep-22 10:43 
GeneralRe: remove parenthese from function like string Pin
Michael Eckstein18-Sep-22 4:55
Michael Eckstein18-Sep-22 4:55 
GeneralRe: remove parenthese from function like string Pin
moxol18-Sep-22 7:28
moxol18-Sep-22 7:28 
GeneralRe: remove parenthese from function like string Pin
Michael Eckstein18-Sep-22 8:01
Michael Eckstein18-Sep-22 8:01 
GeneralRe: remove parenthese from function like string Pin
moxol18-Sep-22 9:19
moxol18-Sep-22 9:19 
GeneralRe: remove parenthese from function like string Pin
Michael Eckstein18-Sep-22 20:22
Michael Eckstein18-Sep-22 20:22 
QuestionRegex to find out length Pin
RanCohen15-Aug-22 23:50
RanCohen15-Aug-22 23:50 
AnswerRe: Regex to find out length Pin
Richard Deeming16-Aug-22 0:14
mveRichard Deeming16-Aug-22 0:14 
AnswerRe: Regex to find out length Pin
Graham Breach16-Aug-22 2:12
Graham Breach16-Aug-22 2:12 
QuestionNon Zero Number Pin
cad-one26-Jul-22 8:11
cad-one26-Jul-22 8:11 
AnswerRe: Non Zero Number Pin
k505426-Jul-22 10:46
mvek505426-Jul-22 10:46 
GeneralRe: Non Zero Number Pin
cad-one26-Jul-22 11:09
cad-one26-Jul-22 11:09 
QuestionRegex before match Pin
moxol20-Jul-22 22:09
moxol20-Jul-22 22:09 

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.