counting number of characters b/w spaces

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
dev_net
Forum Newbie
Posts: 5
Joined: Fri Aug 10, 2007 1:39 am

counting number of characters b/w spaces

Post by dev_net »

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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

(#10850)
dev_net
Forum Newbie
Posts: 5
Joined: Fri Aug 10, 2007 1:39 am

Post by dev_net »

Thanks. But i need to implement this in pcre :( . I need to see if two strings are of equal length.
User avatar
GeertDD
Forum Contributor
Posts: 274
Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium

Post by GeertDD »

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 »

actually i am using pcre regex with snort. And in snort i can only use pcre for expression matching.
Post Reply