Click here to Skip to main content

Regular Expressions

 
GeneralRe: how to make username regex for windows forms Pinmembersariqkhan2-Oct-12 7:22 
GeneralRe: how to make username regex for windows forms PinmvpManfred R. Bihy3-Oct-12 23:10 
GeneralRe: how to make username regex for windows forms Pinmembersariqkhan3-Oct-12 23:27 
GeneralRe: how to make username regex for windows forms PinmvpManfred R. Bihy4-Oct-12 0:44 
GeneralRe: how to make username regex for windows forms Pinmembersariqkhan4-Oct-12 0:55 
GeneralRe: how to make username regex for windows forms PinmvpManfred R. Bihy4-Oct-12 1:01 
GeneralRe: how to make username regex for windows forms PinmemberPeter_in_27804-Oct-12 2:51 
GeneralRe: how to make username regex for windows forms PinmemberPeter_in_27802-Oct-12 12:36 
Question[SOLVED] C Code Parsing [modified] PinmemberRichard Andrew x645-Sep-12 16:03 
AnswerRe: C Code Parsing PinmemberPeter_in_27805-Sep-12 16:45 
GeneralRe: C Code Parsing PinmemberRichard Andrew x646-Sep-12 10:09 
QuestionRename File Name Help Pinmembertoikken5-Aug-12 18:56 
AnswerRe: Rename File Name Help PinmemberBernhard Hiller5-Aug-12 23:11 
GeneralRe: Rename File Name Help [modified] Pinmembertoikken6-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 PinmemberBernhard Hiller6-Aug-12 20:24 
QuestionSwap two values based on pattern Pinmemberbiop.codeproject2-Aug-12 17:19 
AnswerRe: Swap two values based on pattern PinmemberPeter_in_27802-Aug-12 19:02 
GeneralRe: Swap two values based on pattern Pinmemberbiop.codeproject2-Aug-12 23:43 
GeneralRe: Swap two values based on pattern PinmemberPeter_in_27803-Aug-12 0:08 
GeneralRe: Swap two values based on pattern Pinmemberbiop.codeproject5-Aug-12 16:09 
GeneralRe: Swap two values based on pattern [modified] Pinmemberbiop.codeproject5-Aug-12 17:12 
GeneralRe: Swap two values based on pattern PinmemberPeter_in_27805-Aug-12 17:59 
QuestionRegEx Problem PinmemberKevin Marois19-Jun-12 12:12 
AnswerRe: RegEx Problem [modified] PinprotectorAspDotNetDev19-Jun-12 12:34 
GeneralRe: RegEx Problem PinprotectorAspDotNetDev19-Jun-12 12:52 
GeneralRe: RegEx Problem PinmemberKevin Marois19-Jun-12 13:02 
AnswerRe: RegEx Problem PinprotectorAspDotNetDev19-Jun-12 13:35 
Questioncan someone tell me whats wrong with this expression? [modified] PinmemberChekGuy29-Apr-12 11:48 
AnswerRe: can someone tell me whats wrong with this expression? Pinmemberegenis29-Apr-12 19:22 
AnswerRe: can someone tell me whats wrong with this expression? PinmemberPeter_in_278029-Apr-12 19:46 
QuestionEither start or not a "d" PinmemberBernhard Hiller6-Mar-12 0:50 
AnswerRe: Either start or not a "d" PinmemberBernhard Hiller6-Mar-12 2:02 
QuestionTrying to match non-quoted sections [modified] PinmemberPIEBALDconsult24-Jan-12 4:30 
AnswerRe: Trying to match non-quoted sections PinmemberAndreas Gieriet7-Apr-12 4:33 
GeneralRe: Trying to match non-quoted sections PinmemberPIEBALDconsult7-Apr-12 9:17 
GeneralRe: Trying to match non-quoted sections PinmemberAndreas Gieriet7-Apr-12 11:04 
GeneralRe: Trying to match non-quoted sections PinmemberPIEBALDconsult9-Apr-12 18:03 
GeneralRe: Trying to match non-quoted sections PinmemberAndreas Gieriet10-Apr-12 9:59 
GeneralRe: Trying to match non-quoted sections PinmemberPIEBALDconsult11-Apr-12 3:10 
GeneralRe: Trying to match non-quoted sections PinmemberAndreas Gieriet11-Apr-12 13:11 
GeneralRe: Trying to match non-quoted sections PinmemberPIEBALDconsult11-Apr-12 14:45 
GeneralRe: Trying to match non-quoted sections PinmemberAndreas Gieriet11-Apr-12 21:52 
GeneralRe: Trying to match non-quoted sections PinmvpLuc Pattyn7-Apr-12 9:43 
GeneralRe: Trying to match non-quoted sections [modified] PinmemberAndreas Gieriet7-Apr-12 10:39 
QuestionSomething I just learned, with IP addresses PinmemberTimothy CIAN20-Jan-12 6:42 
AnswerRe: Something I just learned, with IP addresses PinmemberAndreas Gieriet7-Apr-12 13:10 
QuestionHow to regex this PinmemberJacek Gajek17-Jan-12 12:05 
AnswerRe: How to regex this PinmemberPeter_in_278017-Jan-12 12:37 
GeneralRe: How to regex this PinmemberJacek Gajek17-Jan-12 12:55 
AnswerRe: How to regex this PinmemberPeter_in_278018-Jan-12 17:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web03 | 2.8.140721.1 | Last Updated 30 May 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid