Hi, I am having some issues with the Regex output for the text parser. When I run it it only creates an empty output. It doesn’t matter how many times I try to fix the errors on https://regex101.com/ I am not able to extract any info.
Here is my regex:
Shop:\s*(?[^\n])\sOnsite:\s*(?[^\n])\sTruck:\s*(?[^\n])\sCrew:\s*(?[^\n])\sYard Notes:\s*(?(?:*.\n))\sLabor Notes:\s* Sales Person:\s*(?[^\n])\s* Condition:\s*(?[^\n])\s* Detailer:\s*(?[^\n])\s* Location:\s*(?[^\n])\s* \d+K ([^\n])\s* Type:\s*(?[^\n])\s* Laydown Area:\s*(?[^\n])\s* Contact:\s*(?[^\n])\s* Build Packet:\s*(?.?[https://[^]]+])\s* Move/Mod Packet:\s*(?.?[https://[^]]+])\s* TD Packet:\s*(?.?[https://[^]]+])\s* SSI Bid#:\s*(?[^\n])\s* Advance PO#:\s*(?[^\n])\s* Training:\s*(?[^\n])\sGrab Items:\s*(?[^\n])\sLabor Instructions:\s*(?[^\n]*)/;
I am trying to extract the corresponding info from the text.
- Shop
- Onsite
- Truck
- Crew
- Yard Note
- Sales person
- Condition
- Type
- Detailer
- Contact
- Build Packet (URL only)
- Move/Mod Packet (URL only)
- TD Packet (URL only)
- Advance PO#
- Grab Items
- Labor Instructions
Here is a sample of the text. Text will change but the Titles will always be the same:
Shop: Shop_test
Onsite: 7am_onsite_test
Truck: Truck_test
Crew: Nino Z, Milder V, Hannah S, Tyler S, Brandon R, TJ C,
Yard Notes:
- 1 Large rack
- 1 Large basket
- 4 dunnage
- Blue Cart
Labor Notes:
Grab Items:
Labor Instructions: Shitty pack – Hand carry upstairs or rig up something to hoist up rutunda. I will go over this with detailer
Schedule Notes:
Filler if needed Jasper N Tyrone P
Welcome to the Make community!
When reaching out for assistance with your regex pattern for a Text Parser module, it would be super helpful if you could share the actual text you’re trying to match. Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.
Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets.
Format Text (or the forum will make it unusable)
Please format the example text this way to preserve line breaks and special characters:
These are the two ways to format text so that it won’t be modified by the forum:
-
Method 1: Type code block manually
Add three backticks ```
before and after the content/bundle, like this:
```
content goes here
```
-
Method 2. Highlight and click the format button in the editor
Alternatively,
Could you go to regex101.com, paste in your Pattern at the top and paste a complete/full example text you are trying to match from below it?
Then, save the regex example and share the link with us here.
This will allow others to assist you here with your pattern. Thanks!
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
Thank you, Here is the Template text:
Shop:
Onsite:
Truck:
Crew:
Yard Notes:
Labor Notes:
Condition:
Sales Person:
Detailer:
Contact:
Location:
Type:
Laydown Area:
Build Packet:
Move/Mod Packet:
TD Packet:
SSI Bid#:
Advance PO#:
Courier Date:
Training:
Grab items:
Labor Instructions:
Schedule Instructions:
Schedule Notes:
Here is the regex: regex101: build, test, and debug regex
You should use “groups” as well. Then you can manipulate the text easier in the rest of the scenario
Thank you. I pretty sure i did on the regex but I am not able to get anything out of it
Welcome to the Make community!
You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):
Shop:\s+([\w\W]*?)\s*Onsite:\s+([\w\W]*?)\s*Truck:\s+([\w\W]*?)\s*Crew:\s+([\w\W]*?)\s*Yard Notes:\s+([\w\W]*?)\s*Labor Notes:\s+([\w\W]*?)\s*Sales Person:\s+([\w\W]*?)\s*Condition:\s+([\w\W]*?)\s*Detailer:\s+([\w\W]*?)\s*Location:\s+([\w\W]*?)\s*Type:\s+([\w\W]*?)\s*Laydown Area:\s+([\w\W]*?)\s*Contact:\s+([\w\W]*?)\s*Build Packet:\s+([\w\W]*?)\s*Move\/Mod Packet:\s+([\w\W]*?)\s*TD Packet:\s+([\w\W]*?)\s*SSI Bid#:\s+([\w\W]*?)\s*Advance PO#:\s+([\w\W]*?)\s*Training:\s+([\w\W]*?)\s*Grab Items:\s+([\w\W]*?)\s*Labor Instructions:\s+([\w\W]*?)\s*Schedule Notes:\s*([\w\W]*?)\s*
Proof https://regex101.com/r/LCzlPz/1
Important Info
- Global match must be set to NO!
For more information, see Text Parser in the Make Help Center:
Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
Thank you however I have the same issues with both Parsers it doesn’t return anything:
The advanced text parser works differently, don’t use that.
Sorry that didn’t work either