473,670 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The lost Beginning of line Character for Regex in C# (help needed)

1 New Member
Nowhere can I find the beginning of line Character for Regex in C#. Im using the expression [1-9][0-9]*(, [1-9][0-9]*)*$ But without the <Beginning of line>[1-9][0-9]*(, [1-9][0-9]*)*$ my strings are accepted with random letters in them like "1ThisShouldntB eHere7, 12, 2" because it just starts matching at the 7.

Please I need the beginning of line character for regular expressions in C#... its has become the bane of my existance.

Thanks,
Petimus
Nov 19 '08 #1
3 2442
Ganon11
3,652 Recognized Expert Specialist
Not sure if it's the same in C# as it is in Perl, but you might try the '^' character.
Nov 19 '08 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
I am moving this to the C# forum.
Nov 19 '08 #3
Plater
7,872 Recognized Expert Expert
A quick look at regex for .NET in msdn would have given you the '^' character.
Nov 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
5090
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation, post values go to a PHP processing page that adds values to a database and generates an email to someone in marketing. For three of these sites, we have no problem, but the fourth keeps sending in blank forms.
20
5766
by: Ravi | last post by:
Hi, I have about 200GB of data that I need to go through and extract the common first part of a line. Something like this. >>>a = "abcdefghijklmnopqrstuvwxyz" >>>b = "abcdefghijklmnopBHLHT" >>>c = extract(a,b) >>>print c "abcdefghijklmnop"
0
1249
by: brian fischer via .NET 247 | last post by:
Hello, I am trying to use a regular expression in Visual Basic Script tomatch some filenames within a folder. However, I am having someissues with the negative range character. I cannot seem to finda way to return all results that do NOT include the "+"character and end with a specific extension. The issue seems tobe with the ".*" portion of the statement, but I am notsure how to just return palmpack.par2... filename to match:...
3
5891
by: gogaz | last post by:
Hi there, I have a small problem. I need to replace the "?" character from user input string to "-". I have tried: Regex.Replace(sStr,"\?","-"); //GIVES ERROR Regex.Replace(sStr,@"?","-"); //GIVES ERROR Regex.Replace(sStr,@"\?","-"); //DOES NOT WORKS AS IT LOOKS FOR "\?" Please help!
3
2015
by: c++dummy | last post by:
I got this project for my class and I'm totally lost as to how to copy the 1d array with the bone name into a 2d array using this supposed strncpy function I'm supposed to create. I believe the teacher wants us to make the function and not use the library function. Here's the info: Write a C++ program that
1
2017
by: kellysgirl | last post by:
Step 3 – Add code in the Form’s Load event to select the first radio button: In the Form’s Load event, write code to select the Comma choice in the radio buttons group box. Step 4 – Add code in the Parse Text to List button’s Click event to parse and load the list box: You will need the variables shown in Table 1: Variable name Type Use delimiter String Holds the String character representing the chosen delimiter ...
19
2450
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
This is an example of the data; 2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511) RX 74 bytes 2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13 48 2007/07/27 11:00:03 52 00 52 02 02 C7 83 D7 07 07 1B 0B 00 00 00 00 2007/07/27 11:00:03 28 0A 06 06 06 06 06 06 06 06 06 06 06 0A 06 06
4
3610
by: maria | last post by:
I only use C++ with Visual Studio 6.0 for string manipulations in thousands of HTML pages on my website. Many times, the output files of many of my C++ programs contain a spanish question mark (¿) as their first character. What creates it? How do we avoid it? Thanks! maria
13
3732
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would like to remove the weekday information that is "Wed" here, and I also would like to replace the spaces char by "_" and also remove the "\n" char. I didn't know how to truncate the string from beginning or replace some chars in a string with another...
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8896
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8810
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8590
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7410
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6211
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2035
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.