Click here to Skip to main content
12,898,516 members (64,865 online)

Regular Expressions

 
GeneralRe: how to make username regex for windows forms Pin
Peter_in_27804-Oct-12 2:51
memberPeter_in_27804-Oct-12 2:51 
GeneralRe: how to make username regex for windows forms Pin
Peter_in_27802-Oct-12 12:36
memberPeter_in_27802-Oct-12 12:36 
Question[SOLVED] C Code Parsing Pin
Richard Andrew x645-Sep-12 16:03
memberRichard Andrew x645-Sep-12 16:03 
AnswerRe: C Code Parsing Pin
Peter_in_27805-Sep-12 16:45
memberPeter_in_27805-Sep-12 16:45 
GeneralRe: C Code Parsing Pin
Richard Andrew x646-Sep-12 10:09
memberRichard Andrew x646-Sep-12 10:09 
QuestionRename File Name Help Pin
toikken5-Aug-12 18:56
membertoikken5-Aug-12 18:56 
AnswerRe: Rename File Name Help Pin
Bernhard Hiller5-Aug-12 23:11
memberBernhard Hiller5-Aug-12 23:11 
GeneralRe: Rename File Name Help Pin
toikken6-Aug-12 15:05
membertoikken6-Aug-12 15:05 
Thank you for your reply Bernhard and introduction to system io.

Currently, I am using a free file renaming tool that utilize regexp. After looking at the coding and re-familiarizing myself with regexp and having no luck, I made a post. The next morning, I came with a quasi-solution. I do not want to spam the tool but it is the most complex rfr*k according to review.

What unique about this file title renaming is the number of seperators can vary. Thus, mp3 titles with challenging non-fix number of seperators would find this thread informative. I am stump trying to access the last seperator with $ anchor to create an expression and thus sent this sos.

Here is my quasi-solution and hope it helps some with similar problem.

(?x)(.*?)[ ]*?[-]+[ ]*?(.*) [ ]*?[-]+[ ]*?(.*) # start of swap 2 fields \3 zzzz \2 zzzz \1
(?x)[ ]*[-][ ] # Handle Linaries example _
(?x)(.*?)[ ]*?[_]+[ ]*?(.*)$ # Linaries example \2 zzzz \1
\bzzzz\b # Convert back to minus sign -
(.?)\bwmv\b # remove the .wmv after the author name to null

I use zzzz and _ as temporary strings with the understanding that they are unique in my files. Adapt accordingly. I adapted from a swap 2 fields expression. The five lines and replace work for my demo example. Thanks.

Edit: Some minor quirks but liveable. tx

modified 6-Aug-12 23:05pm.

GeneralRe: Rename File Name Help Pin
Bernhard Hiller6-Aug-12 20:24
memberBernhard Hiller6-Aug-12 20:24 
QuestionSwap two values based on pattern Pin
biop.codeproject2-Aug-12 17:19
memberbiop.codeproject2-Aug-12 17:19 
AnswerRe: Swap two values based on pattern Pin
Peter_in_27802-Aug-12 19:02
memberPeter_in_27802-Aug-12 19:02 
GeneralRe: Swap two values based on pattern Pin
biop.codeproject2-Aug-12 23:43
memberbiop.codeproject2-Aug-12 23:43 
GeneralRe: Swap two values based on pattern Pin
Peter_in_27803-Aug-12 0:08
memberPeter_in_27803-Aug-12 0:08 
GeneralRe: Swap two values based on pattern Pin
biop.codeproject5-Aug-12 16:09
memberbiop.codeproject5-Aug-12 16:09 
GeneralRe: Swap two values based on pattern Pin
biop.codeproject5-Aug-12 17:12
memberbiop.codeproject5-Aug-12 17:12 
GeneralRe: Swap two values based on pattern Pin
Peter_in_27805-Aug-12 17:59
memberPeter_in_27805-Aug-12 17:59 
QuestionRegEx Problem Pin
Kevin Marois19-Jun-12 12:12
memberKevin Marois19-Jun-12 12:12 
AnswerRe: RegEx Problem Pin
AspDotNetDev19-Jun-12 12:34
protectorAspDotNetDev19-Jun-12 12:34 
GeneralRe: RegEx Problem Pin
AspDotNetDev19-Jun-12 12:52
protectorAspDotNetDev19-Jun-12 12:52 
GeneralRe: RegEx Problem Pin
Kevin Marois19-Jun-12 13:02
memberKevin Marois19-Jun-12 13:02 
AnswerRe: RegEx Problem Pin
AspDotNetDev19-Jun-12 13:35
protectorAspDotNetDev19-Jun-12 13:35 
Questioncan someone tell me whats wrong with this expression? Pin
ChekGuy29-Apr-12 11:48
memberChekGuy29-Apr-12 11:48 
AnswerRe: can someone tell me whats wrong with this expression? Pin
egenis29-Apr-12 19:22
memberegenis29-Apr-12 19:22 
AnswerRe: can someone tell me whats wrong with this expression? Pin
Peter_in_278029-Apr-12 19:46
memberPeter_in_278029-Apr-12 19:46 
QuestionEither start or not a "d" Pin
Bernhard Hiller6-Mar-12 0:50
memberBernhard Hiller6-Mar-12 0:50 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 1 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid