Click here to Skip to main content
12,357,477 members (73,377 online)

Regular Expressions

 
GeneralRe: how to make username regex for windows forms Pin
sariqkhan2-Oct-12 7:22
membersariqkhan2-Oct-12 7:22 
GeneralRe: how to make username regex for windows forms Pin
Manfred R. Bihy3-Oct-12 23:10
mvpManfred R. Bihy3-Oct-12 23:10 
GeneralRe: how to make username regex for windows forms Pin
sariqkhan3-Oct-12 23:27
membersariqkhan3-Oct-12 23:27 
GeneralRe: how to make username regex for windows forms Pin
Manfred R. Bihy4-Oct-12 0:44
mvpManfred R. Bihy4-Oct-12 0:44 
GeneralRe: how to make username regex for windows forms Pin
sariqkhan4-Oct-12 0:55
membersariqkhan4-Oct-12 0:55 
GeneralRe: how to make username regex for windows forms Pin
Manfred R. Bihy4-Oct-12 1:01
mvpManfred R. Bihy4-Oct-12 1:01 
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 
AnswerRe: Either start or not a "d" Pin
Bernhard Hiller6-Mar-12 2:02
memberBernhard Hiller6-Mar-12 2:02 
QuestionTrying to match non-quoted sections Pin
PIEBALDconsult24-Jan-12 4:30
memberPIEBALDconsult24-Jan-12 4:30 
AnswerRe: Trying to match non-quoted sections Pin
Andreas Gieriet7-Apr-12 4:33
memberAndreas Gieriet7-Apr-12 4:33 
GeneralRe: Trying to match non-quoted sections Pin
PIEBALDconsult7-Apr-12 9:17
memberPIEBALDconsult7-Apr-12 9:17 
GeneralRe: Trying to match non-quoted sections Pin
Andreas Gieriet7-Apr-12 11:04
memberAndreas Gieriet7-Apr-12 11:04 
GeneralRe: Trying to match non-quoted sections Pin
PIEBALDconsult9-Apr-12 18:03
memberPIEBALDconsult9-Apr-12 18:03 
GeneralRe: Trying to match non-quoted sections Pin
Andreas Gieriet10-Apr-12 9:59
memberAndreas Gieriet10-Apr-12 9:59 
GeneralRe: Trying to match non-quoted sections Pin
PIEBALDconsult11-Apr-12 3:10
memberPIEBALDconsult11-Apr-12 3:10 
GeneralRe: Trying to match non-quoted sections Pin
Andreas Gieriet11-Apr-12 13:11
memberAndreas Gieriet11-Apr-12 13:11 
GeneralRe: Trying to match non-quoted sections Pin
PIEBALDconsult11-Apr-12 14:45
memberPIEBALDconsult11-Apr-12 14:45 
GeneralRe: Trying to match non-quoted sections Pin
Andreas Gieriet11-Apr-12 21:52
memberAndreas Gieriet11-Apr-12 21:52 
GeneralRe: Trying to match non-quoted sections Pin
Luc Pattyn7-Apr-12 9:43
mvpLuc Pattyn7-Apr-12 9:43 
GeneralRe: Trying to match non-quoted sections Pin
Andreas Gieriet7-Apr-12 10:39
memberAndreas Gieriet7-Apr-12 10:39 
QuestionSomething I just learned, with IP addresses Pin
Timothy CIAN20-Jan-12 6:42
memberTimothy CIAN20-Jan-12 6:42 
AnswerRe: Something I just learned, with IP addresses Pin
Andreas Gieriet7-Apr-12 13:10
memberAndreas Gieriet7-Apr-12 13:10 
QuestionHow to regex this Pin
Jacek Gajek17-Jan-12 12:05
memberJacek Gajek17-Jan-12 12:05 
AnswerRe: How to regex this Pin
Peter_in_278017-Jan-12 12:37
memberPeter_in_278017-Jan-12 12:37 
GeneralRe: How to regex this Pin
Jacek Gajek17-Jan-12 12:55
memberJacek Gajek17-Jan-12 12:55 
AnswerRe: How to regex this Pin
Peter_in_278018-Jan-12 17:41
memberPeter_in_278018-Jan-12 17:41 

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.160621.1 | Last Updated 26 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid