match

How to match multiple lines with Regex in C#?

I have the following text: --------------030805090908050805080502 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <[email protected]> /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA QBQH/9k= --...

Python: list and string matching

Hi All, I have following: temp = "aaaab123xyz@+" lists = ["abc", "123.35", "xyz", "AND+"] for list in lists if re.match(list, temp, re.I): print "The %s is within %s." % (list,temp) The re.match is only match the beginning of the string, How to I match substring in between too. ...

jquery Autocomplete : autocomplete does not stop if string does not match

I used the auto-complete function in jquery. It's data source are the results from a php-back-end. $("#ice_id").autocomplete("ice-ver.php", { extraParams : { flavour_id: $("#flavour_id").val() } }); Let us take following example: We type in the flavour ID 3992 ...(and 3992 exists in the database and is properly returned by the php b...

.each or search function, how can I make use of those?

I have a ul list, with 10 items, and I have a label that displays the selected li text. When I click a button, I need to check the label, versus all the list items to find the matching one, when it finds that I need to assign the corresponding number. I.e. list: Messi Cristiano Zlatan hidden values of list items: www.messi.com www.cr...

Replacing strings with regex in JavaScript

A particular regular expression is bugging me right now. I simply want to replace the range=100 in a string like var string = '...commonstringblabla<b>&range=100&</b>stringandsoon...'; with ...commonstringblabla<b>&range=400&</b>stringandsoon... I successfully matched the "range=100"-part with alert( string.match(/range=100/) ...

Java SecurityException : signer information does not match

I recompiled my classes as usual, and suddenly got the following error message, why ? How to fix it ? "java.lang.SecurityException: class "Chinese_English_Dictionary"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:776) ...

[AS 3.0] How to use the string.match method to find multiple occurrences of the same word in a string?

In Actionscript and Adobe Flex, I'm using a pattern and regexp (with the global flag) with the string.match method and it works how I'd like except when the match returns multiple occurrences of the same word in the text. In that case, all the matches for that word point only to the index for the first occurrence of that word. For exam...

Count number of occurrences of a pattern in a file (even on same line)

When searching for number of occurrences of a string in a file, I generally use: grep pattern file | wc -l However, this only finds one occurrence per line, because of the way grep works. How can I search for the number of times a string appears in a file, regardless of whether they are on the same or different lines? Also, what if I...

how to match var/id to class

Hi. I'm new to jquery and, in addition, I think I'm having a brain freeze. I have a number of links with different ids. I want to match the clicked link with a div with the corresponding class so the div will show/hide/toggle as appropriate. I have: <script type="text/javascript"> $(document).ready(function() { $('.folioBox').hide();...

MySQL MATCH AGAINST functionality....

Currently I have the following query... SELECT id, LOWER(title) as title, LOWER(sub_title) as sub_title FROM ebay_archive_listing WHERE MATCH(title, sub_title) AGAINST ("key" IN BOOLEAN MODE) However it is not finding rows where the title contains the word "key". "key" is generated dynamically based on a set of ke...

On Mac, two jpg's whose color should match do not

So I'm designing a myspace page and I have two images, one is a repeating bg image, and another is an image which loads on a layer above it, which acts as a header/masthead. For some reason, on Macs only, and only in the browser (tested in safari and ff), the masthead renders slightly darker than the repeating bg image, creating this co...

Matching content between tags in web source

Hello, I was wondering what could be the fastest and the easiest way to grab text that is between tags in string. For example i have this string: Lorem ipsum <a>dolor sit amet</a>, <b>consectetur</b> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. And i need to find text that is between tags <a> </a> ...

Finding all links and e-mail addresses in a string

What could be the easiest way to match all links and e-mail addresses in a string to a list array? I was using preg_match in PHP but in C# it looks like it will be way different. ...

XPath: How to check multiple attributes across similar nodes

Hi, If I have some xml like: <root> <customers> <customer firstname="Joe" lastname="Bloggs" description="Member of the Bloggs family"/> <customer firstname="Joe" lastname="Soap" description="Member of the Soap family"/> <customer firstname="Fred" lastname="Bloggs" description="Member of the Bloggs family"...

Sql (partial) search in a list and get matched fields

I have two tables, I want to search TermID in Table-A through TermID in Table-B and If there is a termID like in Table-A and then want to get result table as shown below. TermIDs are in different length. There is no search pattern to search with "like %" TermIDs in Table-A are part of the TermIDs in Table-B Regards, Table-A ID ...

What is the best Networking implementation for my application?

I am in the planning phases of a project for myself, it is to be a single and multi-player card game. I would like to track statistics for each person such as world rankings etc... My problem is I do not know the best approach for the client - server architecture and programming. My original goal was to program everything in C# as I w...

Scala match question

Hello to everyone. I came across with an error on my Scala code that I cannot solve by myself (I am new at Scala). I have the following code: def myFunction(list: List[Any]): String = { var strItems : String = ""; list.foreach(item => { strItems += item match { case x:JsonSerializable => x.toJson() case y:String => (...

I need a way to implement the function matches() from XPath 2.0 with functions from XPath 1.0

I have the following piece of code: root="//valueExpression[matches(self::*,'pattern')]/.." But I can only use XPath 1.0 and I get an exception for the function matches(). Can you please help me with a solution using only functions from XPath 1.0 ? ...

Match and replace whole words in javascript

I have a textarea.I want when I write ,for example "want", to replace it with "two". How to match and replace whole words in javascript? ...

Determining which disjunct in an xsl:template match matched

Suppose I have XML like this: <xsl:template match="assessment | section "> . . . </xsl:template> I do this because I mostly want to treat assessment and section nodes the same. However, I do want to treat them a little differently. How can I tell whether a match was for assessment or for sectio...