Need a regular expression to do the following

I need a regular expression that will simply return everything (yes, everything) after a one CRLF.

Right now I have "\n[A-Z0-9]+" which works, except that it is padding the return value with a non-printable ascii character.  Could it be including the LF in the result?  What should my regular expression be changed to to fix this?
LVL 15
David L. HansenProgrammer AnalystAsked:
Who is Participating?
 
Terry WoodsIT GuruCommented:
Sorry, missed the ending bracket (but actually don't need the brackets):
(?<=\n)[A-Z0-9]+
0
 
AngryBinaryCommented:
Yes. It is matching the newline because you've included it in the match. To specify a subset of your regex, use a match group by putting the bit your interested in separating inside of parentheses:

 "\n([A-Z0-9]+)"

... and depending on the language that you are invoking the regex match from, there is usually a method of getting the matches from each individual match group. Refer to documentation, or let us know what language you are using.
0
 
David L. HansenProgrammer AnalystAuthor Commented:
"\n([A-Z0-9]+" returns the same thing.  I understand now that I was hardcoding the LF in my results.  I want to look for CRLF then grab everything after it.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
ozoCommented:
what regular expression language are you using, and how are you getting the return value?
0
 
Terry WoodsIT GuruCommented:
This should do it:
(?<=\n)([A-Z0-9]+
0
 
David L. HansenProgrammer AnalystAuthor Commented:
The SIRE Document Management tool has a user scripting area (just a gui window) where the user can put in a regular expression.  I'm not sure which flavor of regex SIRE uses.  The results are simply shown in the same gui.
0
 
Terry WoodsIT GuruCommented:
Or in case you have more than just capital letters and numbers to be captured, use:
(?<=\n).*
0
 
David L. HansenProgrammer AnalystAuthor Commented:
I think we've got it! Thank you.  
The window for building and testing expressions returns exactly what I want; however, when applied to a real document, blanks are returned.  I think that is just a SIRE setting problem or something.  I'll keep working that issue, but I certainly can award the points now.
0
 
David L. HansenProgrammer AnalystAuthor Commented:
Perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.