473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Perl Regular Expression

40
Hi All,

I facing a problem in matching flat character symbol.

I cant able to find the · this character in the word.

Here is my script.

Expand|Select|Wrap|Line Numbers
  1. $word = "Baal·bek";
  2.  
  3. if($word=~m#·#)
  4. {
  5. print "Match found";
  6. }
  7. else
  8. {
  9. print "Not Match found";
  10. }
  11.  
while running above script it prints "Not Match Found".

whats arong in this code.

thanks in advance
May 6 '09 #1
2 1373
cnsabar
40
Hi,

I found the solution. but do know why this is happening.

The specified script works fine when I read a file Content using following syntax
Expand|Select|Wrap|Line Numbers
  1. open(FR, "<$FilePath");
  2.  
and its not works when I read a file data using utf-8 format
Expand|Select|Wrap|Line Numbers
  1. open(FR, "<:utf8", "$FilePath");
  2.  
Can anyone guide me regarding this.
May 6 '09 #2
numberwhun
3,509 Expert Mod 2GB
First, and I know this has been said in the past, please use code tags around all code that you place in your forum posts. It makes the post much easier to read. Thank you!

As for your issue, what you are going to want to do is use the ASCII value of the character you are trying to match. To do so, you will have to use an escape sequence and the ascii value for the character you want to match.

In this case, I believe 142 is the ascii sequence you wan to use.

Regards,

Jeff
May 13 '09 #3

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

Similar topics

6
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
4
by: pekka niiranen | last post by:
Hi there, I have perl script that uses dynamically constructed regular in this way: ------perl code starts ---- $result ""; $key = AAA\?01; $key = quotemeta $key; $line = " ...
17
by: Michael McGarry | last post by:
Hi, I am just starting to use Python. Does Python have all the regular expression features of Perl? Is Python missing any features available in Perl? Thanks, Michael
75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
6
by: Danny Lu | last post by:
Hi, can anyone tell me where I can get a good perl book? TIA Dan
9
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our...
3
by: John Nagle | last post by:
Here's a large Perl regular expression, from a Perl address parser in CPAN: use re 'eval'; $Addr_Match{street} = qr/ (?: # special case for addresses like 100 South Street...
8
by: John Pye | last post by:
Hi all I have a file with a bunch of perl regular expressions like so: /(^|)\*(.*?)\*(|$)/$1'''$2'''$3/ # bold /(^|)\_\_(.*?)\_\_(|$)/$1''<b>$2<\/ b>''$3/ # italic bold...
3
by: seberino | last post by:
How similar is Python's re module (regular expressions) compared to Perl's and grep's regular expression syntaxes? I really hope regular expression syntax is sufficiently standardized that we...
5
by: prekida | last post by:
I have'nt used perl-style regular expression much. i have a need to search for a string called ORA-04031 error from a log file I use the following regular expression ORA-0*(4031) and the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.