473,656 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Regular Expression] excluding alphanumerical chars

teo
Hallo,

I need to match a word in its "absolute" way, that is

with no alphanumerical chars
before and after it :
only blank spaces and interpuntuactio n are accepted.

I tried with
[\W]myword[\W]

it works, but
it misses the cases where myword is at
the beginning of the line
and
at the ending of the line

Here is a screenshot (13kb) of the situation:
http://www.zshare.net/image/immagine-gif-7rk.html
Here is the same texting text :

Per andare per galli con la speranaza però di alcuno per
Non vorrei -per ma anche per- quindi abbiamo .Per, cuiper e salame per.
Per Non vorrei per
Sep 20 '06 #1
0 977

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

Similar topics

12
1906
by: hq4ever (at) 012 (dot) net (dot) il | last post by:
function testemail($email) { $validEmailExpr = "^(?)*@(?)*$"; return eregi($validEmailExpr, $email); } $email = "foo@bar.gov.mil"; testmail($email); //return TRUE
5
2066
by: sbd! | last post by:
I had a problem with string which have some \ chars at the end of the string. For example: $String = "I want this **** out of here\\\\\\\\\"; I needed to remove it useing regular expression...i thinked that something like "/\\+$/" is enough but i was wrong. I made some tries and finaly i removed "\" chars it with "/\\\+$/". It works (i'm proud with myself :)), but i can't understand why \\\ matchs single \, and \\ not...
1
408
by: Stefan Reiter | last post by:
Hi, I need one function to validate streetnames and one to validate names. I tried to write my own regular expression and to use preg_match, but for some weird reason I can't get it to work. Valid names should be: Peter Christian-Peter Li
2
239
by: Ron Vecchi | last post by:
I'm tring to figure out the expression to use to search a bunch of documents that contain a word but do not contain a different word. Not having any luck though! Any ideas Thanks for the help
3
3209
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is that this will one or more occurrences to replace all the white space between with a comma. This search ElseIf InStr(1, indivline, "$") Then insert a replace statement that uses the regular expression to find and replace all the white space...
2
1694
by: Ross Ylitalo | last post by:
I have been trying to put together a regular expression that will trap any string with the exact string "&#" (without the quotes) and have been having no luck. Can anyone tell me if this is possible or not? Even better, can anyone show the regular expression I am looking for? Thank you, Ross Ylitalo
25
5147
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART (CONDUCTION DEFECT) 37.33/2 HEART (CONDUCTION DEFECT) WITH CATHETER 37.34/2 " the expression is "HEART (CONDUCTION DEFECT)". How do I gain access to the expression (not the matches) at runtime? Thanks, Mike
0
262
by: teo | last post by:
Hallo, I need to match a word in its "absolute" way, that is with no alphanumerical chars before and after it : only blank spaces and interpuntuaction are accepted. I tried with myword
7
11328
by: Sharkie | last post by:
I need a regular expression which will evaluate to false if number of consecutive characters (non-whitespace) exceeds certain number (10 in this example). For example, I have this function: function test() { var sValue="short unusuallyLongAndWayTooLongString short2"; var regEx=/\S{10,}/; return regEx.test(sValue);
8
23242
by: Sharkie | last post by:
I need a regular expression to evaluate a text input field. The validation rules are: 1) only A-Z and 0-9 chars allowed, 2) only one alpha char allowed (at any position) - rest are digits, 3) total length must be between 9 and 12 chars, a valid example would be "123A456789" I can enforce the first two rules by using this:
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8710
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
8497
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
8598
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
7310
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...
0
5627
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
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
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
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.