Using mulitple wildcard for replace
Posted: Mon Feb 05, 2007 11:48 pm
Hi,
Thank you for your help on my last question. I was doing fine until this.
I want to capture the author name from the <p>by: fname lname</p> line and place into the Author meta tag.
My existing html document: (the jave code is one line and no special characters).
<meta name="Author" content="someone @ the-internet.com" />
<meta name="Robots" content="noindex,nofollow" />
<link rel="stylesheet" href="../stylesheet.css" type="text/css" />
</head>
<script language="JavaScript1.2">
function run()
{
some java code here
}
</script>
<body>
<!-- Article Start -->
<h1>10 Article Writing Quirks</h1>
<!-- Author -->
<p>by: Nicholas Dixon</p>
<p>Much has been touted about... rest of the file
This is the RE I tried:
search for: <meta name="Author" content="(.*)" />\r\n(.*)<!-- Author -->\r\n<p>by: (.*)</p>\r\n
replace with: <meta name="Author" content="$3" />\r\n$2<!-- Author -->\r\n<p>by: $3</p>\r\n
The result is:
<meta name="Author" content="Nicholas Dixon</p>
<p>Much has been touted about... rest of the file
I tried modifiers S,G and S,G,M.
You know, I turned off the S and M modifier and it worked! So no need to reply - thanks
Thanks in advance.
Thank you for your help on my last question. I was doing fine until this.
I want to capture the author name from the <p>by: fname lname</p> line and place into the Author meta tag.
My existing html document: (the jave code is one line and no special characters).
<meta name="Author" content="someone @ the-internet.com" />
<meta name="Robots" content="noindex,nofollow" />
<link rel="stylesheet" href="../stylesheet.css" type="text/css" />
</head>
<script language="JavaScript1.2">
function run()
{
some java code here
}
</script>
<body>
<!-- Article Start -->
<h1>10 Article Writing Quirks</h1>
<!-- Author -->
<p>by: Nicholas Dixon</p>
<p>Much has been touted about... rest of the file
This is the RE I tried:
search for: <meta name="Author" content="(.*)" />\r\n(.*)<!-- Author -->\r\n<p>by: (.*)</p>\r\n
replace with: <meta name="Author" content="$3" />\r\n$2<!-- Author -->\r\n<p>by: $3</p>\r\n
The result is:
<meta name="Author" content="Nicholas Dixon</p>
<p>Much has been touted about... rest of the file
I tried modifiers S,G and S,G,M.
You know, I turned off the S and M modifier and it worked! So no need to reply - thanks
Thanks in advance.