Click here to Skip to main content
15,884,176 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
QuestionRe: Regex with condition? Should be easy Pin
Richard MacCutchan21-Feb-22 21:10
mveRichard MacCutchan21-Feb-22 21:10 
AnswerRe: Regex with condition? Should be easy Pin
Peter_in_278021-Feb-22 23:03
professionalPeter_in_278021-Feb-22 23:03 
GeneralRe: Regex with condition? Should be easy Pin
Richard MacCutchan23-Feb-22 3:03
mveRichard MacCutchan23-Feb-22 3:03 
GeneralRe: Regex with condition? Should be easy Pin
Peter_in_278023-Feb-22 13:42
professionalPeter_in_278023-Feb-22 13:42 
GeneralRe: Regex with condition? Should be easy Pin
Cp Divers22-Feb-22 4:06
Cp Divers22-Feb-22 4:06 
GeneralRe: Regex with condition? Should be easy Pin
Peter_in_278022-Feb-22 12:40
professionalPeter_in_278022-Feb-22 12:40 
Question06h36m03s to 06h36.1, etc., in filename via regex? Pin
Member 148351468-Feb-22 10:02
Member 148351468-Feb-22 10:02 
AnswerRe: 06h36m03s to 06h36.1, etc., in filename via regex? Pin
Richard Deeming8-Feb-22 22:12
mveRichard Deeming8-Feb-22 22:12 
A regular expression to match the seconds is trivial: m\d+s.

The problem is that a regular expression works on a single string. There is no way for a pure regex solution to group the files by the start of the name and then apply a sequential number, because the regex only sees one filename at a time, and doesn't maintain any state between invocations.

If you want to do this in code, it should be fairly easy, but you'd need to specify which language you were using.

If you want to use a renamer tool, you'll need to consult the documentation to see if it can do this sort of thing, and if so, how.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: 06h36m03s to 06h36.1, etc., in filename via regex? Pin
Member 148351467-Mar-22 21:52
Member 148351467-Mar-22 21:52 
AnswerRe: 06h36m03s to 06h36.1, etc., in filename via regex? Pin
RedDk8-Mar-22 8:18
RedDk8-Mar-22 8:18 
QuestionUse content of a database field in RegEx Pin
John Bradford 202227-Jan-22 7:31
John Bradford 202227-Jan-22 7:31 
AnswerRe: Matching a unknown range of lines Pin
Pete O'Hanlon18-Jan-22 22:37
mvePete O'Hanlon18-Jan-22 22:37 
Questionregex related query Pin
Member 154859391-Jan-22 8:23
Member 154859391-Jan-22 8:23 
AnswerRe: regex related query Pin
Gerry Schmitz1-Jan-22 8:45
mveGerry Schmitz1-Jan-22 8:45 
QuestionFind and Replace starting... until Pin
Roland Plomp31-Dec-21 4:11
Roland Plomp31-Dec-21 4:11 
QuestionHow do I make this CASE INSENSATIVE? Pin
RapidDonO23-Dec-21 1:13
RapidDonO23-Dec-21 1:13 
AnswerRe: How do I make this CASE INSENSATIVE? Pin
jschell23-Dec-21 6:09
jschell23-Dec-21 6:09 
QuestionHow to eliminate Pattern if Contains specific words Pin
RapidDonO20-Dec-21 5:30
RapidDonO20-Dec-21 5:30 
AnswerRe: How to eliminate Pattern if Contains specific words Pin
Richard Deeming3-Jan-22 23:32
mveRichard Deeming3-Jan-22 23:32 
QuestionRegular expression to extract row 3 Pin
DanVanClan17-Nov-21 2:53
DanVanClan17-Nov-21 2:53 
Questionfail2ban regex matching on testing sites but not fail2ban itself Pin
murdocklawless4-Nov-21 1:07
murdocklawless4-Nov-21 1:07 
AnswerRe: fail2ban regex matching on testing sites but not fail2ban itself Pin
Richard MacCutchan4-Nov-21 2:07
mveRichard MacCutchan4-Nov-21 2:07 
GeneralRe: fail2ban regex matching on testing sites but not fail2ban itself Pin
murdocklawless4-Nov-21 2:49
murdocklawless4-Nov-21 2:49 
AnswerRe: fail2ban regex matching on testing sites but not fail2ban itself Pin
Peter_in_27804-Nov-21 3:17
professionalPeter_in_27804-Nov-21 3:17 
GeneralRe: fail2ban regex matching on testing sites but not fail2ban itself Pin
murdocklawless4-Nov-21 3:31
murdocklawless4-Nov-21 3:31 

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.