Regular expression patterns with data types?

2013-03-16  Source: Original Site  Category:C++  Views:0 


I am wondering if a regex can contain a placeholder for a data type, for example 'double'. In particular, I want to check if a certain input string contains a 'double' number:

string input = "this is a double: 2.25";

// Is there such a thing similar to this???
Regex rx = new Regex("{double}");
Match m = rx.Match(input);

...and m would contain 2.25 (cos it's a double).

Related articles
  • Regular expression patterns with data types? 2013-03-16

    I am wondering if a regex can contain a placeholder for a data type, for example 'double'. In particular, I want to check if a certain input string contains a 'double' number: string input = "this is a double: 2.25"; // Is there such a thing similar

  • Regular Expression patterns 2012-08-08

    I use the following regular expressions of PHP in a class. It's purpose is to add the parameter "interlang" to every anchor in the string $neuezeile. It works fine, but it's *really* slow. So I read about the very fast PCRE functions, but I don't get

  • Help: regular expression pattern in preg_replace() 2012-05-23

    Here is my function: <? function nl2p($str) { return str_replace('<p></p>', '', '<p>' . preg_replace('#\n|\r#', '</p>$0<p>', $str) . '</p>'); } ?> I need to change the regular expression pattern #\n|\r# to so

  • how create table with data type Enum and autoincrement 2013-08-24

    im dummie in db 2, i like create a table with data type Enum an data with property auto increment. my query in Mysql is this: CREATE TABLE bines ( id int(6) NOT NULL auto_increment, tipo_tarjeta enum('CREDITO','DEBITO','AMEX') NOT NULL, inicio int(6)

  • C++: problam with data type(int,float,doubl e) 2014-11-10

    everyone, I have a problam with data types which are using in C++. I am so confuce about int,float,double,strings,etc; And numbers of bits that related to each data type. Please anyone help me to solve my problam.

  • Does db2move work with data type BLOB? 2014-11-24

    Does db2move work fine when the tables has fields with data type BLOB? Or should I set some special options?

  • problem with data type 2015-01-02

    I am using MS Access and I have a problem with Data Type I have a field with data type varchar in my table I want to convert to integer in my query But I can`t .... In MS SQL I used SELECT CONVERT(char(20), myfield) as myfield FROM mytable It is work


    Ok, so I have read other forum posts on similar issues but none seem to help me out. Here is the error i am getting and the equivalent code: sql = calculateSQL sql2 = calculateDisplaySQL If sql = "" Then MsgBox ("No criteria selected") Else 'call rep

  • Oracle Need a Better Regular Expression for Validating Dates 2014-09-23

    I have data coming from file with date in the format DD-MON-YY. I have created the following regular expression: '^([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})-(JAN|FEB|MAR|A PR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|Jan|Feb|Mar|Apr |May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-[

  • Regular expression class with child/parent 2012-01-07

    I'm trying to figure out what would be the best way to develop a regular expression class that can have child or parent. I want to develop a generic regex extractor for text files. Example : - An HTML file has a table - Each table has some data (let'

  • Access 97 -- query chokes with data type mismatch 2012-02-16

    My first post here -- looks like a great resource. I've been using Access 97 for a long time. Use it often, haven't upgraded due to compatibility issues here at work. Here's my problem right now: I've got a query based on a four tables, one "main" ta

  • SQL query with data type mismatch problem. DateTime issue 2012-03-15

    Can anyone help me with this problem please. I am writing a program in C# and have an access db07. The user should be able to enter a date into a text box then that date is addedd to my sql query and then return all record with that date. I keep gett

  • Ubuntu Converting Disk Images with Data Types? 2013-01-11

    I have a disk image (MDF/MDS) with disk image protection data type (Securom 5)... When the image is converter to ISO, the data type is removed and the disk won't load correctly. Is there a way to convert the image while preserving the data type? (use

  • Newbie question:how to reset a field with data type of auto number 2013-04-26

    For example I have a "Customers" table with two field: customerID (data type: Auto number) customer_name: (data type: text) And I have about 50 records in this table, of course with each record there are in customerID fileld and autonumber (1,2,3,4..

  • Oracle Data not comptible with data type 2013-09-10

    Here is my problem : I have this structure : create table testval (val number(5)) insert into testval values (111.1) select * from testval stored data is=111 Now is there any setting or option that oracle will ignore this type of data which is not co

  • can i use regular Expression to chanege date format 2014-07-11

    can i change date formation from "yyyy-mm-dd" to "mm/dd/yyyy" using regular expressions. how do start it,help me

  • Oracle Use GetInt32() with data type NUMBER 2014-08-08

    I have a program which uses the function GetInt32() on data type INT (SQL Server) and it's ok. With this same program, i want to use the function GetInt32() with a database Oracle. [This website|

  • MySQL Insert into clause problem with date type 2014-08-09

    greetings i having issues inserting dates in a field with the type DATE this is the string im trying to execute : INSERT INTO postraids (datep) values (6/26/2008) and it is inserting a row fine but the date its entering is 0000-00-00 in the field and

  • Req help with data types/domains 2015-01-04

    I have a data type called ModelElement_t, the type contains 2 attributes: name & visibility. name can be represented as a string, only visibility is to be represented as an adt visibilityKind CREATE TYPE ModelElement_t AS (name varchar, visibilit

  • Oracle Item messageTextInput with Data Type - Date 2015-01-14

    I am working on a custom extension using OAF where in a region there are a few Items and one of them is a 'messageTextInput'. Here I have put the Data Type as 'Date' so that the date selection dialog box appears for the user to select the date from.