Search Results

Search found 17715 results on 709 pages for 'regular language'.

Page 81/709 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Matching Regular Expression in Javascript and PHP problem...

    - by Frankie
    I can't figure out how to get the same result from my Javscript as I do from my PHP. In particular, Javascript always leaves out the backslashes. Please ignore the random forward and backslashes; I put them there so that I can cover my basis on a windows system or any other system. Output: Input String: "/root\wp-cont ent\@*%'i@$@%$&^(@#@''mage6.jpg:" /root\wp-content\image6.jpg (PHP Output) /rootwp-contentimage6.jpg (Javscript Output) I would appreciate any help! PHP: <?php $path ="/root\wp-cont ent\@*%'i@$@%$&^(@#@''mage6.jpg:"; $path = preg_replace("/[^a-zA-Z0-9\\\\\/\.-]/", "", $path); echo $path; ?> Javascript: <script type="text/javascript"> var path = "/root\wp-cont ent\@*%'i@$@%$&^(@#@''mage6.jpg:"; //exact same string as PHP var regx = /[^a-zA-Z0-9\.\/-]/g; path = path.replace(regx,""); document.write("<br>"+path); </script>

    Read the article

  • Bash: Extract Range with Regular Expressioin (maybe sed?)

    - by sixtyfootersdude
    I have a file that is similar to this: <many lines of stuff> SUMMARY: <some lines of stuff> END OF SUMMARY I want to extract just the stuff between SUMMARY and END OF SUMMARY. I suspect I can do this with sed but I am not sure how. I know I can modify the stuff in between with this: sed "/SUMMARY/,/END OF SUMMARY/ s/replace/with/" fileName (But not sure how to just extract that stuff). I am Bash on Solaris.

    Read the article

  • Programming challenge: can you code a hello world program as a Palindrome?

    - by Assaf Lavie
    So the puzzle is to write a hello world program in your language of choice, where the program's source file as a string has to be a palindrome. To be clear, the output has to be exactly "Hello, World". Edit: Well, with comments it seems trivial (not that I thought of it myself of course [sigh].. hat tip to cobbal). So new rule: no comments. Edit: I feel kind of bad editing someone else's question to say this, but it will eliminate a lot of non-palindromes that keep popping up, and I'm tired of seeing the same simple mistake over and over. The following is NOT a palindrome: ()() The following IS a palindrome: ())( Brackets, parenthesis, and anything else that must match are a major barrier to palindrome-ing, yes, but that doesn't mean you can ignore them and post non-palindrome answers. Languages represented thus far: C, C++, Bash, elisp, C#, Perl, sh, Windows shell, Java, Common Lisp, Awk, Ruby, Brainfuck, Funge, Python, Machine Language, HQ9+, Assembly, TCL, J, php, Haskell, io, TeX, APL, Javascript, mIRC Script, Basic, Orc, Fortran, Unlambda, Pseudo-code, Befunge, CFML, Lua, INTERCAL, VBScript, HTML, sed, PostScript, GolfScript, REBOL, SQL

    Read the article

  • How to use regular expression in lxml xpath?

    - by Arty
    I'm using construction like this: doc = parse(url).getroot() links = doc.xpath("//a[text()='some text']") But I need to select all links which have text beginning with "some text", so I'm wondering is there any way to use regexp here? Didn't find anything in lxml documentation

    Read the article

  • how/resources to compile a procedural language into [sql]

    - by Philip
    I am looking into the possibility/feasibility/resources for building a cross compiler which takes a procedural or Object Oriented language like C, or Java and compiling it into SQL. I understand that the advantage of SQL code is performing set operations which is fundamentally different from procedural languages which generally process 1 at a time. If anyone has done this before, or if it is thought of as too complicated to do or any other ideas/concerns/suggestions would be greatly appreciated. Thanks in advance Philip

    Read the article

  • C# differences between Windows Mobile and regular Windows

    - by Matt
    Are there many differences between Windows and Windows Mobile as far as C# programming is concerned? I can write some moderately complicated programs in C#, but I'm not sure if it would just run perfectly on a Windows smartphone, or if something has to be done to port it. If so, is there a tool that will automatically revise code to make it mobile-compatible? The reason I ask is that the new Windows mobile 7 will only support a few methods of app development, one of which is C#. Also, do smartphones with non-windows operating systems have C# support available? Or can C# code be converted to Symbian or iPhone or whatever? Thanks for any help you can provide.

    Read the article

  • primitives of a programming language

    - by Tim
    Hi, Which do the concepts control flow, data type, statement, expression and operation belong to? Syntax or semantics? What is the relation between control flow, data type, statement, expression, operation, function, ...? How a program is built from these primitives level by level? I would like to understand these primitive concepts and their relations in order to figure out what aspects of a new language should one learn. Thanks and regards!

    Read the article

  • Managing multiple .NET languages in a web application

    - by tomfanning
    I am part of a development team building a new ASP.NET 3.5 web application. Two of us are C# coders, and the other is a VB.NET coder. I know that we can mix languages on a per-project basis, and one can build classes in one language that inherit from classes written in the other language in a different project (which we are already doing), but I can see us getting into a situation where we might well end up with cyclic dependencies between our various project DLLs. Other than simply having a high number of projects (more seperation of concerns into more libraries), how have you managed this situation on your own projects? Note - I believe this question to be different enough from the only similar match I could find (this one) on the basis that we are not wanting to use different languages in order to take advantage of their specific features per se, but rather to make use of what developer resource is available to us (i.e. one dev just happens to be VB.NET only).

    Read the article

  • How to choose programming language for projects?

    - by bdhar
    This is a question I constantly encounter when I attend any technical forums / discussions / interviews. There is a similar article but it focuses on business merits as well. What I am looking for is a guide (not a checklist like this one which is abstract and not so accurate) which helps an architect to choose the programming language to implement a requirement. Is there a book or article available for the same purpose?

    Read the article

  • What Language is This?

    - by bobber205
    Going through some example code sent to me and honestly, I have no idea what language this is def uniqify(arr): b = {} for i in arr: b[i] = 1 return b.keys() Is it Python? I am also curious what keys() does. It's obvious it returns an array but what does it do the array that calls the function? :P

    Read the article

  • regular expression to get the filename from urls

    - by robert
    if i have a textbox with severals urls rapidshare.com/files/379028801/Fringe.S02E19.HDTV.XviD-LOL.avi rapidshare.com/files/379182651/Fringe.S02E19.720p.HDTV.X264-DIMENSION.mkv rapidshare.com/files/379180004/Fringe.S02E19.720p.HDTV.X264-DIMENSION.part1.rar rapidshare.com/files/379180444/Fringe.S02E19.720p.HDTV.X264-DIMENSION.part2.rar rapidshare.com/files/379181251/Fringe.S02E19.720p.HDTV.X264-DIMENSION.part3.rar rapidshare.com/files/379181743/Fringe.S02E19.720p.HDTV.X264-DIMENSION.part4.rar i need a the files name and its urls textbox2.text = Fringe.S02E19.HDTV.XviD-LOL.avi from here rapidshare.com/files/379028801/Fringe.S02E19.HDTV.XviD-LOL.avi Fringe.S02E19.720p.HDTV.X264-DIMENSION.part1.rar from here rapidshare.com/files/379180004/Fringe.S02E19.720p.HDTV.X264-DIMENSION.part1.rar and so on Thanks :)

    Read the article

  • Regular expression to validate a Google Analytics UA Number

    - by Otis
    It's not 100 percent clear to me that the Google Analytics UA Numbers are always 6 digits, a dash, and 2 digits as Google often mentions in their documentation. There are frequent counter-examples that use fewer than 6 for the account portion and 1-4 for the profile. All of the examples always show numbers but it's not even clear that they can't be letters. Does anyone know if Google has published a regex that exactly matches allowable UA Numbers? I'm adding this feature to the admin console of an application I work on and would like to validate the user input.

    Read the article

  • Regular Expression Help in .NET

    - by Matt H.
    I have a simple pattern I am trying to match, any characters captured between parenthesis at the end of an HTML paragraph. I am running into trouble any time there is additional parentheticals in that paragraph: i.e. If the input string is "..... (321)</p" i want to get the value (321) However, if the paragraph has this text: "... (123) (321)</p" my regex is returning "(123) (321)" (everything between the opening "(" and closing ")" I am using the regex pattern "\s(.+)</p" How can I grab the correct value (using VB.NET) This is what I'm doing so far: Dim reg As New Regex("\s\(.+\)</P>", RegexOptions.IgnoreCase) Dim matchC As MatchCollection = reg.Matches(su.Question) If matchC.Count > 0 Then Dim lastMatch As Match = matchC(matchC.Count - 1) Dim DesiredValue As String = lastMatch.Value End If

    Read the article

  • natural language processing internships

    - by user552127
    Hi All, Pls someone guide me in finding paid Grad internships in Natural Language Processing over the summer. I am really interested in NLP/ML and have taken up the excellent course offered at my school in Fall. I would be glad to work for passionate startups that do actual NLP tasks such as semantic extraction (and not just information retrieval) etc. I have worked with Java and teaching myself Python in all NLP tasks. Thanks, Sanjay

    Read the article

  • Regular expression for email

    - by Nadeem
    I tried the reg expression ^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+ for the email validation. Since I want the user to allow submitting even with the empty email address. So I changed the reg ex to (^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)? But this expression accepts any email address without any validation.

    Read the article

  • Intersection of two regular expressions

    - by Henry
    Hi, Im looking for function (PHP will be the best), which returns true whether exists string matches both regexpA and regexpB. Example 1: $regexpA = '[0-9]+'; $regexpB = '[0-9]{2,3}'; hasRegularsIntersection($regexpA,$regexpB) returns TRUE because '12' matches both regexps Example 2: $regexpA = '[0-9]+'; $regexpB = '[a-z]+'; hasRegularsIntersection($regexpA,$regexpB) returns FALSE because numbers never matches literals. Thanks for any suggestions how to solve this. Henry

    Read the article

  • xml regular expression/regex OR operator

    - by Naz Haque
    Hi am trying to use a regeX to read through my document to identify currency types whether they're $,£ or a €. The regex I've created doesn't seem to work, somebody please advise me what it should be. I'd really appreciate the help: The regEX I've created ("\$|£|€]")is in a simpleType within my XSD file used for validating a document. The code is show after the colon, please note to display on stackoverflow I've had to remove the open/close tags (<): xs:simpleType name="currencyType" xs:restriction base="utf8-string" xs:length value="1" / xs:pattern value="[\$|£|€]"/ /xs:restriction /xs:simpleType

    Read the article

  • Respect regular onsubmit handlers from jQuery.submit

    - by orip
    I want a jQuery form submit handler to respect any previous submit handlers, including ones added with onsubmit. I'm trying to detect the previous handler's return value but can't seem to do it: <form><input type="submit" /></form> <script type="text/javascript"> $('form')[0].onsubmit = function() { return false; }; // called first $('form').submit(function(e) { console.log(e.result); // undefined console.log(e.isDefaultPrevented()); // false console.log(e.isPropagationStopped()); // false console.log(e.isImmediatePropagationStopped()); // false }); </script> Is there a way to do this?

    Read the article

  • python regular expression for domain names

    - by user230911
    I am trying use the following regression to extract domain name from a text, but it just produce nothing, what's wrong with it? I don't know if this is suitable to ask this "fix code" question, maybe I should read more. I just want to save some time. Thanks pat_url = re.compile(r''' (?:https?://)* (?:[\w]+[\-\w]+[.])* (?P<domain>[\w\-]*[\w.](com|net)([.](cn|jp|us))*[/]*) ''') print re.findall(pat_url,"http://www.google.com/abcde") I want the output to be google.com

    Read the article

  • Regular Expression Longes Possible Matching

    - by syker
    So I have an input string which is a directory addres: Example: ProgramFiles/Micro/Telephone And I want to match it against a list of words very strictly: Example: Tel|Tele|Telephone I want to match against Telephone and not Tel. Right now my reg looks like this: my( $output ) = ( $input =~ m/($list)/o ); The regex above will match against Tel. What can I do to fix it?

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >