RegEx ignores space in pattern
RegEx ignores space in pattern
- Subject: RegEx ignores space in pattern
- From: Hans Haesler <email@hidden>
- Date: Fri, 19 Mar 2004 17:46:22 +0100
I'd like to match numbers which can be formatted like this:
12 34 56-78
123 456-78
1234 56-78
Using "RegEx Commands" this works fine:
---
set aString to "abc 12 34 56-78 def"
set testString to REMatch aString pattern "[0-9][0-9 ]+-[0-9][0-9]"
-->"12 34 56-78"
But... the text contains other numbers, which shouldn't be matched:
---
set aString to "abc12-34-567def"
set testString to REMatch aString pattern "[0-9][0-9 ]+-[0-9][0-9]"
-->"12-34"
I tried this with "Satimage", too. With the same result.
Why is the space in the second range of characters ignored?
Can someone confirm this problem? Or, hopefully, show me a workaround...
TIA,
Hans
---
Hans Haesler <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.