Home: Perl Programming Help: Regular Expressions:
regex with "}"



Kimaro
New User

Oct 28, 2014, 6:07 AM


Views: 29851
regex with "}"

I need help Wink

my regex doesn't work. I receive the message:

Use of uninitialized value $xyz in pattern match (m//) at ./new 1.pl line 36

my regex is:

Code
if ($xyz =~ /\}/) {

my other :

Code
if ($xyz =~ m/\\}/is) {

please help me and my hopeless try using regex.
And sorry for my bad english :D


(This post was edited by Laurent_R on Oct 28, 2014, 11:14 AM)


FishMonger
Veteran / Moderator

Oct 28, 2014, 6:14 AM


Views: 29847
Re: [Kimaro] regex with "}"

The } in the regex is not the problem.

Here's the problem: Use of uninitialized value $xyz


Laurent_R
Veteran / Moderator

Oct 28, 2014, 11:11 AM


Views: 29839
Re: [Kimaro] regex with "}"

The $xyz variable is not defined at this point in the code. But since you did not provide the rest of the code, it will be difficult to help you further.


Laurent_R
Veteran / Moderator

Oct 28, 2014, 11:15 AM


Views: 29837
Re: [Kimaro] regex with "}"

Plezase note that I have edited your post to put the code wit-hin CODE tags.

If you provide more of your code, please do likewise.