473,788 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Regex for Alpha-Numerics?

I'm doing a check for only alpha-numerics, but I wanna try it with a regex.
Something like this:

$bReturn = is_alphanum($sS tring).

Can somebody help me do this with regular expressions?

Nov 3 '07 #1
1 1781
On Nov 3, 6:14 pm, "Sanders Kaufman" <bu...@kaufman. netwrote:
I'm doing a check for only alpha-numerics, but I wanna try it with a regex.
Something like this:

$bReturn = is_alphanum($sS tring).

Can somebody help me do this with regular expressions?
Any particular reason you really need a regex? Why not use this:

<http://www.php.net/ctype_alnum>

Nov 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1713
by: Chamomile | last post by:
I have to split strings of the type: $str1 =' Large ladies hats 1.365 0.334'; $str2 = 'Pins 0.335 0.22'; into separate variables (or array members) : say, $textStr, $number1, $number2 or $pieces $pieces $pieces for inclusion in 3 separate fields of a database row I am new to the world of regex and split() or preg_split() etc. and have been trying all day to do this seemingly
354
15927
by: Montrose... | last post by:
After working in c# for a year, the only conclusion I can come to is that I wish I knew c. All I need is Linux, the gnu c compiler and I can do anything. Web services are just open sockets hooked up to interfaces. The Gtk is more than enough gui.
7
5730
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning is to improve, but not to prove.
9
4592
by: Tim Conner | last post by:
Is there a way to write a faster function ? public static bool IsNumber( char Value ) { if (Regex.IsMatch( Value.ToString(), @"^+$" )) { return true; } else return false; }
0
989
by: sd | last post by:
Are any of the special range metacharacters allowed in RegEx operations(System.Text.RegularExpressions) . If so how could you please specify an example. Thx! sd Only the digits 0 to 9 Any alphanumeric character 0 to 9 OR A to Z or a to z.
4
2095
by: skavan | last post by:
Use Case: We have music files that describe, in their filename, attributes of the music. We do not know a general pattern that applies to all filenames -- but we do know that filenames that are clustered together (by for example directory) will, most likely, have the same filename pattern. Here is an example: 10,000 Maniacs - MTV Unplugged - 01 - These are Days.mp3
1
284
by: JM | last post by:
Hi, I am pretty new to regex, and I am trying to find a why to do: 1) I have a paragraph "... the black monkey (gamma5) is the one who develop the first inmunoresitance to alpha-23 also there..." 2) I need to match everything (from some point) until a certain word (example until alpha-23). 3) I have try to use the next regular expression: ".*alpha-23 " but since there are other ocurrence of "alpha-23" it try to match everything.
5
1368
by: Phillip Vong | last post by:
Can someone help me write a simple regex that require a textbox start with http:// or https:// ? I don't know how to write regex. I usually rely on http://regexlib.com but I couldn't find anything good. The closest one I found was this one, but it requires a www also and not all my sites have www. Thanks in advance. ...
10
3894
by: igor.kulkin | last post by:
I have a small utility program written in Python which works pretty slow so I've decided to implement it in C. I did some benchmarking of Python's code performance. One of the parts of the program is using Python's standard re (regular expressions) module to parse the input file. As Python's routines to read from the file and regular expressions are most likely implemented via native libraries I would expect that the C code, which reads...
3
2702
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def RN(name, regex): """protect using () and give an optional name to a regex""" if name:
0
9656
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
10177
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
10113
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
9969
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...
1
7519
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...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.