Post Locked by Robert Harvey
Notice added Comments only by Robert Harvey
Notice removed Historical significance by Robert Harvey
Post Unlocked by Robert Harvey
Notice added Historical significance by Robert Harvey
Post Locked by Robert Harvey
Notice removed Reward existing answer by ThiefMaster
Bounty Ended with Kaitlin Duck Sherwood's answer chosen by ThiefMaster
edited tags
Link
richarbernal
  • 1.1k
  • 2
  • 14
  • 31
Notice added Reward existing answer by ThiefMaster
Bounty Started worth 50 reputation by ThiefMaster
Rollback to Revision 9
Source Link
Alan Moore
  • 70.8k
  • 12
  • 91
  • 153

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br />
<hr class="foo" />

I came up with this and wanted to make sure I've got it right. I am only capturing the 'a-z'a-z.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except /, then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br/>
<hr class="foo"/>

I came up with this and wanted to make sure I've got it right. I am only capturing the 'a-z'.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except / then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br />
<hr class="foo" />

I came up with this and wanted to make sure I've got it right. I am only capturing the a-z.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except /, then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

improved formatting
Source Link

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br />
<hr class="foo" />

I came up with this and wanted to make sure I've got it right. I am only capturing the a-z'a-z'.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except /, then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br />
<hr class="foo" />

I came up with this and wanted to make sure I've got it right. I am only capturing the a-z.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except /, then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

I need to match all of these opening tags:

<p>
<a href="foo">

But not these:

<br/>
<hr class="foo"/>

I came up with this and wanted to make sure I've got it right. I am only capturing the 'a-z'.

<([a-z]+) *[^/]*?>

I believe it says:

  • Find a less-than, then
  • Find (and capture) a-z one or more times, then
  • Find zero or more spaces, then
  • Find any character zero or more times, greedy, except / then
  • Find a greater-than

Do I have that right? And more importantly, what do you think?

Notice removed Draw attention by casperOne
Notice added Draw attention by Jeremy
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by YOU
Bounty Started worth 50 reputation by YOU
Removed unnecessary smiley.
Source Link
please delete me
  • 801
  • 2
  • 13
  • 29
Loading
You do not need to rollback to revision 1, be a little more discriminating please.
Source Link
Lance Roberts
  • 21.7k
  • 30
  • 108
  • 129
Loading
Rollback to Revision 1
Source Link
giodamelio
  • 5.2k
  • 14
  • 41
  • 70
Loading
Question Protected by user1228
Question Unprotected by Bill the Lizard
Question Protected by Bill the Lizard