Mar 04, 2013; 23:37
French, Shelane
testing a regular expression
OK, I don't think my regexp is working properly. Maybe I just wrote it
wrong. How is it best to test?
Here is the text:
[*] Tour participants must wear sturdy shoes enclosing the entire foot; no
high or pointy heel shoes[/*]
[*] Dosimeters are required to tour B581 and can be obtained from the
Badge Office[/*]
[*] Be aware that the tour route availability is subject to change daily
due to operation or shot activity[/*]
[*] Tour attendees must be 18 years of age or older. Send an email request
for approval for minors[/*]
Here is what I want to do:
-Remove all white space between [/*] and [*] and replace with a single
carriage return
-Remove white space after [*] before text begins
So the final should look like:
[*]Tour participants must wear sturdy shoes enclosing the entire foot; no
high or pointy heel shoes[/*]
[*]Dosimeters are required to tour B581 and can be obtained from the Badge
Office[/*]
[*]Be aware that the tour route availability is subject to change daily
due to operation or shot activity[/*]
[*]Tour attendees must be 18 years of age or older. Send an email request
for approval for minors[/*]
This is what I had originally:
$description = string_ReplaceRegExp($description,
-find='(\\s+[/*]\\s+[*])+', -replace='[/*]\r\n[*]');
Then I changed to this thinking that the [ and ] needed to be escaped:
$description = string_ReplaceRegExp($description,
-find='(\\s+\\[/*\\]\\s+\\[*\\])+', -replace='[/*]\r\n[*]');
I even tried changing the replace to see if I can get some output:
$description = string_ReplaceRegExp($description,
-find='(\\s+[/*]\\s+[*])+', -replace='***');
Still, it remains the original, which tells me that it's not finding what
I think I'm telling it to find.
I'm on 8.5.6
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Mar 04, 2013; 15:54
Steve Piercy - Web Site Builder
Re: testing a regular expression
Mar 04, 2013; 19:03
Kyle Jessup
Re: testing a regular expression