Any questions involving matching text strings to patterns - the pattern is called a "regular expression."
Moderator: General Moderators
dev_net
Forum Newbie
Posts: 5 Joined: Fri Aug 10, 2007 1:39 am
Post
by dev_net » Tue Aug 21, 2007 12:04 am
Hi all,
I have this problem which i am not sure how can i accomplish using pcre. I need to calculate if two strings lengths are same. In other words i want to know the character count of strings? How can i accomplish this? Thanks in advance.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Tue Aug 21, 2007 12:08 am
(#10850)
dev_net
Forum Newbie
Posts: 5 Joined: Fri Aug 10, 2007 1:39 am
Post
by dev_net » Tue Aug 21, 2007 12:13 am
Thanks. But i need to implement this in pcre
. I need to see if two strings are of equal length.
GeertDD
Forum Contributor
Posts: 274 Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium
Post
by GeertDD » Tue Aug 21, 2007 2:37 am
Could you give an example of exactly how you want to 'implement strlen() into PCRE'?
Why not match the two parts and then check if strlen($match[1]) == strlen($match[2])?
dev_net
Forum Newbie
Posts: 5 Joined: Fri Aug 10, 2007 1:39 am
Post
by dev_net » Tue Aug 21, 2007 3:58 am
actually i am using pcre regex with snort. And in snort i can only use pcre for expression matching.