Click here to Skip to main content
15,887,214 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
GeneralRe: Exclude Uppercase for conjoined names Pin
Plastmannen3-Oct-23 1:26
Plastmannen3-Oct-23 1:26 
GeneralRe: Exclude Uppercase for conjoined names Pin
trønderen3-Oct-23 8:08
trønderen3-Oct-23 8:08 
GeneralRe: Exclude Uppercase for conjoined names Pin
Richard Deeming3-Oct-23 21:36
mveRichard Deeming3-Oct-23 21:36 
GeneralRe: Exclude Uppercase for conjoined names Pin
trønderen4-Oct-23 8:40
trønderen4-Oct-23 8:40 
GeneralRe: Exclude Uppercase for conjoined names Pin
jschell4-Oct-23 4:58
jschell4-Oct-23 4:58 
AnswerRe: Exclude Uppercase for conjoined names Pin
trønderen4-Oct-23 9:02
trønderen4-Oct-23 9:02 
GeneralRe: Exclude Uppercase for conjoined names Pin
OriginalGriff12-Oct-23 1:02
mveOriginalGriff12-Oct-23 1:02 
Questionlearning regex isn't easy :-) Pin
Kardock18-Sep-23 4:22
Kardock18-Sep-23 4:22 
hi all,

so, I'm new to regex, trying to understand and i admit i'm lost.

here's what i need right now;

i have a list of string where i wish to extract the email address of users, each line looks like this:

DisplayName;Surname;Givenname;Mail;Company

which gives me something like:

$line = 'jsmith;john;smith;john.smith@someemail.com;acme'

since I'm new and not sure how this work, i do these to test and learn, and the results. now i'm trying to understand why the last 2 shown here are failing.

$line -match '\w+' = True
$line -match '\w+;' = true
$line -math '\w+;\w+;' = true
$line -match '\w+;\w+;\w+' = true
$line -match '\w+;\w+;\w+;' = false
$line -match '\w+;\w+;\w+;\.*' = false

at first i thought that this regex would give me the email but it fails.

$regex = '\w+;\w+;\w+;(\w+@\w+);\w+'

thanks for helping me.
AnswerRe: learning regex isn't easy :-) Pin
Richard Deeming18-Sep-23 5:02
mveRichard Deeming18-Sep-23 5:02 
AnswerRe: learning regex isn't easy :-) Pin
k505418-Sep-23 5:33
mvek505418-Sep-23 5:33 
AnswerRe: learning regex isn't easy :-) Pin
jschell18-Sep-23 5:42
jschell18-Sep-23 5:42 
GeneralRe: learning regex isn't easy :-) Pin
Kardock18-Sep-23 6:07
Kardock18-Sep-23 6:07 
AnswerRe: learning regex isn't easy :-) Pin
trønderen18-Sep-23 6:04
trønderen18-Sep-23 6:04 
AnswerRe: learning regex isn't easy :-) Pin
jschell19-Sep-23 5:29
jschell19-Sep-23 5:29 
QuestionMySQL Select query that chooses something dot something between certain underscores Pin
User 1447141414-Sep-23 6:12
User 1447141414-Sep-23 6:12 
AnswerRe: MySQL Select query that chooses something dot something between certain underscores Pin
RedDk14-Sep-23 6:36
RedDk14-Sep-23 6:36 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
User 1447141418-Sep-23 4:28
User 1447141418-Sep-23 4:28 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
RedDk18-Sep-23 7:23
RedDk18-Sep-23 7:23 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
User 1447141418-Sep-23 23:16
User 1447141418-Sep-23 23:16 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
Richard MacCutchan19-Sep-23 1:45
mveRichard MacCutchan19-Sep-23 1:45 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
User 1447141419-Sep-23 4:46
User 1447141419-Sep-23 4:46 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
Richard MacCutchan19-Sep-23 5:30
mveRichard MacCutchan19-Sep-23 5:30 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
User 1447141420-Sep-23 2:17
User 1447141420-Sep-23 2:17 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
Richard MacCutchan20-Sep-23 2:31
mveRichard MacCutchan20-Sep-23 2:31 
GeneralRe: MySQL Select query that chooses something dot something between certain underscores Pin
RedDk21-Sep-23 7:17
RedDk21-Sep-23 7:17 

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.