Trying to use an EasyPattern

A discussion of how to use EasyPatterns, EasyPattern Helper and using the EasyPattern library.

Moderator: DataMystic Support

BHeckle

Trying to use an EasyPattern

Postby BHeckle » Mon May 31, 2004 3:48 pm

I am trying to do a replacement using easypatterns for part of my evaulation.

static int
function_name(retval)
struct descr *retval;

transformed into

static int function_name(struct descr* retval)

my easy pattern for matching fails:
static int[vSpace][(oneOrMore letter or digit)1][leftparen]['retval'][rightparen][vspace][spaces]['struct descr *retval;']

my replace is
static int $1(struct descr* retval)

Please give me a few clues so I can figure out what I am doing wrong.

Thanks

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Tue Jun 01, 2004 12:05 pm

Hi B,

Use [cr,lf] instead of [vspace]. vspace matches only a single character.

[spaces] matches a single space, use [1+ spaces]

Debug your pattern from left to right - delete the right hand half and then figure out gradually what you have wrong.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “EasyPatterns Support”

Who is online

Users browsing this forum: No registered users and 1 guest