Search Results

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

Page 87/709 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Regular expressions in c++ STL

    - by Radek Šimko
    Is there any native library in STL which is tested and works without any extra compiler options? I tried to use <regex>, but the compiler outputs this: In file included from /usr/include/c++/4.3/regex:40, from main.cpp:5: /usr/include/c++/4.3/c++0x_warning.h:36:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

    Read the article

  • Use regular expressions with Glib

    - by Sébastien
    Hello, I would like to find all comment blocks(/*...*/) but the function g_regex_match_full always returns true. Here is the code : // Create the regex. start_block_comment_regex = g_regex_new("/\*.*\*/", G_REGEX_OPTIMIZE, 0, &regex_error); //Search the regex; if(TRUE == g_regex_match_full(start_block_comment_regex, current_line, -1, 0, 0, &match_info, &regex_error)) { }

    Read the article

  • help for writting a regular expression in javascript

    - by Majesty
    Hi guys... I want to write a javascrpit code with .Split() that split a string with structure described below: The input: W1...Wn=S1...||...Sm||Sj...Sk|Y1...Yn=D1...Di||Dm...Dn|... The Output: W1...Wn=S1...||...Sm||Sj...Sk Y1...Yn=D1...Di||Dm...Dn ... I've seen the question that split this string: a=aa|b=b||b|c=cc . but my question is general case of that question. please help me... Thanks...

    Read the article

  • Regular Expression Sanitize (PHP)

    - by atif089
    Hello, I would like to sanitize a string in to a URL so this is what I basically need. Everything must be removed except alphanumeric characters and spaces and dashed. Spaces should be converter into dashes. Eg. This, is the URL! must return this-is-the-url Thanks

    Read the article

  • What programming language is good for a beginner and for a hobby? [closed]

    - by Lawrence
    Possible Duplicates: What is the easiest language to start with? What programming language should I choose for an independent study language? Well as the title says what language is good for a beginner and for a hobby? I'll probably be making some games or desktop apps with a gui most likely. I'll be working in Windows and Linux. Oh and could you also give some links to tutorials for the language?

    Read the article

  • PHP - Language Data

    - by bobrusha
    What's the best way to store language data? Keep it as variables in some kind of lang.php file... $l_ipsum = 'smth'; $l_rand = 'string'; Or select them from a database? I'm in search of your advice.

    Read the article

  • Perl Regular expression remove double tabs, line breaks, white spaces

    - by Scoox
    Hi guys, I want to write a perl script that removes double tabs, line breaks and white spaces. What I have so far is: $txt=~s/\r//gs; $txt=~s/ +/ /gs; $txt=~s/\t+/\t/gs; $txt=~s/[\t\n]*\n/\n/gs; $txt=~s/\n+/\n/gs; But, 1. It's not beautiful. Should be possible to do that with far less regexps. 2. It just doesn't work and I really do not know why. It leaves some double tabs, white spaces and empty lines (i.e. lines with only a tab or whitespace) I could solve it with a while, but that is very slow and ugly. Any suggestions?

    Read the article

  • Selectively search and replace certain lines using a regular expression

    - by eneveu
    I have a file containing a lot of SQL statements, such as: CREATE TABLE "USER" ( "ID" INTEGER PRIMARY KEY, "NAME" CHARACTER VARYING(50) NOT NULL, "AGE" INTEGER NOT NULL ); COPY "USER" (id, name, age) FROM stdin; 1 Skywalker 19 2 Kenobi 57 I want the column names in the COPY statements to be uppercased and quoted: COPY "USER" ("ID", "NAME", "AGE") FROM stdin; Using sed, I found the following regexp: sed -r 's/([( ])(\w+)([,)])/\1"\U\2\E"\3/g' It does replace the column names, but it is not selective enough, and replaces other words in the file: ~/test]$sed -r 's/([( ])(\w+)([,)])/\1"\U\2\E"\3/g' star_wars_example CREATE TABLE "USER" ( "ID" INTEGER PRIMARY "KEY", "NAME" CHARACTER VARYING("50")NOT "NULL", "AGE" INTEGER NOT NULL ); COPY "USER" ("ID", "NAME", "AGE") FROM stdin; 1 Skywalker 19 2 Kenobi 57 To avoid this problem, I want sed to only apply my regexp to the lines starting with COPY and ending with FROM stdin;. I have looked into lookahead / lookbehind, but they are not supported in sed. They seem to be supported in super-sed, but I am currently using Cygwin (Windows is mandatory here...) and it does not seem available in the package list. Is there a way to force sed to only consider specific line? I've considered piping my file through grep before applying sed, but other lines will then disappear from the output. Am I missing something obvious? It would be great if the answer was easily applicable on a default Cygwin install. I guess I could try installing super-sed on cygwin, but I'd like to know if there are more obvious ideas

    Read the article

  • How to process this string via regular expression

    - by iiduce
    my string style like this: expression1/field1+expression2*expression3+expression4/field2*expression5*expression6/field3 a real style mybe like this: computer/(100)+web*mail+explorer/(200)*bbs*solution/(300) "+" and "*" represent operator "computer","web"...represent expression (100),(200) represent field num . field num may not exist. I want process the string to this: /(100)+web*+explorer/(200)bbs/(300) rules like this: if expression length is more than 3 and its field is not (200), then add brackets to it.

    Read the article

  • Picking the right language

    - by simion
    I am a student at University so my experience is limited, hence the question. If someone says to you, here is a task to code, what are you looking at in order to choose the language or paradigm in which you will do it in? Hope the question makes sense?

    Read the article

  • parse string with regular exression

    - by llamerr
    I trying to parse this string: $right = '34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4]'; with following regexp: const word = '(\d{3}\d{2}\)S{0,1}\([^\)]*\)S{0,1}\[[^\]]*\])'; preg_match('/'.word.'{1}(?:\s{1}([+-]{1})\s{1}'.word.'){0,}/', $right, $matches); print_r($matches); i want to return array like this: Array ( [0] => 34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4] [1] => 34601)S(1,6)[2] [2] => - [3] => 34601)(11)[2] [4] => + [5] => 34601)(3)[2,4] ) but i return only following: Array ( [0] => 34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4] [1] => 34601)S(1,6)[2] [2] => + [3] => 34601)(3)[2,4] ) i think, its becouse of [^)]* or [^]]* in the word, but how i should correct regexp for matching this in another way? i tryied to specify it: \d+(?:[,#]\d+){0,} so word become const word = '(\d{3}\d{2}\)S{0,1}\(\d+(?:[,#]\d+){0,}\)S{0,1}\[\d+(?:[,#]\d+){0,}\])'; but it gives nothing

    Read the article

  • Why this C# Regular Expression crashes my program?

    - by robert_d
    using System; using System.IO; using System.Net; using System.Text.RegularExpressions; namespace Working { class Program4 { static string errorurl = "http://www.realtor.ca/propertyDetails.aspx?propertyId=8692663"; static void Main(string[] args) { string s; s = getWebpageContent(errorurl); s = removeNewLineCharacters(s); getFields(s); Console.WriteLine("End"); } public static void getFields(string html) { Match m; string fsRE = @"ismeasurement.*?>.*?(\d+).*?sqft"; m = Regex.Match(html, fsRE, RegexOptions.IgnoreCase); } private static string removeNewLineCharacters(string str) { string[] charsToRemove = new string[] { "\n", "\r" }; foreach (string c in charsToRemove) { str = str.Replace(c, ""); } return str; } static string getWebpageContent(string url) { WebClient client = new WebClient(); client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); Stream data = client.OpenRead(url); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close(); return s; } } } This program hangs. It runs correctly when I remove RegexOptions.IgnoreCase option or when I remove call to removeNewLineCharacters() function. Could someone tell me what is going on, please?

    Read the article

  • Regular Expression to match IP address + wildcard

    - by Ed Woodcock
    Hey guys I'm trying to use a RegularexpressionValidator to match an IP address (with possible wildcards) for an IP filtering system. I'm using the following Regex: "([0-9]{1,3}\\.|\\*\\.){3}([0-9]{1,3}|\\*){1}" Which works fine when running it in LINQPad with Regex.Matches, but doesn't seem to work when I'm using the validator. Does anyone have a suggestion as to either a better Regex or why it would work in test but not in situ? Cheers, Ed

    Read the article

  • Regular expression test can't decide between true and false (JavaScript)

    - by nw
    I get this behavior in both Chrome (Developer Tools) and Firefox (Firebug). Note the regex test returns alternating true/false values: > var re = /.*?\bbl.*\bgr.*/gi; undefined > re /.*?\\bbl.*\\bgr.*/gi > re.test("Blue-Green"); true > re.test("Blue-Green"); false > re.test("Blue-Green"); true > re.test("Blue-Green"); false However, testing the same regex as a literal: > /.*?\bbl.*\bgr.*/gi.test("Blue-Green"); true > /.*?\bbl.*\bgr.*/gi.test("Blue-Green"); true > /.*?\bbl.*\bgr.*/gi.test("Blue-Green"); true > /.*?\bbl.*\bgr.*/gi.test("Blue-Green"); true I can't explain this and it's making debugging very difficult. Can anyone explain this behavior?

    Read the article

  • I want to learn a new language!

    - by Alex
    Hi, I'm a college student majoring in computer science. I know java and will be learning C++ the next couple years at school. I want to add another language to my repertoire and have gotten conflicting advice: Ruby, Python, Perl, JavaScript, PHP, AJAX, among others. I was wondering what everyone's opinions were on the relative value of each of these languages in the job market, the ease of learning of each of the languages, and just personal preferences when it comes to the languages mentioned above. Thanks!

    Read the article

  • .Net Regular Expression

    - by xzerox
    Alright so I want to grab the information on a website thats between [usernames] and [/usernames] I know how to get the string but how would I use regex to only have the information in the middle. Remember I am going to be having more then one thing on the page.

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >