Click here to Skip to main content
15,302,655 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
AnswerRe: regex to replace accents Pin
Peter_in_278016-Sep-21 4:45
professionalPeter_in_278016-Sep-21 4:45 
QuestionRegex Match with Multiple Words, I need you to not use leading and trailing spaces. Pin
Member 1489067816-Sep-21 3:07
MemberMember 1489067816-Sep-21 3:07 
QuestionTrying to match a string with many backslashes Pin
Florian Rammler31-Aug-21 1:35
MemberFlorian Rammler31-Aug-21 1:35 
AnswerRe: Trying to match a string with many backslashes Pin
Richard Deeming31-Aug-21 2:55
mveRichard Deeming31-Aug-21 2:55 
QuestionRegex to match exact word and dash symbol Pin
Member 1533502224-Aug-21 9:28
MemberMember 1533502224-Aug-21 9:28 
AnswerRe: Regex to match exact word and dash symbol Pin
OriginalGriff24-Aug-21 9:32
mveOriginalGriff24-Aug-21 9:32 
GeneralRe: Regex to match exact word and dash symbol Pin
Member 1533502224-Aug-21 10:00
MemberMember 1533502224-Aug-21 10:00 
AnswerRe: Regex to match exact word and dash symbol Pin
User 1521787324-Aug-21 17:47
MemberUser 1521787324-Aug-21 17:47 
Im no ideas what should be captured, so Im guessing that it should include alternates like...
\W*(?i)((?:aug|july|june)(?-i) -)\W*

Except that both \W* are redundant since they allow 0-occurrences, so they dont alter any matched text.
Its best to include samples to keep the experts from guessing, so I will try to save them some troubles...

Capture 'aug' or 'July' or 'JUNE' as whole words if followed by: 1-space, 1-hyphen, 0-or-1 space, and a 1-or-2 digit word.
.*\W(?i)(aug|july|june(?-i)) - ?\d{1,2}\W.*

Capture 'aug -' or 'July -' or 'JUNE -' with the same conditions...
.*\W(?i)((?:aug|july|june(?-i)) -) ?\d{1,2}\W.*

Capture 'aug -##' or 'July - ##' or 'JUNE - ##' with the same conditions...
.*\W(?i)((?:aug|july|june(?-i)) - ?\d{1,2})\W.*

Capture 'aug -' or 'July -' or 'JUNE -' as whole words, but only if - is followed by a non-word character like %.
This does seem the most unlikely, but Im trying to copy your original match, because no samples are being posted...
.*\W(?i)((?:aug|july|june)(?-i) -)\W.*

If none of these match properly, you should include samples of your text lines, and say what should be captured.
There is many experts who is not even going to answer, without first seeing some samples.

GeneralRe: Regex to match exact word and dash symbol Pin
Member 1533502224-Aug-21 22:57
MemberMember 1533502224-Aug-21 22:57 
GeneralRe: Regex to match exact word and dash symbol Pin
User 1521787324-Aug-21 23:32
MemberUser 1521787324-Aug-21 23:32 
GeneralRe: Regex to match exact word and dash symbol Pin
Member 1533502224-Aug-21 23:37
MemberMember 1533502224-Aug-21 23:37 
GeneralRe: Regex to match exact word and dash symbol Pin
User 1521787325-Aug-21 0:08
MemberUser 1521787325-Aug-21 0:08 
GeneralRe: Regex to match exact word and dash symbol Pin
Member 1533502225-Aug-21 0:24
MemberMember 1533502225-Aug-21 0:24 
GeneralRe: Regex to match exact word and dash symbol Pin
User 1521787325-Aug-21 1:11
MemberUser 1521787325-Aug-21 1:11 
QuestionProblem capturing last group in a line: CLOSED Pin
mo149222-Aug-21 13:18
Membermo149222-Aug-21 13:18 
AnswerRe: Problem capturing last group in a line: CLOSED Pin
Richard Deeming22-Aug-21 21:46
mveRichard Deeming22-Aug-21 21:46 
GeneralRe: Problem capturing last group in a line: CLOSED Pin
mo149223-Aug-21 6:17
Membermo149223-Aug-21 6:17 
QuestionEmployer Identification Number (EIN) Regex Pin
Member 153111493-Aug-21 9:49
MemberMember 153111493-Aug-21 9:49 
AnswerRe: Employer Identification Number (EIN) Regex Pin
User 1521787322-Aug-21 2:40
MemberUser 1521787322-Aug-21 2:40 
QuestionRegex select from list Pin
Jukec30-Jun-21 12:33
MemberJukec30-Jun-21 12:33 
AnswerRe: Regex select from list Pin
jschell8-Aug-21 8:27
Memberjschell8-Aug-21 8:27 
QuestionNeed some help with regular expression Pin
Member 1524909515-Jun-21 18:22
MemberMember 1524909515-Jun-21 18:22 
AnswerRe: Need some help with regular expression Pin
Member 1524502415-Jun-21 20:05
MemberMember 1524502415-Jun-21 20:05 
GeneralRe: Need some help with regular expression Pin
Member 1524909515-Jun-21 20:24
MemberMember 1524909515-Jun-21 20:24 
GeneralRe: Need some help with regular expression Pin
Member 1524502415-Jun-21 22:43
MemberMember 1524502415-Jun-21 22:43 

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.