473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help for Regex Expression

Hi,
I have the expression
"<font[^>]+>""([^""]*)""</font>[^?]+\?AUTHOR_ID=[0-9]+"">([^<]*)</a>"
Any body can tell me what is the meaning of that expression and what is the output of the expression.
Regards,
Muhammad Jamil Nawaz
Nov 19 '05 #1
1 1151
It would match the following text:
<font size="2">""hello""</font><a
href="view.aspx?AUTHOR_ID=56789"">click here</a>

In this case, the following text could be anything, and I've just
provided samples:
size="2"
hello
view.aspx
click here

This regex captures two strings - the text inside the font tags and the
text inside the link. In this case, there would be two captured
strings:
hello
click here

This looks wrong to me - the double quotes ("") should probably be
single quotes ("):
<font[^>]+>"([^"]*)"</font>[^?]+\?AUTHOR_ID=[0-9]+">([^<]*)</a>

One trick to figure out a difficult Regex is to use Regulator's
analyzer output (http://regex.osherove.com/). The output in this case
is as follows:

<font
Any character not in ">"
+ (one or more times)
""

Capture
Any character not in """"
* (zero or more times)
End Capture
""</font>
Any character not in "?"
+ (one or more times)
?AUTHOR_ID=
Any character in "0-9"
+ (one or more times)
"">
Capture
Any character not in "<"
* (zero or more times)
End Capture
</a>

- Jon
http://weblogs.asp.net/jgalloway

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: alexstevens | last post by:
Hi All. I'm using some C# code which I translated to vb.net to remove sourcesafe information from project and solution files. It uses regular expressions, and the attempt I made at translating...
5
by: Bradley Plett | last post by:
I'm hopeless at regular expressions (I just don't use them often enough to gain/maintain knowledge), but I need one now and am looking for help. I need to parse through a document to find a URL,...
2
by: Julie | last post by:
I'm an admitted regex moron, but I need help w/ an expression for parsing. Here is the input string: (123.45)ABC(44.55) with a regex expression of \(|\)
5
by: Mahesha | last post by:
Hello, I need help in replacing one string pattern with another. Ex: I have a financial security expression like log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002) Here "T 3.25 6/24/2004" is a...
6
by: Dave | last post by:
I'm struggling with something that should be fairly simple. I just don't know the regext syntax very well, unfortunately. I'd like to parse words out of what is basically a boolean search...
3
by: Joe | last post by:
Hi, I have been using a regular expression that I don’t uite understand to filter the valid email address. My regular expression is as follows: <asp:RegularExpressionValidator...
4
by: henrik | last post by:
Hi I have a regex question. I want to find all content of a <td class="someclass"> tag. This means the expression should include all other tags included between <td class="someclass"> and </td>....
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
4
by: MooMaster | last post by:
I'm trying to develop a little script that does some string manipulation. I have some few hundred strings that currently look like this: cond(a,b,c) and I want them to look like this: ...
4
by: carlos | last post by:
I am working on a regular expression validation for my search page. What I have so far works for most cases, but I would like to fine tune it some. I am new to regular expressions, and I do not...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.