Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 108/269 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • Regex negative lookahead

    - by Alyn
    I need to modify this regex href=\"(.*)\" which matches this... href="./pothole_locator_map.aspx?lang=en-gb&lat=53.153977&lng=-3.533306" To NOT match this... href="./pothole_locator_map.aspx?lang=en-gb&lat=53.153977&lng=-3.533306&returnurl=AbandonedVehicles.aspx" Tried this, but with no luck href=\"(.*)\"(?!&returnurl=AbandonedVehicles.aspx) Any help would be much appreciated. Thanks, Al.

    Read the article

  • Cancel Key press event

    - by Asim Sajjad
    How can I return the key, mean if I want to allow only interger value in the textbox , how can I don't allow user to not enter value other then integer, regarding, keypress event, I know there are other ways such as expression to match the string value, but I want to not assign invalid value to the textbox. if (( value 0 a&&(value <=9)) then assigned else return thanks in advance

    Read the article

  • Pattern Matching with XSLT

    - by genesis11
    I'm trying to match a pattern into a string in XSLT/XPath using the matches function, as follows: <xsl:when test="matches('awesome','awe')"> ... </xsl:when> However, in both Firefox 3.5.9 and IE8, it doesn't show up. IE8 tells me that "'matches' is not a valid XSLT or XPath function." Is this due to XSLT 2.0 not being supported, and is there a way around this?

    Read the article

  • Different users in the website and the facebook fan page with the like button

    - by Lagarto
    I have a facebook page for the bussiness running and with 27 like users, i already created the like button in the original website, and the amount of users is differents, in the website we have just 13 like users, we tried in iframe and XFBML, and always the same, if we put just a / at the end of the address of the website we had just one user, but never the 27 users. What we have to do to match the users. The facebook fan page is http:// www.facebook.com/altavistacg The website is http://www.altavistacommunications.com

    Read the article

  • Is there any tool to standardize format of C++ code?

    - by BillyONeal
    Hello, all :) I'm looking for a tool that works on Windows to reformat some C++ code in my codebase. Essentially, I've got some code I wrote a while ago that I'd like to use, but it doesn't match the style I'm using in a more recent project. What's the best way to reformat C++ code in a standard manner? Billy3

    Read the article

  • XML and XSLT: need it to sort only certain child nodes

    - by MT
    Hello, I need to have my XSLT stylesheet sort my XML file's child nodes, but only certain ones. Here's an example of what the XML is like: <?xml version="1.0"?> <xmltop> <child1 num="1"> <data>12345</data> </child1> <child1 num="2"> <data>12345</data> </child1> <child2 num="3"> <data>12345</data> </child2> <child2 num="2"> <data>12345</data> </child2> <child2 num="1"> <data>12345</data> </child2> </xmltop> And this is the XSL file I'm using: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/xmltop"> <xsl:copy> <xsl:apply-templates> <xsl:sort select="@num"/> </xsl:apply-templates> </xsl:copy> </xsl:template> <xsl:template match="child2"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> This creates problems for me because the nodes are stripped of their tags, and their contents remain, making my XML invalid. I'm not really an expert at XSL so pardon me if this is a dumb question. The <child2>'s are sorted properly. Thank you.

    Read the article

  • comparing data via a function

    - by tigermain
    I have two sets of data (locations) in seperate tables and I need to compare if they match or not. I have a UDF which performs a calculation based upon 5 values from each table. How do I perform a select with a join using this udf? my udf is basically defined by.... ALTER FUNCTION [dbo].[MatchRanking] ( @Latitude FLOAT , @Longitude FLOAT , @Postcode VARCHAR(16) , @CompanyName VARCHAR(256) , @TelephoneNumber VARCHAR(32) , @Latitude2 FLOAT , @Longitude2 FLOAT , @Postcode2 VARCHAR(16) , @CompanyName2 VARCHAR(256) , @TelephoneNumber2 VARCHAR(32) ) RETURNS INT

    Read the article

  • How to convert a string into a Point in C#

    - by NateD
    I have a list of strings of the format "x,y". I would like to make them all into Points. The best Point constructor I can find takes two ints. What is the best way in C# to turn "14,42" into new Point(14,42);? I know the Regex for doing that is /(\d+),(\d+)/, but I'm having a hard time turning those two match groups into ints in C#. any help you could offer would be appreciated.

    Read the article

  • text search with two parameters

    - by stck777
    The user should input two strings and the script will performe a text search: $sql = "SELECT * FROM table_one WHERE name='%$str1%' AND MATCH (street, city, pin) AGAINST ('$hrtg'IN BOOLEAN MODE)"; somehow the % does not work, but it alwas did actually. please help?

    Read the article

  • Google Chrome showing javascript security error

    - by Clint
    I need help resolving this Google Chrome Error..."Uncaught Error: SECURITY_ERR: DOM Exception 18" Here is the code. //Get Cookie function get_cookie (cookie_name) { var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); if (results) return ( unescape ( results[2] ) ); else return null; }; Many thanks, C

    Read the article

  • VBA regex pattern

    - by KeyMs92
    This is probably a simple problem, but unfortunately I wasn't able to get the results I wanted... Say, I have the following line: "Wouldn't It Be Nice" (B. Wilson/Asher/Love) I would have to look for this pattern: " (<any string>) In order to retrieve: B. Wilson/Asher/Love I tried something like "" (([^))]*)) but it doesn't seem to work. Also, I'd like to use Match.Submatches(0) so that might complicate things a bit because it relies on brackets...

    Read the article

  • get values from table as key value pairs with jquery

    - by liz
    I have a table: <table class="datatable" id="hosprates"> <caption> hospitalization rates test</caption> <thead> <tr> <th scope="col">Funding Source</th> <th scope="col">Alameda County</th> <th scope="col">California</th> </tr> </thead> <tbody> <tr> <th scope="row">Medi-Cal</th> <td>34.3</td> <td>32.3</td> </tr> <tr> <th scope="row">Private</th> <td>32.2</td> <td>34.2</td> </tr> <tr> <th scope="row">Other</th> <td>22.7</td> <td>21.7</td> </tr> </tbody> </table> i want to retrieve column 1 and column 2 values per row as pairs that end up looking like this [funding,number],[funding,number] i did this so far, but when i alert it, it only shows [object, object]... var myfunding = $('#hosprates tbody tr').each(function(){ var funding = new Object(); funding.name = $('#hosprates tbody tr td:nth-child(1)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); funding.value= $('#hosprates tbody tr td:nth-child(2)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); }); alert (myfunding);

    Read the article

  • Extending Enums, Overkill?

    - by CkH
    I have an object that needs to be serialized to an EDI format. For this example we'll say it's a car. A car might not be the best example b/c options change over time, but for the real object the Enums will never change. I have many Enums like the following with custom attributes applied. public enum RoofStyle { [DisplayText("Glass Top")] [StringValue("GTR")] Glass, [DisplayText("Convertible Soft Top")] [StringValue("CST")] ConvertibleSoft, [DisplayText("Hard Top")] [StringValue("HT ")] HardTop, [DisplayText("Targa Top")] [StringValue("TT ")] Targa, } The Attributes are accessed via Extension methods: public static string GetStringValue(this Enum value) { // Get the type Type type = value.GetType(); // Get fieldinfo for this type FieldInfo fieldInfo = type.GetField(value.ToString()); // Get the stringvalue attributes StringValueAttribute[] attribs = fieldInfo.GetCustomAttributes( typeof(StringValueAttribute), false) as StringValueAttribute[]; // Return the first if there was a match. return attribs.Length > 0 ? attribs[0].StringValue : null; } public static string GetDisplayText(this Enum value) { // Get the type Type type = value.GetType(); // Get fieldinfo for this type FieldInfo fieldInfo = type.GetField(value.ToString()); // Get the DisplayText attributes DisplayTextAttribute[] attribs = fieldInfo.GetCustomAttributes( typeof(DisplayTextAttribute), false) as DisplayTextAttribute[]; // Return the first if there was a match. return attribs.Length > 0 ? attribs[0].DisplayText : value.ToString(); } There is a custom EDI serializer that serializes based on the StringValue attributes like so: StringBuilder sb = new StringBuilder(); sb.Append(car.RoofStyle.GetStringValue()); sb.Append(car.TireSize.GetStringValue()); sb.Append(car.Model.GetStringValue()); ... There is another method that can get Enum Value from StringValue for Deserialization: car.RoofStyle = Enums.GetCode<RoofStyle>(EDIString.Substring(4, 3)) Defined as: public static class Enums { public static T GetCode<T>(string value) { foreach (object o in System.Enum.GetValues(typeof(T))) { if (((Enum)o).GetStringValue() == value.ToUpper()) return (T)o; } throw new ArgumentException("No code exists for type " + typeof(T).ToString() + " corresponding to value of " + value); } } And Finally, for the UI, the GetDisplayText() is used to show the user friendly text. What do you think? Overkill? Is there a better way? or Goldie Locks (just right)? Just want to get feedback before I intergrate it into my personal framework permanently. Thanks.

    Read the article

  • XSLT - make xsl:analyze-string return string instead of sequence of strings?

    - by tohuwawohu
    Is it possible to make xsl:analyze-string return one string instead of a sequence of strings? Background: I'd like to use xsl:analyze-string in a xsl:function that should encapsulate the pattern matching. Ideally, the function should return an xs:string to be used as sort criteria in an xsl:sort element. At the moment, i have to apply string-join() on every result of the function call since xsl:analyze-string returns a sequence of strings, and xsl:sort doesn't accept such a sequence as sort criteria. See line 24 of the stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="www.my-personal-namespa.ce" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output indent="yes" method="xml" /> <xsl:function name="my:sortierung" > <xsl:param name="inputstring" as="xs:string"/> <xsl:analyze-string select="$inputstring" regex="[0-9]+"> <xsl:matching-substring> <xsl:value-of select="format-number(number(.), '00000')" /> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="." /> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:function> <xsl:template match="/input"> <result> <xsl:apply-templates select="value" > <xsl:sort select="string-join((my:sortierung(.)), ' ')" /> </xsl:apply-templates> </result> </xsl:template> <xsl:template match="value"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> with this input: <?xml version="1.0" encoding="UTF-8"?> <input> <value>A 1 b 120</value> <value>A 1 b 1</value> <value>A 1 b 2</value> <value>A 1 b 1a</value> </input> In my example, is there a way to modify the xsl:function to return a xs:string instead of a sequence?

    Read the article

  • Validating javascript decimal numbers

    - by Click Upvote
    I'm using the following regexp to validate numbers in my javascript file: var valid = (val.match(/^\d+$/)); It works fine for whole numbers like 100, 200, etc, however for things like 1.44, 4.11, etc, it returns false. How can I change it so numbers with a decimal are also accepted?

    Read the article

  • .NET Regex: Howto extract IPv6 address parts

    - by Quandary
    Question: How does the .NET regex string to extract IPv6 addresses look like ? I can get it to extract a simple IPv6 address like "1050:0:0:0:5:600:300c:326b" but not the colon format ("ff06::c3"); My problem is, it should extract a 0 for every omitted value between the :: How do I do that? Below my code + description. Specify IPv6 addresses by omitting leading zeros. For example, IPv6 address 1050:0000:0000:0000:0005:0600:300c:326b may be written as 1050:0:0:0:5:600:300c:326b. Double colon Specify IPv6 addresses by using double colons (::) in place of a series of zeros. For example, IPv6 address ff06:0:0:0:0:0:0:c3 may be written as ff06::c3. Double colons may be used only once in an IP address. strInputString = "ff06::c3"; strInputString = "1050:0000:0000:0000:0005:0600:300c:326b"; string strPattern = "([A-Fa-f0-9]{1,4}:){7}([A-Fa-f0-9]{1,4})"; //strPattern = @"\A(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\z"; //strPattern = @"(\A([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,6}\Z)|(\A([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}\Z)|(\A([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}\Z)|(\A([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}\Z)|(\A([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}\Z)|(\A([0-9a-f]{1,4}:){1,6}(:[0-9a-f]{1,4}){1,1}\Z)|(\A(([0-9a-f]{1,4}:){1,7}|:):\Z)|(\A:(:[0-9a-f]{1,4}){1,7}\Z)|(\A((([0-9a-f]{1,4}:){6})(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})\Z)|(\A(([0-9a-f]{1,4}:){5}[0-9a-f]{1,4}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})\Z)|(\A([0-9a-f]{1,4}:){5}:[0-9a-f]{1,4}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z)|(\A([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,4}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z)|(\A([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,3}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z)|(\A([0-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A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/"; //strPattern = @"(:?[0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})\z"; //strPattern = @"\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\z"; //strPattern = @"\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z"; //strPattern = @"/^(?:(?:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9](?::|$)){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))$/i"; System.Text.RegularExpressions.Regex reValidationRule = new System.Text.RegularExpressions.Regex("^" + strPattern + "$"); if (reValidationRule.Match(strInputString).Success) // If matching pattern { System.Text.RegularExpressions.Match maResult = System.Text.RegularExpressions.Regex.Match(strInputString, strPattern); // Console.WriteLine(maResult.Groups.Count) string[] astrReturnValues = new string[4]; System.Text.RegularExpressions.GroupCollection gc = maResult.Groups; System.Text.RegularExpressions.CaptureCollection cc; int counter; //System.Web.Script.Serialization.JavaScriptSerializer jssJSONserializer = new System.Web.Script.Serialization.JavaScriptSerializer(); //Console.WriteLine(jssJSONserializer.Serialize()); // Loop through each group. for (int i = 0; i < gc.Count; i++) { Console.WriteLine("Group: {0}", i); cc = gc[i].Captures; counter = cc.Count; // Print number of captures in this group. Console.WriteLine("Captures count = " + counter.ToString()); // Loop through each capture in group. for (int ii = 0; ii < counter; ii++) { Console.WriteLine("Capture: {0}", ii); // Print capture and position. Console.WriteLine(cc[ii] + " Starts at character " + cc[ii].Index); } }

    Read the article

  • Jasper repory error in java

    - by vipul
    hello Friends , I am getting error while developing Pdf in java error is= net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: Document root element "property", must match DOCTYPE root "jasperReport". if you have solution then reply vipul

    Read the article

  • sha1(password) encryption

    - by Jason
    Alright, so I tried to make my users info super secure by adding '" . sha1($_POST['password']) . "' when inserting their password when they register. THAT WORKS great, looking at the database, I have no clue what their password is. Now the problem is logging in. I'm running some tests and when I try to log in, the password 12345 doesn't match the encrypted password using "$password=sha1($_POST['mypassword']);" Any idea's why?

    Read the article

  • Clear Asp.Net cache from outside of application (not using source code)

    - by TheJudge
    Hi, I have a asp.net web application and I'm using cache (HttpRuntime.Cache) to save some stuff from db. I also update db from time to time so that data in db does not match the data in my application's cache. Is there any way how to clear my application's cache without modifying any source code or republishing the page? I tried to restart IIS and to clear browsers cache but nothing helps. Please help.

    Read the article

  • how to search some character inside string

    - by klox
    i have been type some string inside textfield that is "KD-G435MUN2D"... i already use this code for search "UD" character from that string: <script> var str="KD-R435MUN2D"; var patt1=/UD/gi; document.write(str.match(patt1)); </script> but this code doesn't work..where is my fault?

    Read the article

  • RegEx for Dynamic URL Goals settings in Google Analytics

    - by gaaustralia
    Hi, I have tried to work this regex to set up a goal in GA for 2 days, but I cannot get my head around it... The url format is like this: /purchase.php?cDd=1&transaction_id=xxxxxxx&verify=xxxxxxxxxxxxxxxx=&method=creditcard&type=purchase transaction_id= is populated with a sept of numbers verify= is populated by a string of numbers, letters in both caps and lower case Basically I would like to only match URLs which finish by "&method=creditcard&type=purchase" I have tried to just put &method=creditcard&type=purchase but it does retrieve other URLs too Would anyone has any ideas

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >