Search Results

Search found 4848 results on 194 pages for 'expression blend'.

Page 21/194 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Strange JavaScript Regular Expression Behavior

    - by Kiwi
    I'm getting different behavior from a regular expression in JavaScript depending on whether or not I declare it using literal syntax. Using a extremely simple test HTML file: <html> <head> <script type="text/javascript"> var s = '3'; var regex1 = /\d/; var regex2 = new RegExp('\d'); alert(s.search(regex1)); // 0 (matches) alert(s.search(regex2)); // -1 (does not match) </script> </head> <body></body> </html> The regular expression declared with literal syntax (/\d/) works correctly, while the other (new RegExp('\d')) does not. Why on earth is this happening? I'm using Google Chrome 5.0.375.70 on Windows Vista Home Premium, if that's at all helpful.

    Read the article

  • How to check connection leak using regular expression ?

    - by gauravkarnatak
    I have to check connection leak in my application i.e. open connections which have not been closed. After searching, after I found out that a thousands times connections have been opened but I can't manually go to each and every code fragment and check for connection close thing. I think, it could be possible using a regular expression but the fact is, I am not that well versed with regex that I could write one. Please suggest a regular expression for checking in a no of java files that a opened connection has been closed or not. My code pattern is something like this. try { /* Some code goes here */ con = EJBUtil.getConnection(JNDI_NAME); /* Some code goes here */ } finally { /* Some code goes here */ DBUtil.close(con); or closeConnection.close(con); /* Some code goes here */ }

    Read the article

  • Lamda expression will not compile

    - by John Soer
    I am very confused I have this lamba expression tvPatientPrecriptionsEntities.Sort((p1, p2) => p1.MedicationStartDate.Value.CompareTo(p2.MedicationStartDate.Value)); Visual studio will not compile it and complains about syntax. I converted the lamba expression to an anonymous delegate as so tvPatientPrecriptionsEntities.Sort( delegate(PatientPrecriptionsEntity p1, PatientPrecriptionsEntity p2) { return p1.MedicationStartDate.Value.CompareTo(p2.MedicationStartDate.Value); } ); and it works fine. The project is uses the .net 3.5 framework and I have a reference to system.linq.

    Read the article

  • Use Regular expression with fileinput

    - by chrissygormley
    Hello, I am trying to replace a variable stored in another file using regular expression. The code I have tried is: r = re.compile(r"self\.uid\s*=\s*('\w{12})'") for line in fileinput.input(['file.py'], inplace=True): print line.replace(r.match(line), sys.argv[1]), The format of the variable in the file is: self.uid = '027FC8EBC2D1' I am trying to pass in a parameter in this format and use regular expression to verify that the sys.argv[1] is correct format and to find the variable stored in this file and replace it with the new variable. Can anyone help. Thanks for the help.

    Read the article

  • ruby on rails regular expression to remove html tags and its content from text

    - by salilgaikwad
    Hi All, I want regular expression in ruby on rails which remove all the html tags and its content from the given text. For example if my text is :-INPUT :- <span id="span_is"><br><br><u><i>Hi</i></u></span> then it should display only OUTPUT should be as follows:- Hi in short i want regular expression or a function which remove < and whatever the content between <. Thanks & Regards, Salil Gaikwad

    Read the article

  • Which is more efficient regular expression?

    - by Vagnerr
    I'm parsing some big log files and have some very simple string matches for example if(m/Some String Pattern/o){ #Do something } It seems simple enough but in fact most of the matches I have could be against the start of the line, but the match would be "longer" for example if(m/^Initial static string that matches Some String Pattern/o){ #Do something } Obviously this is a longer regular expression and so more work to match. However I can use the start of line anchor which would allow an expression to be discarded as a failed match sooner. It is my hunch that the latter would be more efficient. Can any one back me up/shoot me down :-)

    Read the article

  • Regular expression help parsing SQLIO output

    - by jaspernygaard
    Hi I've been working on a regular expression to parse the output of a series of SQLIO runs. I've gotten pretty far, but not quite there yet. I'm seeking a 100% regex solution and no pre-manipulation of the input. Could anyone assist with a little guidance with the following regular expression: .*v(?<SQLIOVersion>\d\.\d).*\n.*\n(?<threads>\d*)\s.*for\s(?<Seconds>\d+).*\n.*using\s(?<clustersize>[0-9]*)KB.*\n.*\n.*size:\s(?<currentfilesize>\d+).*\n.*\n.*\n.*\n.*\s(?<IOs>\d*\.\d*).*\n.*\s(?<MBs>\d*\.\d*).*\n.*\n.*\s(?<MinLatency_ms>\d+).*\n.*\s(?<AvgLatency_ms>\d+).*\n.*\s(?<MaxLatency_ms>\d+).*\n.*\n.*\n\%\:..(?<ms>\d*\s+)* Here's a snippet of the output - note the headers, which change during the SQLIO batch run: File

    Read the article

  • AutoMapper and Linq expression.

    - by Raffaeu
    I am exposing the Dto generated from AutoMapper to my WCF services. I would like to offer something like that from WCF: IList GetPersonByQuery(Expression predicate); Unfortunately I need back an expression tree of Person as my DAL doesn't know the DTO. I am trying this wihtout success: var func = new Func<Person, bool>(x => x.FirstName.Contains("John")); var funcDto = Mapper.Map<Func<Person, bool>, Func<PersonDto, bool>>(func); Console.WriteLine(func.ToString()); Console.WriteLine(funcDto.ToString()); THe error that I get is: ----> System.ArgumentException : Type 'System.Func`2[TestAutoMapper.PersonDto,System.Boolean]' does not have a default constructor Do you have any suggestions?

    Read the article

  • PHP & Regular expression: keyword just occurs once

    - by lauthiamkok
    Hi, how can I make sure a certain keyword just occurs once in the input with regular expression? I think there is some mistakes in the expression below as I can repeat the same keywords, if (!preg_match('/\b(.php?){1}\b/', $cfg_path)) { $error = true; echo '<error elementid="cfg_path" message="PATH - make sure you have a \'.php?\' in the path."/>'; } I just want this to be true, form.php?category=something or form.php? but not this, form.php?.php?category=something or form.php?.php? please let me know how to fix it. thanks.

    Read the article

  • Notepad++ find string with a new-line and replace

    - by Giraldi Maggio
    [Notepad++ Question] How do I use find-and-replace to replace the attribute of a series of tags using expression? Case scenario: Let's say I have a couple of lines of something like this: <li><a title="Bla bla" href= "http://www.url.com/etc">Text</a></li> And I want to replace them with this: <li><a title="Bla bla" href="">Text</a></li> Note the new line and double tabs on the original.

    Read the article

  • Oracle - Determine maximum supported size for regular expression

    - by FrustratedWithFormsDesigner
    I have a regular expression that throws ORA-12733, "regular expression is too long". How do I determine what the maximum supported size is? FYI: the offending regex is 892 characters. It's a generated regex, so I could change how I generate and execute it, but I would like to know what the limits to the max size are before I change how I am generating and executing. (running Oracle 10.2g) UPDATE: If it depends on the actual regex, here's the begining of it (the rest is just the same thing repeated, with different values between ^ and $): (^R_1A$|^R_2A$|^R_3A$|^R_4A$|^R_4B$|^R_5A$|^R_5B$...

    Read the article

  • Regular Expression to isolate an html tag

    - by orit cohen
    I'm looking for a regular expression to isolate an html tag. This includes the TAG the ATTRIBUTES and the CONTNET inside. Let's say I have this: <html> <body> aajsdfkjaskd <TAGNAME name="bla" context="non">hfdfhdj </TAGNAME> </body> </html> I need a regular expression that would return: <TAGNAME name="bla" context="non">hfdfhdj </TAGNAME> Thank, Joe

    Read the article

  • Regex expression with leading zero

    - by user1874087
    I'm rather new to regex expressions and need help with a simple expression. I'm using Pentaho for ETL (Replace in String transformation) and I have column values that I need to add leading zeros to and parse out text as part of the database import. So far I have been unable to add the leading zero. The column is called Region and the values are "region 8", "region 10", "region 11". My regex expression is ['Region'] which will eliminate the region text but produces results = "8", "10", "11". I need values to produce "08", "10", "11". So all the single digit numbers must have leading zeros.

    Read the article

  • Finding Line Beginning using Regular expression in Notepad++

    - by Michel Merlin
    Finding Line Beginning using Regular expression in Notepad++ (Sorry if this is a newbie question) I want to strip a 4000-line HTML file from all the jQuery "done" stuff, e.g.: <DIV class=menu done27="1" done26="0" done9="1" done8="0" done7="1" done6="0" done4="20"> should be replaced with: <DIV class=menu> In http://www.zytrax.com/tech/web/regex.htm#experiment I can do it with RE: [ ^]done[0-9]+="[0-9]+" but in Notepad++ 5.6.8 UNICODE, in a .HTM file encoded in ANSI, Search Find, Search mode = Regular expression, putting this RE in the "Find what" field won't work (it will only find the 5 occurrences starting with a space, it will miss the 2 occurrences starting at the beginning of a line; IOW, the caret for line beginning, or the alternating it with a space, fails). How do I? TIA, Versailles, Wed 21 Apr 2010 10:42:20 +0200

    Read the article

  • Finding Line Beginning using Regular expression in Notepad++

    - by Michel Merlin
    Finding Line Beginning using Regular expression in Notepad++ (Sorry for this newbie question) I want to strip a 4000-line HTML file from all the jQuery "done" stuff, e.g.: <DIV class=menu done27="1" done26="0" done9="1" done8="0" done7="1" done6="0" done4="20"> should be replaced with: <DIV class=menu> In http://www.zytrax.com/tech/web/regex.htm#experiment I can do it with RE: [ ^]done[0-9]+="[0-9]+" but in Notepad++ 5.6.8 UNICODE Search Find, Search mode = Regular expression, putting this RE in the "Find what" field won't work (it will only find the 5 occurrences starting with a space, it will miss the 2 occurrences starting at the beginning of a line; IOW, the caret for line beginning, or the alternating it with a space, fails). How do I? TIA, Versailles, Wed 21 Apr 2010 10:18:20 +0200

    Read the article

  • Javascript Regular Expression help

    - by user270399
    Hello! I have got the following regular expression working just fine in Rad Software Regular Expression designer. param\s+name\s*=\s*"movie"\s+value=\s*"(?<target>.*?)" And now i am wondering, how to get this to work in javascript. It keeps on complaininge about the "target" part. I am trying to validate and get the url from the youtube embed code. <object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/ueZP6ifzqMY&hl=sv_SE&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ueZP6ifzqMY&hl=sv_SE&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object> How the heck do i get this regex to work with my javascript? :)

    Read the article

  • PHP: Regular Expression to get a URL from a string

    - by Matthew Iselin
    I'm working on some PHP code which takes input from various sources and needs to find the URLs and save them somewhere. The kind of input that needs to be handled is as follows: http://www.youtube.com/watch?v=IY2j_GPIqRA Try google: http://google.com! (note exclamation mark is not part of the URL) Is http://somesite.com/ down for anyone else? Output: http://www.youtube.com/watch?v=IY2j_GPIqRA http://google.com http://somesite.com/ I've already borrowed one regular expression from the internet which works, but unfortunately wipes the query string out - not good! Any help putting together a regular expression, or perhaps another solution to this problem, would be appreciated.

    Read the article

  • Examining a lambda expression at runtime in C#

    - by Ben Aston
    I have a method Get on a type MyType1 accepting a Func<MyType2, bool> as a parameter. An example of its use: mytype1Instance.Get(x => x.Guid == guid)); I would like create a stub implementation of the method Get that examines the incoming lambda expression and determines what the value of guid is. Clearly the lambda could be "anything", but I'm happy for the stub to make an assumption about the lambda, that it is trying to match on the Guid property. How can I do this? I suspect it involves the use of the built-in Expression type?

    Read the article

  • AIR SQLite IN expression not working

    - by goseta
    Hi, I'm having a problem with an expression in my sql statement in SQLite for Adobe AIR basically I have this sql = "UPDATE uniforms SET status=@status WHERE customerId IN(19,20)"; updateStmt.parameters["@status"] = args[1]; updateStmt.execute(); if I run the above code it works, updating the status when the id are 19 and 20 but if I pass the ids list as a parameter like this sql = "UPDATE uniforms SET status=@status WHERE customerId IN(@ids)"; updateStmt.parameters["@status"] = args[1]; updateStmt.parameters["@ids"] = "19,20"; updateStmt.execute(); it gives me and error, saying could not convert text value to numeric value, which make sense because I'm passing and string but the IN expression should convert it accordingly, like it does when I pass directly the list values, why is not working the other way, thanks for any help!

    Read the article

  • Regular Expression for accurate word-count using JavaScript

    - by Haidon
    I'm trying to put together a regular expression for a JavaScript command that accurately counts the number of words in a textarea. One solution I had found is as follows: document.querySelector("#wordcount").innerHTML = document.querySelector("#editor").value.split(/\b\w+\b/).length -1; But this doesn't count any non-Latin characters (eg: Cyrillic, Hangul, etc); it skips over them completely. Another one I put together: document.querySelector("#wordcount").innerHTML = document.querySelector("#editor").value.split(/\s+/g).length -1; But this doesn't count accurately unless the document ends in a space character. If a space character is appended to the value being counted it counts 1 word even with an empty document. Furthermore, if the document begins with a space character an extraneous word is counted. Is there a regular expression I can put into this command that counts the words accurately, regardless of input method?

    Read the article

  • Erroneous Matches with Regular Expression

    - by Ballsacian1
    $regexp = '/(?:<input\stype="hidden"\sname="){1}([a-zA-Z0-9]*)(?:"\svalue="1"\s\/>)/'; $response = '<input type="hidden" name="7d37dddd0eb2c85b8d394ef36b35f54f" value="1" />'; preg_match($regexp, $response, $matches); echo $matches[1]; // Outputs: 7d37dddd0eb2c85b8d394ef36b35f54f So I'm using this regular expression to search for an authentication token on a webpage implementing Joomla in order to preform a scripted login. I've got all this working but am wondering what is wrong with my regular expression as it always returns 2 items. Array ( [0] => [1] => 7d37dddd0eb2c85b8d394ef36b35f54f) Also the name of the input I'm checking for changes every page load both in length and name.

    Read the article

  • Regular expression for a string containing one word but not another

    - by Chris Stahl
    I'm setting up some goals in Google Analytics and could use a little regex help. Lets say I have 4 URLs http://www.anydotcom.com/test/search.cfm?metric=blah&selector=size&value=1 http://www.anydotcom.com/test/search.cfm?metric=blah2&selector=style&value=1 http://www.anydotcom.com/test/search.cfm?metric=blah3&selector=size&value=1 http://www.anydotcom.com/test/details.cfm?metric=blah&selector=size&value=1 I want to create an expression that will identify any URL that contains the string selector=size but does NOT contain details.cfm I know that to find a string that does NOT contain another string I can use this expression: (^((?!details.cfm).)*$) But, I'm not sure how to add in the selector=size portion. Any help would be greatly appreciated!

    Read the article

  • Qt/C++ regular expression library with unicode property support

    - by Dave
    I'm converting an application from the .Net framework to Qt using C++. The application makes extensive use of regular expression unicode properties, i.e. \p{L}, \p{M}, etc. I've just discovered that the QRegExp class lacks support for this among other things (lookbehinds, etc.) Can anyone recommend a C++ regular expression library that: Supports unicode properties Is unicode-aware in other respects (i.e. \w matches more than ASCII word characters) As a bonus, supports lookbehinds. Please don't point me to the wikipedia article; I don't trust it. That article says that QRegExp supports unicode properties. Unless I'm really doing something wrong, it doesn't. I'm looking for someone actually using unicode properties with a regex library in a project.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >