Click here to Skip to main content
15,846,343 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
GeneralRe: Replacement of initial words Pin
Terry R 202313-Oct-23 10:22
Terry R 202313-Oct-23 10:22 
GeneralRe: Replacement of initial words Pin
OriginalGriff12-Oct-23 3:38
mveOriginalGriff12-Oct-23 3:38 
AnswerRe: Replacement of initial words Pin
jschell12-Oct-23 6:21
jschell12-Oct-23 6:21 
QuestionRegular Expression for a repeating pattern? Pin
Les Stockton6-Oct-23 8:50
Les Stockton6-Oct-23 8:50 
AnswerRe: Regular Expression for a repeating pattern? Pin
PIEBALDconsult6-Oct-23 8:59
mvePIEBALDconsult6-Oct-23 8:59 
AnswerRe: Regular Expression for a repeating pattern? Pin
RedDk6-Oct-23 9:08
RedDk6-Oct-23 9:08 
AnswerRe: Regular Expression for a repeating pattern? Pin
jschell9-Oct-23 6:26
jschell9-Oct-23 6:26 
AnswerRe: Regular Expression for a repeating pattern? Pin
k50549-Oct-23 7:12
mvek50549-Oct-23 7:12 
In general, trying to parse XML (or HTML) with regex is not a good idea, and almost certainly doomed to failure. However, to match this specific case you might try:
RegEx
<span>(&nbsp; *)+</span>"
That's an extended POSIX regex, and seems to do the job. It matches any of the following:
XML
<span>&nbsp;</span>
<span>&nbsp; </span>
<span>&nbsp; &nbsp; </span>
<span>&nbsp; &nbsp; &nbsp; </span>
<span>&nbsp;&nbsp; &nbsp;</span>
If you need to accept any white space you might try using (&nbsp;[[:space:]]*) as the sub-pattern.
If you may have line breaks in the span text, then you may need to tell your regex engine to not treat them as end-of-text markers.
Keep Calm and Carry On

QuestionExclude Uppercase for conjoined names Pin
Plastmannen2-Oct-23 23:08
Plastmannen2-Oct-23 23:08 
AnswerRe: Exclude Uppercase for conjoined names Pin
OriginalGriff2-Oct-23 23:20
mveOriginalGriff2-Oct-23 23:20 
GeneralRe: Exclude Uppercase for conjoined names Pin
Plastmannen3-Oct-23 0:25
Plastmannen3-Oct-23 0:25 
GeneralRe: Exclude Uppercase for conjoined names Pin
OriginalGriff3-Oct-23 1:42
mveOriginalGriff3-Oct-23 1:42 
GeneralRe: Exclude Uppercase for conjoined names Pin
Plastmannen3-Oct-23 2:04
Plastmannen3-Oct-23 2:04 
SuggestionRe: Exclude Uppercase for conjoined names Pin
Richard Deeming3-Oct-23 0:53
mveRichard Deeming3-Oct-23 0:53 
GeneralRe: Exclude Uppercase for conjoined names Pin
Plastmannen3-Oct-23 2:26
Plastmannen3-Oct-23 2:26 
GeneralRe: Exclude Uppercase for conjoined names Pin
trønderen3-Oct-23 9:08
trønderen3-Oct-23 9:08 
GeneralRe: Exclude Uppercase for conjoined names Pin
Richard Deeming3-Oct-23 22:36
mveRichard Deeming3-Oct-23 22:36 
GeneralRe: Exclude Uppercase for conjoined names Pin
trønderen4-Oct-23 9:40
trønderen4-Oct-23 9:40 
GeneralRe: Exclude Uppercase for conjoined names Pin
jschell4-Oct-23 5:58
jschell4-Oct-23 5:58 
AnswerRe: Exclude Uppercase for conjoined names Pin
trønderen4-Oct-23 10:02
trønderen4-Oct-23 10:02 
GeneralRe: Exclude Uppercase for conjoined names Pin
OriginalGriff12-Oct-23 2:02
mveOriginalGriff12-Oct-23 2:02 
Questionlearning regex isn't easy :-) Pin
Kardock18-Sep-23 5:22
Kardock18-Sep-23 5:22 
AnswerRe: learning regex isn't easy :-) Pin
Richard Deeming18-Sep-23 6:02
mveRichard Deeming18-Sep-23 6:02 
AnswerRe: learning regex isn't easy :-) Pin
k505418-Sep-23 6:33
mvek505418-Sep-23 6:33 
AnswerRe: learning regex isn't easy :-) Pin
jschell18-Sep-23 6:42
jschell18-Sep-23 6:42 

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.