I am attempting to make (without the perl expansions) a regular
expansion that when used as a delim will split words on any
punction/whitespace character *EXCEPT* $ (for java people I want to
feed it into something like this:
for(String foo:input.split([insert regex here])
...
Aryeh M. Friedman wrote:
I am attempting to make (without the perl expansions) a regular
expansion that when used as a delim will split words on any
punction/whitespace character *EXCEPT* $ (for java people I want to
feed it into something like this:
for(String foo:input.split([insert regex
Aryeh M. Friedman wrote:
I am attempting to make (without the perl expansions) a regular
expansion that when used as a delim will split words on any
punction/whitespace character *EXCEPT* $ (for java people I want to
feed it into something like this:
for(String foo:input.split([insert regex
Matthew Seaman wrote:
Drew Tomlinson wrote:
Matthew Seaman wrote:
% perl -p -e 's/cn=([^ ,]+) ([^,]+),/cn=$2 $1,/' foo.txt
I still don't really understand *why* the above works but I'm trying
to pick it apart now.
The RE breaks down like this:
/cn=([^ ,]+) ([^,]+),/
cn=
I'm attempting to take an ldiff file and flip first/last name order.
However I can not figure out how to match hyphenated last names. In
vim, my current search/replace string is:
%s/cn=\(\w\+\-*\) \(\w\+\),/cn=\2 \1,/gc
This will match:
cn=Smith Joe,
and replace it with:
cn=Joe Smith,
On Sun, 30 Nov 2008 09:14:53 -0800
Drew Tomlinson [EMAIL PROTECTED] wrote:
I'm attempting to take an ldiff file and flip first/last name order.
you can try using sh (i'm using zsh)
file data.txt has the following:
joe brown
joe brown-smith
file t.sh is coded as:
#!/usr/local/bin/zsh
#
Drew Tomlinson wrote:
I'm attempting to take an ldiff file and flip first/last name order.
However I can not figure out how to match hyphenated last names. In
vim, my current search/replace string is:
%s/cn=\(\w\+\-*\) \(\w\+\),/cn=\2 \1,/gc
This will match:
cn=Smith Joe,
and replace it
On Sun, 30 Nov 2008 09:14:53 -0800, Drew Tomlinson [EMAIL PROTECTED] wrote:
I'm attempting to take an ldiff file and flip first/last name order.
However I can not figure out how to match hyphenated last names. In
vim, my current search/replace string is:
%s/cn=\(\w\+\-*\) \(\w\+\),/cn=\2
Matthew Seaman wrote:
Drew Tomlinson wrote:
I'm attempting to take an ldiff file and flip first/last name order.
However I can not figure out how to match hyphenated last names. In
vim, my current search/replace string is:
%s/cn=\(\w\+\-*\) \(\w\+\),/cn=\2 \1,/gc
This will match:
Drew Tomlinson wrote:
Matthew Seaman wrote:
% perl -p -e 's/cn=([^ ,]+) ([^,]+),/cn=$2 $1,/' foo.txt
I still don't really understand *why* the above works but I'm trying to
pick it apart now.
The RE breaks down like this:
/cn=([^ ,]+) ([^,]+),/
cn= Match literal
Hi,
I still don't really understand *why* the above works but I'm trying
to pick it apart now.
Whenever I have a doubt about regular expression, I use the regexp
coach. It works on Windows, but I find it a very intelligent and
usefull tool.
http://weitz.de/regex-coach/
Best regards,
Olivier
11 matches
Mail list logo