How to filter out a portion of the text data with re.match or any other regex method with Python? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsDealing with diverse text datahow to get the Polysemes of a word in wordnet or any other api?Python: validating the existence of NLTK data with database searchHow to programmatically suggest changes to a text to match some other text?How to use Non Negative Matric Factorization (NMF)'s transform method to project topics on new text dataAny research on segmentation of non-text contents out of (mostly) text-documents?Are there any good out-of-the-box language models for python?any efficient way to find surrounding adjective/verbs with respect to the target phrase in python [updated]?How to generate list with out for loop in pythonText Mining/Printing with Python

Is it true that "carbohydrates are of no use for the basal metabolic need"?

Echoing a tail command produces unexpected output?

LaTeX gives error undefined control sequence table

I am not a queen, who am I?

Why is black pepper both grey and black?

Is there any avatar supposed to be born between the death of Krishna and the birth of Kalki?

Can a non-EU citizen traveling with me come with me through the EU passport line?

How do I stop a creek from eroding my steep embankment?

How to deal with a team lead who never gives me credit?

Do I really need recursive chmod to restrict access to a folder?

How can I fade player character when he goes inside or outside of the area?

Problem drawing boxes with arrows in tikZ

What do you call a plan that's an alternative plan in case your initial plan fails?

How to do this path/lattice with tikz

Why constant symbols in a language?

Antler Helmet: Can it work?

Were Kohanim forbidden from serving in King David's army?

Storing hydrofluoric acid before the invention of plastics

What are the possible ways to detect skin while classifying diseases?

Why was the term "discrete" used in discrete logarithm?

Dating a Former Employee

When to stop saving and start investing?

Is there a concise way to say "all of the X, one of each"?

Is the address of a local variable a constexpr?



How to filter out a portion of the text data with re.match or any other regex method with Python?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsDealing with diverse text datahow to get the Polysemes of a word in wordnet or any other api?Python: validating the existence of NLTK data with database searchHow to programmatically suggest changes to a text to match some other text?How to use Non Negative Matric Factorization (NMF)'s transform method to project topics on new text dataAny research on segmentation of non-text contents out of (mostly) text-documents?Are there any good out-of-the-box language models for python?any efficient way to find surrounding adjective/verbs with respect to the target phrase in python [updated]?How to generate list with out for loop in pythonText Mining/Printing with Python










0












$begingroup$


I have the following data :



Node : WATER-7609-WR1 

IP Address : 172.20.150.81

Severity : 5 - Critical

ServerSerial : 50505223

SNSupportGroup : UC-WAN

Node Location : CO 160 WATER 8 FL RCV

Event Details : Unknown Not Link Down or Up trap on Serial Channel: Unknown Severity: 4
NOTE:Configuration Item is not found in CMDB. Please update Incident with related Configuration Item


I am interested in all text after "Event Details :",
I have used the the following function :



def eventdetails(text): 
match =re.search(r'Event Details :[^.]*',text)
return match

print(eventdetails(dfnetcool_inc["Description"][3]))

output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap >


--> Am not getting all of the text after Event Details. Perhaps there is an EOL charecter - how do I get remainder of the text, request your help, TIA!










share|improve this question











$endgroup$











  • $begingroup$
    Could you help us by indicating which part of the message you are interested in?
    $endgroup$
    – El Burro
    Apr 1 at 14:46










  • $begingroup$
    I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
    $endgroup$
    – Vivek Rmk
    Apr 1 at 15:54











  • $begingroup$
    solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
    $endgroup$
    – Vivek Rmk
    Apr 1 at 21:07















0












$begingroup$


I have the following data :



Node : WATER-7609-WR1 

IP Address : 172.20.150.81

Severity : 5 - Critical

ServerSerial : 50505223

SNSupportGroup : UC-WAN

Node Location : CO 160 WATER 8 FL RCV

Event Details : Unknown Not Link Down or Up trap on Serial Channel: Unknown Severity: 4
NOTE:Configuration Item is not found in CMDB. Please update Incident with related Configuration Item


I am interested in all text after "Event Details :",
I have used the the following function :



def eventdetails(text): 
match =re.search(r'Event Details :[^.]*',text)
return match

print(eventdetails(dfnetcool_inc["Description"][3]))

output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap >


--> Am not getting all of the text after Event Details. Perhaps there is an EOL charecter - how do I get remainder of the text, request your help, TIA!










share|improve this question











$endgroup$











  • $begingroup$
    Could you help us by indicating which part of the message you are interested in?
    $endgroup$
    – El Burro
    Apr 1 at 14:46










  • $begingroup$
    I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
    $endgroup$
    – Vivek Rmk
    Apr 1 at 15:54











  • $begingroup$
    solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
    $endgroup$
    – Vivek Rmk
    Apr 1 at 21:07













0












0








0





$begingroup$


I have the following data :



Node : WATER-7609-WR1 

IP Address : 172.20.150.81

Severity : 5 - Critical

ServerSerial : 50505223

SNSupportGroup : UC-WAN

Node Location : CO 160 WATER 8 FL RCV

Event Details : Unknown Not Link Down or Up trap on Serial Channel: Unknown Severity: 4
NOTE:Configuration Item is not found in CMDB. Please update Incident with related Configuration Item


I am interested in all text after "Event Details :",
I have used the the following function :



def eventdetails(text): 
match =re.search(r'Event Details :[^.]*',text)
return match

print(eventdetails(dfnetcool_inc["Description"][3]))

output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap >


--> Am not getting all of the text after Event Details. Perhaps there is an EOL charecter - how do I get remainder of the text, request your help, TIA!










share|improve this question











$endgroup$




I have the following data :



Node : WATER-7609-WR1 

IP Address : 172.20.150.81

Severity : 5 - Critical

ServerSerial : 50505223

SNSupportGroup : UC-WAN

Node Location : CO 160 WATER 8 FL RCV

Event Details : Unknown Not Link Down or Up trap on Serial Channel: Unknown Severity: 4
NOTE:Configuration Item is not found in CMDB. Please update Incident with related Configuration Item


I am interested in all text after "Event Details :",
I have used the the following function :



def eventdetails(text): 
match =re.search(r'Event Details :[^.]*',text)
return match

print(eventdetails(dfnetcool_inc["Description"][3]))

output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap >


--> Am not getting all of the text after Event Details. Perhaps there is an EOL charecter - how do I get remainder of the text, request your help, TIA!







python nlp regex






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 1 at 19:14









oW_

3,341933




3,341933










asked Apr 1 at 13:55









Vivek RmkVivek Rmk

12




12











  • $begingroup$
    Could you help us by indicating which part of the message you are interested in?
    $endgroup$
    – El Burro
    Apr 1 at 14:46










  • $begingroup$
    I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
    $endgroup$
    – Vivek Rmk
    Apr 1 at 15:54











  • $begingroup$
    solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
    $endgroup$
    – Vivek Rmk
    Apr 1 at 21:07
















  • $begingroup$
    Could you help us by indicating which part of the message you are interested in?
    $endgroup$
    – El Burro
    Apr 1 at 14:46










  • $begingroup$
    I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
    $endgroup$
    – Vivek Rmk
    Apr 1 at 15:54











  • $begingroup$
    solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
    $endgroup$
    – Vivek Rmk
    Apr 1 at 21:07















$begingroup$
Could you help us by indicating which part of the message you are interested in?
$endgroup$
– El Burro
Apr 1 at 14:46




$begingroup$
Could you help us by indicating which part of the message you are interested in?
$endgroup$
– El Burro
Apr 1 at 14:46












$begingroup$
I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
$endgroup$
– Vivek Rmk
Apr 1 at 15:54





$begingroup$
I am interested in all text after "Event Details :", I have used the the following function : def eventdetails(text): match =re.search(r'Event Details :[^.]*',text) return match print(eventdetails(dfnetcool_inc["Description"][3])) output: <_sre.SRE_Match object; span=(159, 292), match='Event Details : Unknown Not Link Down or Up trap > --> Am not getting all of the text.
$endgroup$
– Vivek Rmk
Apr 1 at 15:54













$begingroup$
solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
$endgroup$
– Vivek Rmk
Apr 1 at 21:07




$begingroup$
solved : I used - match =re.findall(r'Event Details :[^*]+',flags= re.M, string= text)
$endgroup$
– Vivek Rmk
Apr 1 at 21:07










1 Answer
1






active

oldest

votes


















0












$begingroup$

nice that you solved it. This would also work:



import re

def eventdetails(text):
match =re.search(r'Event Details :(.*)',text, flags=re.S)
return match

result = eventdetails(text)
print(result.group(0))





share|improve this answer









$endgroup$












  • $begingroup$
    Yes that works too! Thanks!
    $endgroup$
    – Vivek Rmk
    Apr 2 at 14:42











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48353%2fhow-to-filter-out-a-portion-of-the-text-data-with-re-match-or-any-other-regex-me%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0












$begingroup$

nice that you solved it. This would also work:



import re

def eventdetails(text):
match =re.search(r'Event Details :(.*)',text, flags=re.S)
return match

result = eventdetails(text)
print(result.group(0))





share|improve this answer









$endgroup$












  • $begingroup$
    Yes that works too! Thanks!
    $endgroup$
    – Vivek Rmk
    Apr 2 at 14:42















0












$begingroup$

nice that you solved it. This would also work:



import re

def eventdetails(text):
match =re.search(r'Event Details :(.*)',text, flags=re.S)
return match

result = eventdetails(text)
print(result.group(0))





share|improve this answer









$endgroup$












  • $begingroup$
    Yes that works too! Thanks!
    $endgroup$
    – Vivek Rmk
    Apr 2 at 14:42













0












0








0





$begingroup$

nice that you solved it. This would also work:



import re

def eventdetails(text):
match =re.search(r'Event Details :(.*)',text, flags=re.S)
return match

result = eventdetails(text)
print(result.group(0))





share|improve this answer









$endgroup$



nice that you solved it. This would also work:



import re

def eventdetails(text):
match =re.search(r'Event Details :(.*)',text, flags=re.S)
return match

result = eventdetails(text)
print(result.group(0))






share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 2 at 8:23









El BurroEl Burro

455311




455311











  • $begingroup$
    Yes that works too! Thanks!
    $endgroup$
    – Vivek Rmk
    Apr 2 at 14:42
















  • $begingroup$
    Yes that works too! Thanks!
    $endgroup$
    – Vivek Rmk
    Apr 2 at 14:42















$begingroup$
Yes that works too! Thanks!
$endgroup$
– Vivek Rmk
Apr 2 at 14:42




$begingroup$
Yes that works too! Thanks!
$endgroup$
– Vivek Rmk
Apr 2 at 14:42

















draft saved

draft discarded
















































Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48353%2fhow-to-filter-out-a-portion-of-the-text-data-with-re-match-or-any-other-regex-me%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?