Complex Regex Problem

I am trying to write a regex function that will find all html tags with an id= value and get it to return the tag and value of the id.

i.e. <a href="blah.htm" id="someLink"> would return
a someLink

Any help would be greatly appreciated, this has got me very frustrated.

It will most likley be a very simple thing that I have missed.

View Replies


ADVERTISEMENT

Complex Query

ID From To Date
1 Tom User1 10.10.2004
3 Tom User1 10.11.2004
4 Tom User3 10.08.2004
5 Tom User2 10.05.2004
6 Tom User2 10.10.2004
7 Tom User2 10.11.2004


Tom sent messages to him friends.
He sent messages to User1 for 2 times.
to User3 for 1 time
to User2 for 3 times..

I want to show to Tom how many messages he have send so far.

the quene is much more important for me.

I need like above.

You sent messages to User2 for 3 times
You sent messages to User1 for 2 times
You sent messages to User3 for 1 time

the important thing in the quene is that "who Tom sent messages to most?"

how can it be with only one sql query?

View Replies View Related

ASP/VERY COMPLEX MSSQL

I have a query to one table but one of the values in the table is referencing a record from another table... here is the sql Code:

strSql = "SELECT streetdate, barcode, itemname, descrip, vendor, sku, catlog, config, retail_cost, cost FROM blah WHERE (STREETDATE >='"& GSTARTDATE &"') AND (STREETDATE <='"& GENDDATE &"') ORDER BY STREETDATE, CATLOG DESC"

now I have 2 things going on here...
1. vendor is just a number... there is a tblvendor that matches the number with a name (that i need.. i coudl nest another db query but figured that would be more resource intensive as this returns 1000s of records)
2. itemname is also a number that references another tblItem the sam way, I woul dlike to sort alphabetical off this somehow (is it even possable)

View Replies View Related

Complex Redirect 301

I have a blog who created pages this way: article.asp?id=222
and I'm using a sort of asp urlrewrite. It works perfectly with creating the articles etc, but now I have to put a "301 moved permanently" in the old article.asp page.

I have a function which converts the title of the article to a page name, using title and id: Code:

View Replies View Related

Displaying Complex One To Many Relationship

I want to display a kind of two-tier one-to-many relationship, for
which, in the olden days, I would have used a series of nested loops
and multiple calls to the db. Code:

View Replies View Related

Building Up Complex Search

I am currently using a single list box and select case to carry out a search for resources on my website. I would like to improve my search by adding two or three more drop down menus to achieve a single, more detailed search.

Hopefully this will help the end user find what they are looking for. unfortunately the current search is rather broad and i need to narrow it down. How do i go about achieving this?

View Replies View Related

Complex Data-source Question

I have knowledge of programming ASP pages, HTML, Vbscript and making/connecting to MySQL databases with SQL queries. I am prepared to learn new things if they are required, but ideally if it can be done using the above, or slight additions to the above it would be great!

I would like to get data off of the web. What I mean by this is that there might be a site that has a table on it. Is it possible to make a script take data out of the browser window (just thinking about it sounds difficult!).

If not, is there an easy way to get a script to dump the information (i.e. the source code of the page) into a .txt file or something that can be read by a script. Alternatively, would automating the pasting of the table into an excel spreadsheet be possible. Code:

View Replies View Related

Regex

I have been trying for days to learn regex, can't seem to get to grips with it at all .

Basically I need to remove all text between strings.

abcdef <mytag>ghijkl</mytag> mnopqr

would be left with

abcdef mnopqr

View Replies View Related

ASP Regex

I am struggling to find a solution to a relatively easy problem I have a string which contains a date in the format of: 20 Sep 2007 14:24

I would like to strip everything off after the month, so I am left with '20 Sep' is there an easy way to do this?

View Replies View Related

RegEx

I have a text search which reads a textfile and displays each line that has a value the user is searching for. It's practically finished except when it searchs it doesn't look for exact matches (e.g a searh for Ali would return Alison or Alice).

How would i go about using RegEx's to prevent this by making the search look for the exact word entered? Code:

View Replies View Related

Regex

I have this pattern to filter out bad words

regx.Pattern = "darn|dick|swear|blahblah"

it works, but in case of the word "dickinson"
the wordfilter also replaces dick in dickinson d***inson,

so i thought i could try this pattern

regx.Pattern = "darn|dick|swear|blahblah"

but no change, i've tested the regex with a similar PHP script and the  operator works.

any clues why it wont work in asp?

View Replies View Related

RegEx

I am trying to do some custom forum code, like using [ b ] as a tag and replacing it later using RegEx. The problem is, its not replacing quite right. Its leaving in the []s and its not closing some of the tags.

Here is my pattern: "[ b ]((.|
)*?)[/ b ]"
Here is my replace text: "<b>$1</b>"

Here is some sample text: "yada yada yada [ b ]hey![/ b ] yada yada"

Now, another thing, I would like it to close tags if they aren't closed properly. Is this possible?

View Replies View Related

Regex

im trying to use Regex to replace some text in my string. I want to replace some text to html tags eg. [b] to <b>, [u] to <u>.

How can I please use like a wildcard for the letter in between the tags. What am i doing wrong in this code, should i replace $1$2 to something else please: Code:

View Replies View Related

VBScript RegEx

I made a regular expression to match Guitar Chords.

[A-G](#|b)?([a-z]|[0-9])*

This pattern should find any of the following:

1) G
2) Gmaj
3) G7
4) G#
5) Gb
6) G#min

The pattern works for all of these except for #4. For some reason it will only return the 'G' instead of the full 'G#'. I find this very odd because if the chord is 'Gb', the regex will return the full 'Gb'.This pattern works fine in javascript. Is there anything special with the '#' character in RegEx for VBScript? I am using VBscript engine 5.6

View Replies View Related

RegEx Problems

I'm using regular expressions to identify in a string an url ad format it in hyperlink.

The problem is that in the same string should be bbcodes and the [url] one tooo... so when the regexp will format the code will format the one in bbcode too.

The solution would be the lookaround function of RegEx to see if behind the match there is the [url] code... but it's not implemented in VisualBasicScript. Is there any way to use this function in my script ?

View Replies View Related

RegEx And .pattern

Is it possible to have more then one pattern for the .pattern variable. If I'm to execute and search and replace on a specific string can I make it so my .pattern will ignore specific keywords and not just A keyword?

View Replies View Related

RegEx.Repalce

i have text, in it i want to highlight the words user used to find this result.
i used the normal replace, it worked fine except the case thing..

SearchForSp = Split(SearchFor, " ")
For i = 0 to Ubound(SearchForSp)
EmpJobsText = Replace(EmpJobsText, SearchForSp(i), "<strong><u><font
color=red>"&SearchForSp(i)&"</font></u></strong>", vbTextCompare)
EmpJobsText
next

i tried to use the regEx.Repalce from the examples in groups but just couldn't find a way. problem is in the normal replace function i have option to supply a source. in this case "EmpJobsText" is the source. but regEx.Repalce don't seem to have place to type where to replace, only what to replace with what.

View Replies View Related

Quick Regex Question

I need a pattern to do this:

"?caid=[0-9]+&pgid=oRS("pgId")"

Where [0-9]+ means you need atleast 1 number there, the rest is just a string plus my recordset's variable. I know this syntax would work with the regex I learned at school but I'm not sure how to make it work in ASP.

View Replies View Related

Checking A String, RegEx

I have a string that I want to check to be sure there are no single or double quotes in it. Using RegEx should be possible but I cannot figure out how the syntax should go.
I am programming in ASP.NET with C# as the code behind.
here is one I know works to be sure there are only numbers in the string, but i can not for the life of me figure out the right syntax for quotes

View Replies View Related

Regex Replace Question

I have the following regex replace:

putDefInThis = RegExpReplace(putDefInThis, strPattern, "<a href=""" & lcase(replace("$1"," ","-")) & ".asp"">$1</a>")

The problem is that i can not get the vb replace to work on the "$1" in the url. $1 is such that it can be multiple words separated by a space. for the href, I need to convert the space to "-". It does not do that with the way I hvae the code above.

View Replies View Related

Adding An Apostrophe To RegEx Patterns

how to add the symbol ' (Apostrophe) to the code so that the validation accepts this within a surname such as o'neill? this is wot i hav at the minute:

With regExName
.Pattern = "^[a-z]+$"
.IgnoreCase = true
.Global = true
End With

View Replies View Related

Regex :: To Allow Lowercase And Uppercase Letter, And Numbers?

What's a way (like, for a username) to allow lowercase and uppercase letter, and numbers?

Code:

objRegExp.Pattern = "[a-z][0-9]"
objRegExp.Global = True
objRegExp.IgnoreCase = True

That's what I have, but I want to make the letters or numbers OPTIONAL, but right now they are required. how can I fix that?

View Replies View Related

Definitive Regex Reserved Character List

Can someone tell the ALL the reserved characters for regex?

View Replies View Related

Regex :: Grab Any Style Attribute Within HTML That Uses Double Quotes

I have the following regular expression:

re.Pattern = "style[^=]*=[^""]*""[^""]*"""

It will grab any style attribute within HTML that uses double quotes, and put it in the re.Matches collection.Now, I want to include single quotes into this regular expression. Here's what I have so far:

re.Pattern = "style[^=]*=[^""']*(""|')[^1]*1"

but it does not work.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved